jwt

package
v0.0.0-...-075e6e6 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithSigner

func ContextWithSigner(ctx context.Context, val Signer) context.Context

func ContextWithVerifier

func ContextWithVerifier(ctx context.Context, val Verifier) context.Context

func Sign

func Sign(ctx context.Context, expiresAt time.Time, customClaims Claims) (token string, err error)

func SignWithPrefix

func SignWithPrefix(ctx context.Context, expiresAt time.Time, customClaims Claims, typeVersion TypeVersion) (token string, err error)

func VerifyWithPrefix

func VerifyWithPrefix(ctx context.Context, token string, allowed []TypeVersion) (typeVersion TypeVersion, claims Claims, err error)

Types

type Claims

type Claims = jwt.MapClaims

func Verify

func Verify(ctx context.Context, token string) (claims Claims, err error)

type Signer

type Signer interface {
	Sign(ctx context.Context, expiresAt time.Time, customClaims Claims) (token string, err error)
}

func ContextSigner

func ContextSigner(ctx context.Context) (val Signer)

type TypeVersion

type TypeVersion struct {
	Type    string
	Version string
}

func TypeVersionFromString

func TypeVersionFromString(in string) (tv TypeVersion, ok bool)

func (TypeVersion) String

func (p TypeVersion) String() string

type Verifier

type Verifier interface {
	Verify(ctx context.Context, token string) (claims Claims, err error)
}

func ContextVerifier

func ContextVerifier(ctx context.Context) (val Verifier)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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