token

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneratedClaimKey   = "gen"
	GeneratedClaimValue = "system"
	OrgIDsClaimKey      = "org_ids"
)

Variables

View Source
var (
	ErrMissingRSADisableToken = errors.New("rsa key missing in config, generate and pass file path")
	ErrInvalidToken           = errors.New("failed to verify a valid token")
)

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(keySet jwk.Set, issuer string, validity time.Duration) Service

NewService creates a new token service generate keys used for rsa via frontier cli "frontier server keygen"

func (Service) Build

func (s Service) Build(subjectID string, metadata map[string]string) ([]byte, error)

Build creates an access token for the given subjectID

func (Service) GetPublicKeySet

func (s Service) GetPublicKeySet() jwk.Set

GetPublicKeySet returns the public keys to verify the access token

func (Service) Parse

func (s Service) Parse(ctx context.Context, userToken []byte) (string, map[string]any, error)

Jump to

Keyboard shortcuts

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