Documentation
¶
Overview ¶
internal/auth/auth.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSecureKey ¶
GenerateSecureKey generates a secure random key for token signing
func GenerateToken ¶
func GenerateToken(userID string, config *TokenConfig) (string, error)
GenerateToken creates a new authentication token
Types ¶
type Token ¶
type Token struct {
UserID string `json:"user_id"`
ExpiresAt int64 `json:"expires_at"`
IssuedAt int64 `json:"issued_at"`
Claims map[string]string `json:"claims,omitempty"`
}
Token represents an authentication token
func ParseToken ¶
func ParseToken(tokenString string, config *TokenConfig) (*Token, error)
ParseToken parses and validates a token
type TokenConfig ¶
TokenConfig holds the configuration for token generation
Click to show internal directories.
Click to hide internal directories.