docs: ADR-019 (Authentik owns invites), supersede ADR-017
Record the invite-provisioning removal; mark ADR-017 superseded; fix ui-spec invite-onboarding + auth-delegation sections to reflect Authentik. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+36
-1
@@ -524,7 +524,11 @@ about editing a gate while it's unmet) so the reasoning survives, not just the n
|
||||
|
||||
## ADR-017 — Invite flow: Tapir creates Dex local-password accounts (write access to the shared identity provider)
|
||||
|
||||
**Status:** Accepted (2026-06-03), **recorded retroactively during reconciliation, then
|
||||
**Status:** ~~Accepted~~ **SUPERSEDED by [ADR-019](#adr-019--authentik-owns-invites-tapir-stops-provisioning-accounts) (2026-06-07).** The Dex local-password
|
||||
invite provisioning was removed when the homelab IdP migrated Dex→Authentik
|
||||
(infra ADR-0001); Authentik now owns invites. Original record below.
|
||||
|
||||
Accepted (2026-06-03), **recorded retroactively during reconciliation, then
|
||||
deliberately ratified KEEP (2026-06-03).** This capability **shipped in v0.7.0 without an ADR** —
|
||||
code, RBAC, and a deployed ServiceAccount landed before any decision record existed. This ADR
|
||||
documents what shipped and honestly records that the decision-before-code discipline was not
|
||||
@@ -662,6 +666,37 @@ Spec: `docs/specs/scheduled-discovery.md`.
|
||||
|
||||
---
|
||||
|
||||
## ADR-019 — Authentik owns invites; Tapir stops provisioning accounts
|
||||
|
||||
**Status:** Accepted (2026-06-07). **Supersedes ADR-017** (Dex local-password invite
|
||||
provisioning).
|
||||
|
||||
**Context:** infra ADR-0001 migrated the homelab IdP Dex→Authentik. Authentik provides
|
||||
first-class invite flows; the Dex local-password connector never consulted the Password
|
||||
CRs Tapir wrote (the defect that triggered the migration). Tapir-web's OIDC issuer now
|
||||
points at Authentik (infra ADR-0001 step 3).
|
||||
|
||||
**Decision:** Tapir no longer provisions accounts. The Dex-password invite path is removed:
|
||||
`internal/adapters/dex`, the public `/invite/{token}` set-password UI (`internal/web/invite.go`),
|
||||
the `tapir invite` CLI (`cmd/tapir/invite.go`), the `InvitationStore`/`DexPasswordCreator`
|
||||
ports + `App.Invitations`/`App.Dex` wiring, the invite Templ pages, and the
|
||||
`tapir invite` Taskfile target. New users are invited via Authentik's flow, log into Tapir
|
||||
via OIDC, and are captured by Tapir's existing provider-agnostic `/register` (display name).
|
||||
Login + Google moved by config only (Authentik per-app issuer); the OIDC adapter is unchanged.
|
||||
|
||||
**Consequences:** smaller Tapir blast surface — no writes to the shared identity provider, no
|
||||
configmap/CR access, the dedicated `passwords.dex.coreos.com` RBAC + ServiceAccount are
|
||||
removed (infra side, coupled change). The `invitations` table (migration 009) is left in
|
||||
place — migrations are append-only and the unused table is harmless; a future migration may
|
||||
drop it. The `*_DEX_*` config/identity names (`TAPIR_DEX_CLIENT_*`, `dex_subject`, the
|
||||
`DexAuth`/`oidc` package) are now misnomers; renaming is deferred (cosmetic, not behavioural).
|
||||
|
||||
**Rejected:** keeping Tapir's `/invite` UI but calling Authentik's API on claim — couples
|
||||
Tapir to Authentik's admin API + a token for no real gain; Authentik's own invite flow is
|
||||
the supported path.
|
||||
|
||||
---
|
||||
|
||||
## Rejected alternatives
|
||||
|
||||
Approaches considered during the 2026-06-02 planning + grill session and **deliberately not
|
||||
|
||||
+7
-5
@@ -74,10 +74,12 @@ summary_actions
|
||||
|
||||
## 6. Auth (Dex OIDC)
|
||||
|
||||
Authentication is delegated to **Dex** (OIDC provider at `TAPIR_OIDC_ISSUER`, default
|
||||
`https://auth.d-ma.be`). Dex is configured with two connectors: a local-password connector
|
||||
(for invited users created via `tapir invite`) and a Google OIDC upstream connector. Any
|
||||
authenticated Dex subject can register a Tapir account (ADR-012: allowlist removed).
|
||||
Authentication is delegated to the homelab OIDC provider at `TAPIR_OIDC_ISSUER` —
|
||||
**Authentik** since the Dex→Authentik migration (infra ADR-0001; ADR-019). It offers a
|
||||
Google upstream and Authentik-managed accounts (incl. its invite flow); Tapir no longer
|
||||
provisions accounts itself. Any authenticated subject can register a Tapir account
|
||||
(ADR-012: allowlist removed). The `oidc`/`DexAuth` package keeps its name for now (rename
|
||||
deferred, ADR-019).
|
||||
|
||||
- **Flow:** standard Authorization Code. Use `coreos/go-oidc` + `golang.org/x/oauth2`
|
||||
(justify the deps in the commit; both are the homelab-standard OIDC libs and small).
|
||||
@@ -172,7 +174,7 @@ distinguishable.
|
||||
| **Charmbracelet tapir spinner** | An animated in-flight indicator (charm palette) shown while a summarize is processing; an honest "queued/waiting" state under rate-limiting rather than a stuck spinner. | The spinner must tell the truth when the timedtext endpoint rate-limits (429), not imply imminence. | ADR-014; `25215cb`, `a4aeb5e` |
|
||||
| **Auto/manual summarization mode** | Per-user `auto_summarize`; manual lists new videos unsummarized and queues via `summarize_requested`; a mode toggle at `/account/summarize-mode`. Default is **true** for new users (migration 011, ADR-018); existing rows back-filled via migration 012. | Control over compute/noise — only summarize what the user cares about. | migration 006 (`748d5eb`, `bdbdce7`, `3014ee0`, `a269d4a`); migration 011/012 |
|
||||
| **Public landing page** | `/welcome` mounted **outside** the auth guard; unauthenticated `/` redirects there; logout returns there (not `/auth/login`). (The spec guarded everything except `/healthz` and `/auth/*`.) | A first-time visitor needs a public "what is this / get started" page before the login wall. | `d83943c`, `0fdf2f7`, `3a27bf1`, `d208110`, `8ca374e`, `f15f57f` |
|
||||
| **Invite onboarding** | Second registration path alongside Google OIDC. `tapir invite <email>` (CLI) creates a Dex local-password CRD in the `auth` namespace and prints an invite URL valid for 7 days. `/invite/{token}` (web) is a public page where the recipient sets a password; on submit, the Dex password is activated and the user is redirected to login. Token expiry is 7 days (`inviteTTL = 7 * 24 * time.Hour` in `cmd/tapir/invite.go`). The token is single-use: `ClaimInvitation` consumes it atomically on POST. | Allows inviting users who do not have a Google account or who should not use the Google OIDC upstream. | migration 009; `cmd/tapir/invite.go`; `internal/web/invite.go` |
|
||||
| **Invite onboarding** | **Removed from Tapir (ADR-019).** Invites are owned by the IdP (Authentik) now, not Tapir — the Dex local-password provisioning path (`tapir invite` CLI, `/invite/{token}` web flow, `internal/adapters/dex`) was deleted when the homelab migrated Dex→Authentik (infra ADR-0001). A new user is invited via Authentik's invite flow, logs into Tapir via OIDC, and is captured by the existing `/register` (display-name) gate. | Onboarding belongs to the identity provider; keeps Tapir out of the shared identity provider's write path. | ADR-019; infra ADR-0001 |
|
||||
| **Summarized-only filter** | `?summarized=1` query param on the list view. When set, only videos with a completed summary (`SummaryRow.Summarized = true`) are shown. Rendered as a "Summarized only" checkbox in the filter form. Summarized videos also sort to the top of the unfiltered list (`ORDER BY (s.id IS NOT NULL) DESC, seen_at DESC`). | Lets users focus on videos that are ready to read; newly landing summaries are visible at the top without filtering. | `internal/web/view.go` (`Filter.OnlySummarized`, `ListVideos` ORDER BY) |
|
||||
| **"Summarize now" foreground path** | Unified quiet nudge button on actionable non-summarized cards. Five explicit card states — (1) summarized: chip + no button; (2) no captions (`transcript_status = 'none'`): "No transcript available", no button; (3) queued: "Queued" chip, no button; (4) rate-limited: "Fetching soon…" + "Summarize now" → `POST /v/{id}/retry-now` (clears `rate_limited_at`, triggers engine); (5) pending: "Not summarized" + "Summarize now" → `POST /v/{id}/summarize` (queues + triggers engine). One verb, one style (`.btn-quiet`); backend difference invisible to user. Both handlers call `ProcessVideo` through `globalFetchGate`. Rate gate respected, not bypassed — this is onboarding prioritisation. | Fast onboarding value; honest dead-end for no-captions videos (no button that fails). | `internal/web/handlers.go` (`handleRetryNow`, `handleRequestSummarize`); `internal/web/views.templ` (`VideoCard`) |
|
||||
| **Pipeline stats bar** | A one-line status bar above the video list: `N summarized · M fetching soon · K no captions`. Computed from the unfiltered row set; hidden when all videos are summarized. Gives the user a clear read on pipeline state without any interaction. | Replaces the "why is nothing happening?" confusion when most videos are pending or rate-limited. | `internal/web/view.go` (`PipelineStats`, `pipelineStats`) |
|
||||
|
||||
Reference in New Issue
Block a user