Documentation
¶
Index ¶
- func GenerateTOTPSecret() (string, error)
- func HashPassword(password string) (string, error)
- func PublicJWK(kid string, key *rsa.PublicKey) map[string]any
- func Sign(privatePEM []byte, kid string, claims Claims) (string, error)
- func VerifyPassword(encoded, password string) bool
- func VerifyTOTP(secret, code string, now time.Time) bool
- type Actor
- type Claims
- type KeyPair
- type RoleClaims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateTOTPSecret ¶
func HashPassword ¶
func VerifyPassword ¶
Types ¶
type Claims ¶
type Claims struct {
Issuer string `json:"iss"`
Subject string `json:"sub"`
Audience []string `json:"aud"`
ExpiresAt int64 `json:"exp"`
IssuedAt int64 `json:"iat"`
NotBefore int64 `json:"nbf"`
JWTID string `json:"jti"`
SessionID string `json:"sid,omitempty"`
ApplicationID string `json:"application_id,omitempty"`
ClientID string `json:"client_id,omitempty"`
TokenKind string `json:"token_kind"`
ActorType string `json:"actor_type"`
Scope string `json:"scope,omitempty"`
Roles RoleClaims `json:"roles"`
Email string `json:"email,omitempty"`
Locale string `json:"locale,omitempty"`
EmailVerified bool `json:"email_verified,omitempty"`
IsOrgVerified bool `json:"is_org_verified,omitempty"`
CustomClaims map[string]any `json:"custom_claims,omitempty"`
AMR []string `json:"amr,omitempty"`
Actor *Actor `json:"act,omitempty"`
}
type KeyPair ¶
func GenerateKeyPair ¶
type RoleClaims ¶
Click to show internal directories.
Click to hide internal directories.