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

This commit is contained in:
lixen committed 2025-11-02 13:43:00 -05:00
commit 80b43ca23b
18 files changed
+1715

No files matched your search

+17
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)
}