auth

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Issuer   = "ui.antrea.io"
	Audience = "ui.antrea.io"
)

Variables

This section is empty.

Functions

func GeneratePrivateKey

func GeneratePrivateKey() (*rsa.PrivateKey, error)

func LoadPrivateKeyFromBytes

func LoadPrivateKeyFromBytes(pemData []byte) (*rsa.PrivateKey, error)

func LoadPrivateKeyFromFile

func LoadPrivateKeyFromFile(filepath string) (*rsa.PrivateKey, error)

func LoadPrivateKeyOrDie

func LoadPrivateKeyOrDie(filepath string) *rsa.PrivateKey

func NewTokenManager

func NewTokenManager(keyID string, key *rsa.PrivateKey) *tokenManager

Types

type JWTAccessClaims

type JWTAccessClaims struct {
	jwt.RegisteredClaims
}

type Token

type Token struct {
	Raw       string
	ExpiresIn time.Duration
	ExpiresAt time.Time
}

type TokenManager

type TokenManager interface {
	GetToken() (*Token, error)
	VerifyToken(rawToken string) error
	GetRefreshToken(lifetime time.Duration, subject string) (*Token, error)
	VerifyRefreshToken(rawToken string) error
	DeleteRefreshToken(rawToken string)
}

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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