secretaddon

package
v0.11.10 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JwtHeaderKid = "kid"
	JwtHeaderAlg = "alg"
)

Variables

View Source
var (
	ErrJwtInvalidAlgCombination = errors.New("invalid algorithm combination")
)

Functions

This section is empty.

Types

type AddonTool

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

func NewAddonTool

func NewAddonTool(keyStorage secretapi.KeyStorage) *AddonTool

func (*AddonTool) SignJwtToken

func (a *AddonTool) SignJwtToken(keyName string, jwtAlg JwtAlg, claims JwtClaims) (string, error)

func (*AddonTool) VerifyJwtToken

func (a *AddonTool) VerifyJwtToken(tokenString string) (map[string]interface{}, error)

type JwtAlg

type JwtAlg string
const (
	JwtAlgHS256 JwtAlg = "HS256"
	JwtAlgHS384 JwtAlg = "HS384"
	JwtAlgHS512 JwtAlg = "HS512"
	JwtAlgRS256 JwtAlg = "RS256"
	JwtAlgRS384 JwtAlg = "RS384"
	JwtAlgRS512 JwtAlg = "RS512"
	JwtAlgPS256 JwtAlg = "PS256"
	JwtAlgPS384 JwtAlg = "PS384"
	JwtAlgPS512 JwtAlg = "PS512"
	JwtAlgES256 JwtAlg = "ES256"
	JwtAlgES384 JwtAlg = "ES384"
	JwtAlgES512 JwtAlg = "ES512"
)

type JwtClaims added in v0.11.10

type JwtClaims map[string]interface{}

func (JwtClaims) SetAudience added in v0.11.10

func (j JwtClaims) SetAudience(audiences []string) JwtClaims

func (JwtClaims) SetExp added in v0.11.10

func (j JwtClaims) SetExp(t time.Time) JwtClaims

func (JwtClaims) SetID added in v0.11.10

func (j JwtClaims) SetID(id string) JwtClaims

func (JwtClaims) SetIat added in v0.11.10

func (j JwtClaims) SetIat(t time.Time) JwtClaims

func (JwtClaims) SetIssuer added in v0.11.10

func (j JwtClaims) SetIssuer(issuer string) JwtClaims

func (JwtClaims) SetNbf added in v0.11.10

func (j JwtClaims) SetNbf(t time.Time) JwtClaims

func (JwtClaims) SetSubject added in v0.11.10

func (j JwtClaims) SetSubject(subject string) JwtClaims

Jump to

Keyboard shortcuts

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