Documentation ¶
Overview ¶
Package gateway implments various auth logic used across noebs services
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrCreateDbRow = errors.New("unable to create a new db row/column")
)
Functions ¶
func GenerateAPIKey ¶
func GenerateSecretKey ¶
GenerateSecretKey generates secret key for jwt signing
func Instrumentation ¶
func Instrumentation() gin.HandlerFunc
Types ¶
type ErrorResponse ¶
type GetRedisClient ¶
type GetRedisClient func(string) *redis.Client
type JWTAuth ¶
type JWTAuth struct { Key []byte NoebsConfig ebs_fields.NoebsConfig }
JWTAuth provides an encapsulation for jwt auth
func (*JWTAuth) AuthMiddleware ¶
func (a *JWTAuth) AuthMiddleware() gin.HandlerFunc
AuthMiddleware is a JWT authorization middleware. It is used in our consumer services to get a username from the payload (maybe change it to mobile number at somepoint)
func (*JWTAuth) GenerateJWT ¶
GenerateJWT generates a JWT standard token with default values hardcoded. FIXME
type Token ¶
type Token struct { JWT string `json:"authorization"` Signature string `json:"signature"` Message string `json:"message"` Mobile string `json:"mobile" binding:"required,len=10"` }
Token used by noebs client to refresh an existing token, that is Token.JWT Signature is the signed Message (it could be a mobile username, or totp code) and Message is the raw message (it could be a mobile username, or totp code)
type TokenClaims ¶
type TokenClaims struct { Mobile string `json:"mobile"` jwt.StandardClaims }
TokenClaims noebs standard claim