Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JWTAuthManager ¶
type JWTAuthManager struct {
// contains filtered or unexported fields
}
JWTAuthManager implements local authentication using JWT.
func Init ¶
func Init() *JWTAuthManager
func NewJWTAuthManager ¶
func NewJWTAuthManager(config JWTConfig) *JWTAuthManager
func (*JWTAuthManager) Authenticate ¶
Authenticate validates a JWT token and returns the corresponding Principal.
type JWTConfig ¶
type JWTConfig struct {
SigningKey string // JWT signing key
}
func LoadJWTConfig ¶
LoadJWTConfig loads the JWT configuration from YAML and environment variables.
type JWTPrincipal ¶
type JWTPrincipal struct {
// contains filtered or unexported fields
}
JWTPrincipal implements the Principal interface.
func (*JWTPrincipal) GetClaims ¶
func (p *JWTPrincipal) GetClaims() map[string]interface{}
func (*JWTPrincipal) GetEmail ¶
func (p *JWTPrincipal) GetEmail() string
func (*JWTPrincipal) GetID ¶
func (p *JWTPrincipal) GetID() string
func (*JWTPrincipal) GetRoles ¶
func (p *JWTPrincipal) GetRoles() []string
Click to show internal directories.
Click to hide internal directories.