v0.1.0 initial commit, auth features exatracted from logwisp to be a standalone utility package
This commit is contained in:
17
interface.go
Normal file
17
interface.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user