jwt

package
v0.0.0-...-20a5a9c Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimsJwtID     = "jti"
	ClaimsIssuer    = "iss"
	ClaimsSubject   = "sub"
	ClaimsAudience  = "aud"
	ClaimsIssuedAt  = "iat"
	ClaimsExpiresAt = "exp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Secret

type Secret int
const (
	AccessSecret Secret = iota
	RefreshSecret
)

type StaticClaims

type StaticClaims struct {
	Issuer   string `json:"iss"`
	Audience string `json:"aud"`
}

type TokenManager

type TokenManager interface {
	NewToken(id uuid.UUID, ttl time.Duration, secret Secret) (string, error)
	ParseToken(token string, secret Secret) (jwt5.MapClaims, error)
}

func NewTokenManager

func NewTokenManager(accessSecret, refreshSecret string, claims StaticClaims) TokenManager

Jump to

Keyboard shortcuts

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