Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateAccessToken(userId string, scope string, issuer string, audience string, clientID string, ...) (string, error)
- func GenerateSecureID() string
- func GetPublicKey() *rsa.PublicKey
- func InitJWTKeys() error
- func ResetJWTKeys()
- func ValidateToken(tokenString string) (jwtlib.MapClaims, error)
- type UserProfile
Constants ¶
View Source
const ( // Token expiration times (SOC2 CC6.3 - Logical Access Controls) AccessTokenTTL = 15 * time.Minute // Short-lived access tokens IDTokenTTL = 1 * time.Hour // ID tokens for user info RefreshTokenTTL = 7 * 24 * time.Hour // 7 days max for refresh tokens // Security parameters MinKeySize = 2048 // Minimum RSA key size (ISO27001 A.10.1.1) JTILength = 32 // JTI entropy length )
Security constants for SOC2/ISO27001 compliance
Variables ¶
View Source
var GenerateIDToken = generateIDToken
View Source
var GenerateRefreshToken = generateRefreshToken
Functions ¶
func GenerateAccessToken ¶
func GenerateSecureID ¶
func GenerateSecureID() string
GenerateSecureID generates a cryptographically secure random ID Complies with SOC2 CC6.1 and ISO27001 A.10.1.1
func GetPublicKey ¶
GetPublicKey returns the parsed RSA public key used for JWT verification. Returns nil if InitJWTKeys has not been called.
func InitJWTKeys ¶
func InitJWTKeys() error
func ResetJWTKeys ¶
func ResetJWTKeys()
ResetJWTKeys clears the cached JWT signing keys. Intended for testing only.
Types ¶
type UserProfile ¶
type UserProfile struct {
Email string `json:"email,omitempty"`
EmailVerified bool `json:"email_verified"`
Phone string `json:"phone,omitempty"`
PhoneVerified bool `json:"phone_verified"`
FirstName string `json:"first_name,omitempty"`
MiddleName string `json:"middle_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Suffix string `json:"suffix,omitempty"`
Birthdate string `json:"birthdate,omitempty"`
Gender string `json:"gender,omitempty"`
Address string `json:"address,omitempty"`
Picture string `json:"picture,omitempty"`
}
UserProfile represents user profile data for ID tokens
Click to show internal directories.
Click to hide internal directories.