Documentation
¶
Overview ¶
Package auth issues and verifies FlowBaton's channel-bound Ed25519 session tokens.
Index ¶
Constants ¶
View Source
const ( DefaultTokenTTL = 5 * time.Minute MaxTokenTTL = time.Hour )
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid FlowBaton session token") ErrExpiredToken = errors.New("expired FlowBaton session token") )
Functions ¶
func LoadPrivateKey ¶
func LoadPrivateKey(path, expectedKeyID string) (string, ed25519.PrivateKey, error)
LoadPrivateKey reads the strict JSON format emitted by `flowbaton auth keygen`.
Types ¶
type Claims ¶
type Claims struct {
KeyID string `json:"kid"`
TenantID string `json:"tenant_id"`
PrincipalID string `json:"principal_id"`
CertificateFingerprint string `json:"certificate_fingerprint_sha256"`
ChannelBindingSHA256 string `json:"channel_binding_sha256"`
Nonce string `json:"nonce"`
Scopes []string `json:"scopes"`
IssuedAt int64 `json:"iat"`
ExpiresAt int64 `json:"exp"`
}
Claims are the authenticated facts carried by a FlowBaton-issued token. Tenant and principal are derived from a certificate mapping, never request JSON.
type Issuer ¶
type Issuer struct {
KeyID string
PrivateKey ed25519.PrivateKey
TTL time.Duration
Now func() time.Time
}
Issuer signs short-lived session tokens with one Ed25519 key.
type Verifier ¶
Verifier accepts the active and previous public keys during rotation.
func (Verifier) Verify ¶
Verify validates strict encoding, the Ed25519 signature, time bounds, and all mandatory channel-bound identity fields.
Click to show internal directories.
Click to hide internal directories.