accesstoken

package
v0.19.158 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dp dataprotection.Provider, provider jwt.Provider) jwt.Provider

New returns new Provider

Types

type Provider

type Provider struct {
	jwt.Provider
	// contains filtered or unexported fields
}

Provider of Access Token

func (*Provider) Issuer added in v0.11.0

func (p *Provider) Issuer() string

Issuer returns name of the issuer

func (*Provider) ParseToken

func (p *Provider) ParseToken(ctx context.Context, token string, cfg *jwt.VerifyConfig) (jwt.MapClaims, error)

Claims returns claims from the Access Token, or nil if `auth` is not Access Token

func (*Provider) PublicKey added in v0.11.0

func (p *Provider) PublicKey() crypto.PublicKey

PublicKey is returned for assymetric signer

func (*Provider) Sign added in v0.11.0

func (p *Provider) Sign(ctx context.Context, claims jwt.MapClaims) (string, error)

Sign returns AccessToken from claims

func (*Provider) TokenExpiry added in v0.11.0

func (p *Provider) TokenExpiry() time.Duration

TokenExpiry specifies token expiration period

Jump to

Keyboard shortcuts

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