auth

package
v0.0.0-...-4ad5369 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenExpired = jwt.ErrTokenExpired
)

Functions

This section is empty.

Types

type AES

type AES struct {
	Key []byte
}

func NewAES

func NewAES(key string) (*AES, error)

func (*AES) Encrypt

func (a *AES) Encrypt(data string) (encryptedText []byte, err error)

type Authentication

type Authentication struct {
	JWT        JWTAuthenticator
	Encryption Encryption
}

func NewAuthentication

func NewAuthentication(jwt2 *JWT, aes2 *AES) Authentication

type Encryption

type Encryption interface {
	Encrypt(data string) ([]byte, error)
}

type JWT

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

func NewJWTAuthenticator

func NewJWTAuthenticator(config *config.AtomicConfig, store store2.Store) *JWT

func (*JWT) GenerateToken

func (j *JWT) GenerateToken(claims jwt.MapClaims) (tokenString string, err error)

func (*JWT) ValidateToken

func (j *JWT) ValidateToken(token string) (bool, error)

type JWTAuthenticator

type JWTAuthenticator interface {
	GenerateToken(jwt.MapClaims) (string, error)
	ValidateToken(string) (bool, error)
}

Jump to

Keyboard shortcuts

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