Documentation
¶
Index ¶
- func GenerateJWT(clientName string, roles []string, duration time.Duration) (string, error)
- func GenerateRandomToken() (string, error)
- func GetClientName(ctx context.Context) string
- func GetClientRoles(ctx context.Context) []string
- func LoadJWTConfig(cfg JWTConfig)
- func ValidateJWT(tokenStr string) (*jwt.Token, jwt.MapClaims, error)
- func WithClientMetadata(ctx context.Context, name string, roles []string) context.Context
- type JWTConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJWT ¶
GenerateJWT creates a signed JWT with roles and specified expiry duration
func GenerateRandomToken ¶
GenerateRandomToken returns a secure 32-byte (256-bit) random token as hex string
func GetClientName ¶
func GetClientRoles ¶
func LoadJWTConfig ¶
func LoadJWTConfig(cfg JWTConfig)
Types ¶
Click to show internal directories.
Click to hide internal directories.