Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorUnauthenticated = errors.New("talaria/auth: unauthenticated")
ErrorUnauthenticated signifies a failed login attempt
Functions ¶
func FromContext ¶
FromContext extracts authentication tokens from a context
Types ¶
type Authenticator ¶
type Authenticator interface {
Login(ctx context.Context, username, password string) (token string, err error)
}
Authenticator handles login requests and returns JSON web tokens in exchange for credentials.
Tokens are signed via elliptical curve crypto (for shorter tokens). This also means that public keys can be distributed to all middlewares and other services so that they can independently validate tokens
func NewAuthenticator ¶
func NewAuthenticator(us users.Service, key *ecdsa.PrivateKey) (Authenticator, error)
Click to show internal directories.
Click to hide internal directories.