auth

package
v0.0.0-...-32983dc Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken interface {
	CreateAccessToken(ctx context.Context, input TokenPayloadInput) (tokenString string, payload *TokenPayload, err error)
	CreateRefreshToken(ctx context.Context, input TokenPayloadInput) (tokenString string, payload *TokenPayload, err error)
	VerifyToken(ctx context.Context, token string) (*TokenPayload, error)
}

func NewAuthToken

func NewAuthToken(cfg config.AuthConfig, log logger.Logger) (AuthToken, error)

type TokenPayload

type TokenPayload struct {
	AccountUUID  string
	SessionUUID  string
	RefreshToken string
	IssuedAt     time.Time
	ExpiredAt    time.Time
}

TokenPayload represents the payload of a JWT token

func (*TokenPayload) Valid

func (p *TokenPayload) Valid() error

Valid checks if the token payload is valid or not

type TokenPayloadInput

type TokenPayloadInput struct {
	AccountUUID string
	SessionUUID string
}

Jump to

Keyboard shortcuts

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