Milestone M2: multi-tenancy, authentication and the cross-cutting pieces that came up along the way.
Tenancy
Users, organizations and memberships with exactly one owner per org.
Row-level security on every org table. Queries run in tenant.DB.Tx with an org, user, global or system scope; without a scope nothing is visible. The app must connect as a non-superuser role, otherwise RLS is bypassed (a warning is logged at startup).
Authentication
Password login (argon2id, rehash on parameter change, constant-time miss path) with optional TOTP, replay-protected codes and single-use recovery codes.
Per-organization OpenID Connect SSO: owners manage their own providers; PKCE, nonce and browser-bound state; accounts are linked by issuer subject and never matched by email. Requests to customer IdPs refuse non-public addresses unless UPTIME_SSO_ALLOW_PRIVATE_NETWORKS allows it.
Redis-backed sessions with sliding and absolute expiry, CSRF synchronizer tokens plus Origin check, rate limits shared across replicas.
Secrets at rest (TOTP seeds, client secrets) sealed with a rotatable keyring (UPTIME_SECRET_KEYS).
Cross-cutting
English and German UI and API messages; tests fail on missing or unused catalog keys.
Request IDs in response headers, logs and API error bodies.
Code follows the Google Go style guide; .golangci.yml added.
UPTIME_TEST_DATABASE_URL and UPTIME_TEST_REDIS_URL (a Redis database reserved for tests; it is flushed) enable the integration tests, including full SSO flows against an in-process IdP.
Follow-ups
#41 enforce the org TOTP requirement, #45 option to require SSO, #43 re-enable staticcheck.
Milestone M2: multi-tenancy, authentication and the cross-cutting pieces that came up along the way.
## Tenancy
- Users, organizations and memberships with exactly one owner per org.
- Row-level security on every org table. Queries run in `tenant.DB.Tx` with an org, user, global or system scope; without a scope nothing is visible. The app must connect as a non-superuser role, otherwise RLS is bypassed (a warning is logged at startup).
## Authentication
- Password login (argon2id, rehash on parameter change, constant-time miss path) with optional TOTP, replay-protected codes and single-use recovery codes.
- Per-organization OpenID Connect SSO: owners manage their own providers; PKCE, nonce and browser-bound state; accounts are linked by issuer subject and never matched by email. Requests to customer IdPs refuse non-public addresses unless `UPTIME_SSO_ALLOW_PRIVATE_NETWORKS` allows it.
- Redis-backed sessions with sliding and absolute expiry, CSRF synchronizer tokens plus Origin check, rate limits shared across replicas.
- Secrets at rest (TOTP seeds, client secrets) sealed with a rotatable keyring (`UPTIME_SECRET_KEYS`).
## Cross-cutting
- English and German UI and API messages; tests fail on missing or unused catalog keys.
- Request IDs in response headers, logs and API error bodies.
- Code follows the Google Go style guide; `.golangci.yml` added.
## New configuration
`UPTIME_SECRET_KEYS` (required), `UPTIME_SIGNUP`, `UPTIME_SESSION_IDLE`, `UPTIME_SESSION_ABSOLUTE`, `UPTIME_PUBLIC_URL`, `UPTIME_SSO_ALLOW_PRIVATE_NETWORKS`. `UPTIME_LOG_FORMAT` was removed (always JSON).
## Testing
`UPTIME_TEST_DATABASE_URL` and `UPTIME_TEST_REDIS_URL` (a Redis database reserved for tests; it is flushed) enable the integration tests, including full SSO flows against an in-process IdP.
## Follow-ups
#41 enforce the org TOTP requirement, #45 option to require SSO, #43 re-enable staticcheck.
Closes #1, #2, #3, #4, #5, #40, #42, #44
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi
added this to the M2 Tenancy & Login milestone 2026-11-21 23:35:50 +00:00
Document every package and exported identifier, return the log level
from NewLogger instead of keeping it in a package variable, and stop
tests from mutating the argon2 parameters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
A well-formed X-Request-ID from a proxy is kept, otherwise a UUIDv7 is
generated. The ID is echoed in the response header, added to every log
record written with the request context and returned in API error
bodies.
Closes#44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Owners manage OIDC providers under /settings/sso. Users start at
/sso/<org>. New users can be provisioned for verified emails in allowed
domains; existing accounts are never matched by email and must link
their SSO sign-in while signed in.
Closes#4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Milestone M2: multi-tenancy, authentication and the cross-cutting pieces that came up along the way.
Tenancy
tenant.DB.Txwith an org, user, global or system scope; without a scope nothing is visible. The app must connect as a non-superuser role, otherwise RLS is bypassed (a warning is logged at startup).Authentication
UPTIME_SSO_ALLOW_PRIVATE_NETWORKSallows it.UPTIME_SECRET_KEYS).Cross-cutting
.golangci.ymladded.New configuration
UPTIME_SECRET_KEYS(required),UPTIME_SIGNUP,UPTIME_SESSION_IDLE,UPTIME_SESSION_ABSOLUTE,UPTIME_PUBLIC_URL,UPTIME_SSO_ALLOW_PRIVATE_NETWORKS.UPTIME_LOG_FORMATwas removed (always JSON).Testing
UPTIME_TEST_DATABASE_URLandUPTIME_TEST_REDIS_URL(a Redis database reserved for tests; it is flushed) enable the integration tests, including full SSO flows against an in-process IdP.Follow-ups
#41 enforce the org TOTP requirement, #45 option to require SSO, #43 re-enable staticcheck.
Closes #1, #2, #3, #4, #5, #40, #42, #44
🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3