jose

package
v0.0.0-...-f5bbbf4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	CustomClaims *CustomClaims `json:"-"`
	Scope        []string      `json:"scope"`
	// contains filtered or unexported fields
}

func NewClaims

func NewClaims(customClaimPath string) *Claims

func (*Claims) UnmarshalJSON

func (c *Claims) UnmarshalJSON(data []byte) error

func (*Claims) Validate

func (c *Claims) Validate(_ context.Context) error

type Config

type Config struct {
	IssuerURL       string
	CacheTTL        time.Duration
	Audience        []string
	CustomClaimPath string
}

func NewConfig

func NewConfig(issuerURL string, audience []string, customClaimPath string, cacheTTL time.Duration) *Config

type CustomClaims

type CustomClaims struct {
	TenantID    string   `json:"tenant_id"`
	Permissions []string `json:"permissions"`
}

type Validator

type Validator struct {
	*validator.Validator
}

func New

func New(cfg *Config) (*Validator, error)

func (*Validator) ParseClaims

func (v *Validator) ParseClaims(tokenClaims interface{}) (*entities.UserClaims, error)

Jump to

Keyboard shortcuts

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