Repository navigation
Description
Why
A core LIF goal is that components/microservices stay independent enough that deployers can pick what they run alongside their existing data infrastructure. MDR's unique value is the metadata/schema registry. The LDE self-service API-key work (#1000) initially put key issuance + the Cognito identity in MDR (#1033/#1035), which would make MDR a fleet-wide auth dependency — a deployer wanting only LDE + their own warehouse would have to stand up full MDR just for keys. That conflates two domains and cuts against the independence goal.
Decision (see ADR 0002)
The key/identity control plane — identity (Cognito), developer-key issuance/management, and cross-cutting admin dashboards/monitoring — belongs in a dedicated LIF control-plane service, not MDR. MDR returns to being just the metadata registry and consumes the control plane like any other service. Runtime coupling is avoided by signed-token offline validation (API services verify keys with a shared secret; no per-request call to the issuer).
Near-term (already in flight)
Ship LDE keys hosted in MDR as self-contained Polylith bricks (developer_keys store/issuance + cognito_auth verify), with no imports into MDR-domain services, so MDR is the interim host, not the owner. Because validation is offline/signed and the logic is bricked, extraction later is a re-deploy, not a rewrite.
- LDE auth (A): MDR developer-keys store + key-management endpoints #1033 (backend store + endpoints) — PR Issue #1033: MDR developer-keys store + key-management endpoints #1038 · LDE auth (C): MDR UI — API Keys management page (create / list / revoke) #1035 (MDR UI page) — PR Issue #1035: MDR UI — API Keys page (create / list / revoke) #1039 · LDE auth (B): cognito_auth brick + composite LDE inbound middleware (JWT or signed key) #1034 (
cognito_authbrick + LDE composite middleware).
Extraction workstreams (this epic)
- New control-plane service (base + project) hosting the
developer_keys+cognito_authbricks. - Move identity ownership (Cognito self-serve, Self-Serve MDR: Phase 1 — Cognito Self-Registration #882/Self-Serve MDR: Phase 2 — Schema Isolation per Tenant #883/Self-Serve MDR: Phase 3 — Landing Page, Invite Links & Group Management #884) out of MDR into the control plane — needs its own design spike (bigger than keys).
- Admin/monitoring dashboards (key usage, revocations, per-service health).
- Point MDR + LDE + future API services at the control plane; MDR keeps only the metadata domain.
- Deployer story: run the small control-plane service instead of full MDR for auth-only deployments.
Refs: #1000, ADR 0002 (control plane vs MDR host), ADR 0001 (auth), docs/design/cross-cutting/self-serve-tenant-auth.md.
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
bjagg commentedon Jul 13, 2026
Decision recorded in ADR 0002 → PR #1042.
bjagg commentedon Jul 16, 2026
Candidate control-plane monitoring feature: a cache-introspection ("what's currently cached") endpoint.
Came up while designing how the LDE test/export playground (#1036) surfaces test users. A "get learners" endpoint can only mean "what's in the Query Planner cache right now" — which is non-deterministic (cache warms/evicts), privacy-sensitive (it's a learner enumeration), and circular for the demo (test users aren't cached until queried). So it's the wrong source for the demo picker (that uses a curated list instead — see the persona-source issue).
But as an ops/monitoring view it's legitimate and fits this epic's admin/monitoring scope: a permissioned, tenant-scoped "what's cached / cache health" endpoint — explicitly labeled as cache state, not an authoritative learner directory (LIF is federated; there isn't one). Capturing here as a low-priority control-plane monitoring candidate rather than an LDE/demo dependency.
Issue #1034: scaffold cognito_auth brick + composite LDE inbound auth…
docs: ADR 0002 (Proposed) — LIF control plane for identity & develope…
docs: ADR 0004 — components are the unit of reuse (bare core, decorat…
docs: ADR 0005 — product surfaces & component tiers (MDR / demo app /…
developer_keysbrick #11803 remaining items
bjagg commentedon Aug 31, 2026
Broken down into 11 sub-issues (2026-08-31)
Sequenced. The dependency order matters more than the list — starting in the wrong place is how this epic stalls.
Phase A — make ADR 0002's premise true (blocks everything else)
developer_keysbrick #1180 — extract developer-key logic into a portabledeveloper_keysbrickPhase B — stand it up
Phase C — cut over
Phase D — admin & monitoring
Phase E — the deferred question
This epic and ADR 0002 both state that extraction will be "a re-deploy, not a rewrite", because phase 1 was to host the keys in MDR as self-contained bricks with no imports into MDR-domain services.
That is not what shipped.
components/lif/developer_keysdoes not exist. The key logic lives incomponents/lif/mdr_dto/developer_api_key_dto.py,components/lif/mdr_services/developer_api_key_service.py,components/lif/datatypes/mdr_sql_model.py, andbases/lif/mdr_restapi/developer_api_key_endpoints.py— all MDR-domain.So a control-plane project built today would have to package
mdr_dto+mdr_services+datatypes, inheriting the entire MDR domain — precisely what ADR 0002 exists to prevent.cognito_authdid land correctly as its own brick, so only the key half is affected.Consequence for estimation: the <40h figure in the sprint plan assumes the re-deploy premise. With #1180 in front of it, and phases D–E included, this epic is materially larger. #1180 alone is a refactor across three shared bricks. Worth re-estimating before committing it to a sprint.
Issue #341: feat: emit Query Planner query statistics as structured l…
bjagg commentedon Sep 21, 2026
Cross-linking #1290 (EPIC: a deployable MDR for outside implementers — no AWS dependency, no demo functionality), because it overlaps this epic's seam directly rather than tangentially.
Measured while scoping it: ~85% of MDR's Cognito/boto coupling sits in four files —
mdr_restapi/tenant_endpoints.py(50 refs),mdr_auth/core.py(39),mdr_auth/cognito_admin.py(20),mdr_services/workspace_service.py(18). That is the identity/tenant surface this epic proposes to extract. MDR's domain logic is already clean —mdr_servicesis 11,113 lines with ~2 references.So the two epics are working the same seam from opposite ends. Whichever moves first should probably absorb the auth half, leaving the other the packaging, demo-strip and deployment concerns. Flagged as a sequencing decision for #1290's spike rather than assumed either way.
dereck-symmetry commentedon Oct 1, 2026
@bjagg thanks for handing this epic over. I'm taking it on as my top priority, and I plan to start at #1180, extracting the developer-key logic into a portable
developer_keysbrick. Your 08-31 breakdown marks it as the blocker for everything else, and it's pure code. Two things I'd like your view on first:1. Should this epic own the auth seam that #1290 also covers? Both epics plan to rework the same code: the Cognito/tenant surface in
mdr_auth/core.py,mdr_auth/cognito_admin.py,mdr_restapi/tenant_endpoints.pyandmdr_services/workspace_service.py. #1290's option B puts Cognito behind an auth port, and #1190 here asks whether Cognito identity should move out of MDR entirely. On 09-21 you said whichever epic moves first should probably absorb the auth half, and #1290 lists "the relationship to #1041 is resolved" as an acceptance criterion. Since this one is now moving, my proposal is that #1041 owns the auth seam, through #1190, and #1290 keeps the packaging, demo-strip and deployment concerns, with a dependency on this epic for its auth part. One more data point: #1323 added a second login path in the MDR base (bases/lif/mdr_restapi/local_users.py). It's additive and doesn't touchmdr_auth, but the extraction will have to account for it. Does that split work for you? If so, I'll note it on #1290 so its spike starts from it.2. The AWS-bound steps. I don't think that I have AWS credentials currently. Phase A (#1180, and the #1181 spike/ADR) and the code side of #1182 I can do. Standing up the deploy pipeline (#1182), migrating the store on dev and demo (#1183), and distributing the secrets (#1184) would need you or someone with access. I'd hand those off the same way I did on #1320, if that still works for you.
dereck-symmetry commentedon Oct 4, 2026
@bjagg a follow-up on my 10-01 comment above, with a review request and where this epic stands.
Please review #1353. It's the output of the #1181 spike: ADR 0006 (Proposed), which extends ADR 0002. The proposal is that the control plane owns its key store as its own logical Postgres database, with its own login and Flyway set. In dev and demo it may sit on the MDR Aurora cluster. Keys go in one table with an explicit workspace column, and existing keys are copied out of MDR's per-tenant tables rather than moved. The spike also found that two of ADR 0002's premises weren't implemented as written. The shipped keys are opaque (
lifk_+token_urlsafe(32), plain SHA-256), not the signedlifk_<payload>.<hmac>from #1033. And nothing validates them yet: LDE's developer-key strategy is still a stub that returnsNone. The details are cited in the ADR's Context.Sub-issues that might need re-scoping, depending on how #1353 lands. I'm holding the detailed comments until you've had a chance to weigh in:
tenant_*schema, and "keys still validate afterwards" can't be checked while nothing validates them.LastUsedDateand the revocation audit have no data source until Control plane: formalize signed-token verification — secret distribution, rotation, and revocation freshness #1184.developer_keysbrick #1180: unchanged, apart from leaving the workspace column to Control plane: migrate the developer-key store to control-plane-owned storage (dev + demo, non-destructive) #1183.Status of #1180. It's waiting on groybal's draft #1345, which moves
datatypes/mdr_sql_model.py(home ofDeveloperApiKey) into a new brick. I've asked groybal about timing there.The two questions from 10-01 are still open:
Issue #1181: docs(adr): the control plane owns its key store as its o…
Issue #1180: refactor: extract developer-key logic into a portable de…
Issue #1181: docs(adr): accept ADR 0006 and close the gaps from its r…
Issue #548 auth dedup into single brick (#1398)
Issue #1182: feat: stand up the control-plane service skeleton with i…