Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -16,7 +16,7 @@ sequenceDiagram
|
||||
|
||||
Browser->>Web: GET /auth/admin/login
|
||||
Web->>Web: createAdminSsoChallenge() (PKCE+state+nonce)
|
||||
Web-->>Browser: 302 -> Authentik authorize, Set-Cookie: admin_sso_challenge
|
||||
Web-->>Browser: 302 -> Authentik authorize, Set-Cookie: hivegrid_admin_sso_challenge
|
||||
Browser->>Authentik: GET /application/o/authorize/...
|
||||
Authentik-->>Browser: Login + MFA, then 302 /auth/admin/callback?code=...&state=...
|
||||
Browser->>Web: GET /auth/admin/callback (with cookie)
|
||||
@@ -33,7 +33,7 @@ sequenceDiagram
|
||||
Web->>Web: readIdTokenFromRequest() + destroyAppSession()
|
||||
Web-->>Browser: 302 Authentik end_session_endpoint?id_token_hint=...
|
||||
Browser->>Authentik: end_session
|
||||
Authentik-->>Browser: 302 post_logout_redirect_uri -> /admin/login?logged_out=1
|
||||
Authentik-->>Browser: 302 post_logout_redirect_uri -> /login?logged_out=1
|
||||
```
|
||||
|
||||
## Required environment
|
||||
@@ -42,11 +42,11 @@ See `.env.example` for the canonical commented block. Coolify deployment:
|
||||
|
||||
| Key | Source |
|
||||
| ---------------------------------------------- | ------------------------------------------------- |
|
||||
| `AUTHENTIK_ISSUER_URL` | `https://auth.<base-domain>/application/o/toolctrl-admin-panel/` |
|
||||
| `AUTHENTIK_ADMIN_CLIENT_ID` | Blueprint client_id (default `toolctrl-admin-panel`) |
|
||||
| `AUTHENTIK_ISSUER_URL` | `https://auth.<base-domain>/application/o/hivegrid-admin-panel/` |
|
||||
| `AUTHENTIK_ADMIN_CLIENT_ID` | Blueprint client_id (default `hivegrid-admin-panel`) |
|
||||
| `AUTHENTIK_ADMIN_CLIENT_SECRET` | Authentik admin UI (Coolify vault) |
|
||||
| `AUTHENTIK_ADMIN_REDIRECT_URI` | `https://admin.<base-domain>/auth/admin/callback` |
|
||||
| `AUTHENTIK_ADMIN_POST_LOGOUT_REDIRECT_URI` | `https://admin.<base-domain>/admin/login?logged_out=1` |
|
||||
| `AUTHENTIK_ADMIN_POST_LOGOUT_REDIRECT_URI` | `https://admin.<base-domain>/login?logged_out=1` |
|
||||
| `ADMIN_FALLBACK_LOGIN_ENABLED` | `false` (default), flip to `true` during recovery |
|
||||
| `ADMIN_FALLBACK_LOGIN_EMAILS` | Comma-separated bootstrap emails |
|
||||
|
||||
@@ -56,8 +56,8 @@ The OIDC `groups` claim drives the AdminUser role. Highest priority wins.
|
||||
|
||||
| Authentik group | Internal AdminUser role | Notes |
|
||||
| ---------------- | ----------------------- | -------------------------------------- |
|
||||
| `toolctrl-admin` | `super_admin` | Full admin permissions; if user is in both `toolctrl-admin` and `toolctrl-staff`, this wins. |
|
||||
| `toolctrl-staff` | `staff` | Limited admin permissions. |
|
||||
| `hivegrid-admin` | `super_admin` | Full admin permissions; if user is in both `hivegrid-admin` and `hivegrid-staff`, this wins. |
|
||||
| `hivegrid-staff` | `staff` | Limited admin permissions. |
|
||||
| _other_ | _login rejected (403)_ | `admin.login.sso.failure` audit event with `reason=forbidden-group`. |
|
||||
|
||||
Granular permission checks remain in `apps/web/app/utils/permissions/`;
|
||||
@@ -66,16 +66,16 @@ the role is the coarse switch.
|
||||
## Onboarding a new admin
|
||||
|
||||
1. Create the user in Authentik (manual or via SCIM/LDAP if integrated).
|
||||
2. Add the user to the `toolctrl-admin` or `toolctrl-staff` group.
|
||||
2. Add the user to the `hivegrid-admin` or `hivegrid-staff` group.
|
||||
3. Enforce MFA enrollment in Authentik (provider-side).
|
||||
4. User clicks "Sign in with SSO" on `https://admin.<domain>/admin/login`.
|
||||
4. User clicks "Sign in with SSO" on `https://admin.<domain>/login`.
|
||||
5. First login triggers JIT-provisioning — AdminUser row appears in DB
|
||||
with `ssoProvider='authentik'`, `ssoSubjectId=<sub>`, `ssoGroups=[...]`,
|
||||
`lastSsoLoginAt=<now>`.
|
||||
|
||||
## Offboarding an admin
|
||||
|
||||
1. **Authentik** — remove the user from `toolctrl-admin`/`toolctrl-staff`
|
||||
1. **Authentik** — remove the user from `hivegrid-admin`/`hivegrid-staff`
|
||||
or deactivate the user.
|
||||
2. Next SSO login will be rejected (`admin.login.sso.failure` with
|
||||
`reason=forbidden-group`).
|
||||
@@ -107,7 +107,7 @@ Every fallback attempt — success or failure — writes an
|
||||
ADMIN_FALLBACK_LOGIN_EMAILS=bootstrap@<base-domain>
|
||||
```
|
||||
Redeploy the web service.
|
||||
3. Visit `https://admin.<base-domain>/admin/login` — expand the disclosure
|
||||
3. Visit `https://admin.<base-domain>/login` — expand the disclosure
|
||||
("Use emergency password login") and sign in with the bootstrap admin.
|
||||
4. Resolve the Authentik outage (see `docs/operations/authentik-setup.md`).
|
||||
5. **Immediately** revert the env flag back to `ADMIN_FALLBACK_LOGIN_ENABLED=false`
|
||||
@@ -160,13 +160,13 @@ persisting to `AuditEvent`.
|
||||
|
||||
| Symptom | Cause / Fix |
|
||||
| ------------------------------------------------------- | ------------------------------------------------------ |
|
||||
| `/auth/admin/login` redirects to `/admin/login?error=sso_unavailable` | env vars missing or Authentik unreachable. Check Sentry for `AdminSsoConfigError` (`discovery-failed`). |
|
||||
| `/auth/admin/login` redirects to `/login?error=sso_unavailable` | env vars missing or Authentik unreachable. Check Sentry for `AdminSsoConfigError` (`discovery-failed`). |
|
||||
| `error=sso_state_invalid` after Authentik | Challenge cookie expired, signed under stale secret, or tampered. Have user retry; check `CRYPTO_SECRET` rotation. |
|
||||
| `error=sso_forbidden_group` | User not in `toolctrl-admin`/`toolctrl-staff`. Add them in Authentik then retry. |
|
||||
| `error=sso_forbidden_group` | User not in `hivegrid-admin`/`hivegrid-staff`. Add them in Authentik then retry. |
|
||||
| `error=sso_email_not_verified` | Authentik user has not verified their email; enforce verification in Authentik provider settings. |
|
||||
| `error=sso_token_exchange_failed` | Client secret mismatch, clock-skew, or redirect-URI drift. Compare `.env` vs Authentik UI. |
|
||||
| JWKS-stale after key rotation | openid-client refreshes JWKS lazily; first failure forces a refetch. If repeated, restart the web container. |
|
||||
| Group claim empty in ID-token | Authentik provider must include `groups` scope mapping — see blueprint `03-application-toolctrl-admin.yaml`. |
|
||||
| Group claim empty in ID-token | Authentik provider must include `groups` scope mapping — see blueprint `03-application-hivegrid-admin.yaml`. |
|
||||
|
||||
## Rollback / kill-switch
|
||||
|
||||
|
||||
Reference in new issue
Block a user