auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePasswordHash

func GeneratePasswordHash(clearTextPassword string) (string, error)

Types

type Auth

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

func New

func New(config *config.ConfigFile, logger zerolog.Logger, jwtSecret []byte) *Auth

func (*Auth) JwtMiddleware

func (a *Auth) JwtMiddleware(next echo.HandlerFunc) echo.HandlerFunc

JwtMiddleware validates JWT tokens

func (*Auth) Login

func (a *Auth) Login(c echo.Context) error

login handles POST /login with username and password

type JWTClaims

type JWTClaims struct {
	Username string `json:"username"`
	jwt.RegisteredClaims
}

JWTClaims represents the JWT token claims

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

LoginRequest represents the login request payload

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

LoginResponse represents the login response with token

Jump to

Keyboard shortcuts

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