v0.1.0 initial commit, auth features exatracted from logwisp to be a standalone utility package

This commit is contained in:
2025-11-02 13:05:37 -05:00
commit bc1a760397
18 changed files with 1715 additions and 0 deletions

17
interface.go Normal file
View File

@ -0,0 +1,17 @@
// FILE: auth/interface.go
package auth
// AuthenticatorInterface defines the authentication operations
type AuthenticatorInterface interface {
HashPassword(password string) (hash string, err error)
VerifyPassword(password, hash string) (err error)
GenerateToken(userID string, claims map[string]any) (token string, err error)
ValidateToken(token string) (userID string, claims map[string]any, err error)
}
// TokenValidator validates bearer tokens
type TokenValidator interface {
ValidateToken(token string) (valid bool)
AddToken(token string)
RemoveToken(token string)
}