Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CodeTypeMissingBearerToken indicates that the bearer token was not provided CodeTypeMissingBearerToken errors.CodeType = "MISSING_BEARER_TOKEN" // CodeTypeErrorOnRenewingCerts indicates that the application couldnt renew the JWKS certificates CodeTypeErrorOnRenewingCerts errors.CodeType = "COULD_NOT_RENEW_CERTS" // CodeTypeErrorOnParsingJWTToken indicates that the application couldn't parse the JWT token CodeTypeErrorOnParsingJWTToken errors.CodeType = "COULD_NOT_HANDLE_TOKEN" )
View Source
const ContextKeyAccountID string = "account_id"
ContextKeyAccountID is the key used to retrieve and save accountId into the context
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAuthenticator ¶
type AccountAuthenticator struct {
// contains filtered or unexported fields
}
AccountAuthenticator structure responsible for handling request authentication
func MustNewAccountAuthenticator ¶
func MustNewAccountAuthenticator(logger infra.Logger, jwks infra.JWKSClient) AccountAuthenticator
NewAccountAuthenticator creates a new instance of the AccountAuthenticator structure. It panics if any error is found.
func NewAccountAuthenticator ¶
func NewAccountAuthenticator(logger infra.Logger, jwks infra.JWKSClient) (AccountAuthenticator, error)
NewAccountAuthenticator creates a new instance of the AccountAuthenticator structure
func (AccountAuthenticator) Authenticate ¶
func (ua AccountAuthenticator) Authenticate(ctx *routing.Context) error
Authenticate is responsible for verify if the request is authenticated
It tries to authenticate the token with the certifications on memory, if it fails, the certifications are renewed and the authentication is run again.
Click to show internal directories.
Click to hide internal directories.