go-api-boilerplate: github.com/vardius/go-api-boilerplate/pkg/auth Index | Files | Directories

package auth

import "github.com/vardius/go-api-boilerplate/pkg/auth"

Index

Package Files

authenticator.go authorizer.go claims.go provider.go

type Authenticator Uses

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

func NewSecretAuthenticator Uses

func NewSecretAuthenticator(secret []byte) Authenticator

type Claims Uses

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

func (*Claims) Valid Uses

func (c *Claims) Valid() error

type ClaimsProvider Uses

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

func NewClaimsProvider Uses

func NewClaimsProvider(authenticator Authenticator) ClaimsProvider

type TokenAuthorizer Uses

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

func NewJWTTokenAuthorizer Uses

func NewJWTTokenAuthorizer(claimsProvider ClaimsProvider) TokenAuthorizer

Directories

PathSynopsis
oauth2

Package auth imports 5 packages (graph) and is imported by 3 packages. Updated 2020-06-29. Refresh now. Tools for package owners.