token

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorizedAccess = errors.New("missing or invalid credentials provided")

Functions

This section is empty.

Types

type BasicJWTIdentityProvider

type BasicJWTIdentityProvider struct {
	// contains filtered or unexported fields
}

func NewBasicJWTIdentityProvider

func NewBasicJWTIdentityProvider(secret []byte, priKey *rsa.PrivateKey, pubKey *rsa.PublicKey) *BasicJWTIdentityProvider

func (*BasicJWTIdentityProvider) Parse added in v0.3.0

func (idp *BasicJWTIdentityProvider) Parse(tokenStr string) (map[string]interface{}, bool, error)

func (*BasicJWTIdentityProvider) ParseUnverified added in v0.3.0

func (idp *BasicJWTIdentityProvider) ParseUnverified(tokenStr string) (map[string]interface{}, error)

func (*BasicJWTIdentityProvider) Token

func (idp *BasicJWTIdentityProvider) Token(sub, jti string, d time.Duration, m map[string]interface{}) (token string, expires int64, err error)

type Provider added in v0.2.0

type Provider interface {
	Token(sub, jti string, d time.Duration, m map[string]interface{}) (string, int64, error)
	Parse(tokenStr string) (map[string]interface{}, bool, error)
	ParseUnverified(tokenStr string) (map[string]interface{}, error)
}

func InitProvider added in v0.2.0

func InitProvider(secret []byte, rsaPriPath, rsaPubPath string) Provider

Jump to

Keyboard shortcuts

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