authentication

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(config Config) (*Authenticator, error)

func (*Authenticator) IssueAccessToken

func (auth *Authenticator) IssueAccessToken(subject string) (string, error)

func (*Authenticator) IssueJwt

func (auth *Authenticator) IssueJwt(claims jwt.Claims) (string, error)

func (*Authenticator) VerifyJwt

func (auth *Authenticator) VerifyJwt(tokenString string) (*jwt.Token, error)

type Config

type Config struct {
	PrivateKey           string
	PublicKey            string
	AccessTokenLifeTime  time.Duration
	RefreshTokenLifeTime time.Duration
}

Jump to

Keyboard shortcuts

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