auth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthManager

type AuthManager interface {
	CreateNewPair(ctx context.Context, user models.User) (*TokenPair, error)
	Refresh(ctx context.Context, refreshToken string) (*TokenPair, error)
	Parse(tokenStr string) (*Claims, error)
	RevokeAllUserTokens(ctx context.Context, userID uuid.UUID) error
}

func NewJWTManager

func NewJWTManager(cfg config.Config, store store.Store) (AuthManager, error)

type Claims

type Claims struct {
	jwt.RegisteredClaims
	UserID    string `json:"user_id" validate:"required,uuid"`
	Login     string `json:"login"`
	TokenType string `json:"token_type"`
}

type TokenPair

type TokenPair struct {
	Access, Refresh string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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