Documentation ¶
Index ¶
- Constants
- type Authenticator
- func (a *Authenticator) AuthenticateAPIKey(_ context.Context, apiKey []byte) (*entities.UserInfo, error)
- func (a *Authenticator) AuthenticateJWT(ctx context.Context, token string) (*entities.UserInfo, error)
- func (a *Authenticator) AuthenticateTLS(_ context.Context, connState *tls2.ConnectionState) (*entities.UserInfo, error)
Constants ¶
View Source
const ( APIKeyAuthMode = "apikey" JWTAuthMode = "jwt" TLSAuthMode = "tls" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
func New ¶
func New(jwtValidator jwt.Validator, apiKeyClaims map[string]*entities.UserClaims, rootCAs *x509.CertPool, logger log.Logger) *Authenticator
func (*Authenticator) AuthenticateAPIKey ¶
func (*Authenticator) AuthenticateJWT ¶
func (*Authenticator) AuthenticateTLS ¶
func (a *Authenticator) AuthenticateTLS(_ context.Context, connState *tls2.ConnectionState) (*entities.UserInfo, error)
AuthenticateTLS checks rootCAs and retrieve user info
Click to show internal directories.
Click to hide internal directories.