token

package
v0.3.4-alpha Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const TokenPrefix = "jv_"

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken() (fullToken string, tokenPrefix string, err error)

func HashToken

func HashToken(token string) string

func RegisterRoutes

func RegisterRoutes(protected *gin.RouterGroup, writeProtected *gin.RouterGroup, deps *core.ServerDependencies)

Types

type ErrorResponse

type ErrorResponse = contracts.ErrorResponse

type ServerDependencies

type ServerDependencies = core.ServerDependencies

type TokenService

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

func (*TokenService) Create

func (s *TokenService) Create(name string) (*models.ApiToken, string, error)

func (*TokenService) List

func (s *TokenService) List() ([]models.ApiToken, error)

func (*TokenService) Regenerate

func (s *TokenService) Regenerate(id string) (*models.ApiToken, string, error)

func (*TokenService) Revoke

func (s *TokenService) Revoke(id string) error

func (*TokenService) Validate

func (s *TokenService) Validate(rawToken string) (*models.ApiToken, error)

Jump to

Keyboard shortcuts

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