token

package
v0.0.0-...-847e23e Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Claims claimsKey = "claims"

Functions

func CreateJWT

func CreateJWT(userId uuid.UUID) (string, error)

func CreateRefreshToken

func CreateRefreshToken(uuid uuid.UUID) (string, *time.Time)

Types

type AuthorizationRequired

type AuthorizationRequired interface {
	IsAuthorizationRequired() bool
}

type DefaultToken

type DefaultToken struct {
	AccessToken  string
	RefreshToken string
}

type PublicPrivateKey

type PublicPrivateKey struct {
	PublicKey  *rsa.PublicKey
	PrivateKey *rsa.PrivateKey
}

type Settings

type Settings struct {
	Scheme             string
	Issuer             string
	Audience           string
	PrivateKeyPath     string
	PublicKeyPath      string
	RefreshTokenExpire time.Duration
	AccessTokenExpire  time.Duration
	PublicPrivateKey   PublicPrivateKey
	Verifier           jwt.Verifier
	Signer             jwt.Signer
}

func (*Settings) AuthInterceptor

func (s *Settings) AuthInterceptor() grpc.UnaryServerInterceptor

func (*Settings) Setup

func (s *Settings) Setup()

type Token

type Token jwt.RegisteredClaims

Jump to

Keyboard shortcuts

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