auth

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 6 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,omitempty"`
}

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(ctx context.Context, token string) (*identity.Identity, error)
}

func NewJWTTokenAuthorizer

func NewJWTTokenAuthorizer(authClient proto.AuthenticationServiceClient, claimsProvider ClaimsProvider, authenticator Authenticator) TokenAuthorizer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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