auth

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Verify(token string, claims jwt.Claims) error
	Sign(token *jwt.Token) (string, error)
}

func NewSecretAuthenticator

func NewSecretAuthenticator(secret []byte) Authenticator

type Claims

type Claims struct {
	jwt.StandardClaims
	Identity identity.Identity `json:"identity"`
}

func (*Claims) Valid

func (c *Claims) Valid() error

type ClaimsProvider

type ClaimsProvider interface {
	FromJWT(jwt string) (Claims, error)
}

func NewClaimsProvider

func NewClaimsProvider(authenticator Authenticator) ClaimsProvider

type TokenAuthorizer

type TokenAuthorizer interface {
	Auth(token string) (identity.Identity, error)
}

func NewJWTTokenAuthorizer

func NewJWTTokenAuthorizer(claimsProvider ClaimsProvider) TokenAuthorizer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL