Documentation ¶
Index ¶
- Variables
- func ConfigActivator(configKey string) *di.Activator
- func GetKey(key string) ([]byte, error)
- func GetRSAPrivateKey(key string) (*rsa.PrivateKey, error)
- func GetRSAPublicKey(key string) (*rsa.PublicKey, error)
- func RegisteredClaims(iss string, sub uuid.UUID, aud jwt.ClaimStrings, ttl time.Duration) jwt.RegisteredClaims
- func SignerActivator() *di.Activator
- type Config
- type ConfigKey
- type Signer
- type SignerKey
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ConfigActivator ¶
func GetRSAPrivateKey ¶
func GetRSAPrivateKey(key string) (*rsa.PrivateKey, error)
func RegisteredClaims ¶
func SignerActivator ¶
Types ¶
type Config ¶
type Config struct { PrivateKey string `mapstructure:"private_key"` AccessTokenTTL time.Duration `mapstructure:"access_token_ttl"` RefreshTokenTTL time.Duration `mapstructure:"refresh_token_ttl"` // contains filtered or unexported fields }
func (*Config) GetPrivateKey ¶
func (cfg *Config) GetPrivateKey() *rsa.PrivateKey
func (*Config) GetPublicKey ¶
type UserClaims ¶
type UserClaims struct { jwt.RegisteredClaims Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Roles []string `json:"roles,omitempty"` OTP bool `json:"otp"` Meta json.RawMessage `json:"meta,omitempty"` }
func (UserClaims) UserID ¶
func (c UserClaims) UserID() uuid.UUID
func (UserClaims) Valid ¶
func (c UserClaims) Valid() error
Click to show internal directories.
Click to hide internal directories.