token

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultAuthCodeGenerator

type DefaultAuthCodeGenerator struct{}

func (*DefaultAuthCodeGenerator) Generate

func (x *DefaultAuthCodeGenerator) Generate() string

type DefaultTokenGenerator

type DefaultTokenGenerator struct {
	SigningAlgorithm string
	PrivateKey       *rsa.PrivateKey
	ClaimsGenerator  ITokenClaimsGenerator
}

func (*DefaultTokenGenerator) GenerateAccessToken

func (x *DefaultTokenGenerator) GenerateAccessToken(ctx *fasthttp.RequestCtx, grantType string, client model.IClient, scopes []string, username string) (string, error)

func (*DefaultTokenGenerator) GenerateRefreshToken

func (x *DefaultTokenGenerator) GenerateRefreshToken() string

type IAuthCodeGenerator

type IAuthCodeGenerator interface {
	Generate() string
}

func NewDefaultAuthCodeGenerator

func NewDefaultAuthCodeGenerator() IAuthCodeGenerator

type ITokenClaimsGenerator

type ITokenClaimsGenerator interface {
	// Generate(ctx *fasthttp.RequestCtx, grantType string, client model.IClient, scopes []string, username string) *map[string]interface{}
	Generate(grantType string, client model.IClient, scopes []string, username string) *map[string]interface{}
}

type ITokenGenerator

type ITokenGenerator interface {
	GenerateAccessToken(ctx *fasthttp.RequestCtx, grantType string, client model.IClient, scopes []string, username string) (string, error)
	GenerateRefreshToken() string
}

func NewDefaultTokenGenerator

func NewDefaultTokenGenerator(privateKey *rsa.PrivateKey, signingAlgorithm string, claimsGenerator ITokenClaimsGenerator) ITokenGenerator

Jump to

Keyboard shortcuts

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