feat(identity): add server sessions and audited mail recovery

This commit is contained in:
TakuyaYagam1 committed 2026-10-07 11:03:46 +03:00
1 parent 20c03288d6
commit 4ee53d9a74
58 files changed
+5359 -567

No files matched your search

+11 -4
View File
@@ -120,10 +120,9 @@ type Config struct {
// that may run at once; further logins and registrations wait.
PasswordHashConcurrency int
// IdentityKeySecret keys the HMACs that scope idempotency records and
// rate limit counters by email address, so neither holds a plain hash of
// an address or a password. Empty means a random secret for the life of
// the process.
// IdentityKeySecret seeds domain-separated HMAC keys for idempotency
// scopes, rate limit buckets, and session CSRF tokens. Empty means a random
// secret for the life of the process.
IdentityKeySecret string
// IdentityAllowEphemeralKey lets a development stand run without
// IDENTITY_KEY_SECRET, with a random secret per process.
@@ -136,6 +135,14 @@ type Config struct {
// IdentityClientHourlyLimit bounds the registrations and resends of one
// client network address per hour.
IdentityClientHourlyLimit int
// IdentityLoginEmailHourlyLimit bounds login attempts for one normalized
// email address per hour.
IdentityLoginEmailHourlyLimit int
// IdentitySessionIdleTimeout ends a session after this much inactivity.
IdentitySessionIdleTimeout time.Duration
// IdentitySessionAbsoluteLifetime is the maximum lifetime of a session,
// even when it remains active.
IdentitySessionAbsoluteLifetime time.Duration
// TrustedProxyCIDRs are the reverse proxies in front of the API. The
// client address is taken from X-Forwarded-For only through them (see