Documentation
¶
Index ¶
- func ApiKey(expected string) gin.HandlerFunc
- func ParseRSAPrivateKey(pem string) (*rsa.PrivateKey, error)
- func ParseToken(tokenString, secret string) (jwt.MapClaims, error)
- func RequiredApiKeyHeader(expected string) gin.HandlerFunc
- func ValidatePasswordHash(encoded string) error
- func ValidateRS256(tokenString string, pub *rsa.PublicKey, issuer string, audience string) (jwt.MapClaims, error)
- func VerifyPassword(encoded string, password string) bool
- type JWK
- type JWKS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApiKey ¶
func ApiKey(expected string) gin.HandlerFunc
ApiKey returns a Gin middleware that accepts X-API-Key and keeps the legacy ?key= query parameter for compatibility.
func ParseRSAPrivateKey ¶
func ParseRSAPrivateKey(pem string) (*rsa.PrivateKey, error)
ParseRSAPrivateKey loads an RSA private key from PEM.
func ParseToken ¶
ParseToken validates a JWT string, defaulting the secret when empty, and returns claims.
func RequiredApiKeyHeader ¶ added in v0.2.57
func RequiredApiKeyHeader(expected string) gin.HandlerFunc
RequiredApiKeyHeader protects high-privilege routes without placing the key in URLs, access logs, browser history, or proxy query-string telemetry. An empty configured key fails closed.
func ValidatePasswordHash ¶ added in v0.2.60
ValidatePasswordHash accepts Tikti's native bcrypt hashes and the bounded Argon2id PHC format used by the Code Foundry production bootstrap.
func ValidateRS256 ¶
func ValidateRS256(tokenString string, pub *rsa.PublicKey, issuer string, audience string) (jwt.MapClaims, error)
ValidateRS256 validates an RS256 JWT using a provided RSA public key.
func VerifyPassword ¶ added in v0.2.60
VerifyPassword compares a password against a supported bounded hash.