Add Eve access plugin and private auth plane

This commit is contained in:
Meta Vens 2026-08-22 00:44:57 +02:00
commit 19e5109cf4
47 changed files with 1781 additions and 35 deletions

View file

@ -1,17 +1,20 @@
# Ghostlight Dungeon Access Profile
Ghostlight Dungeon reuses Heimdall's browser-completion Discord sign-in path.
Heimdall owns provider OAuth, local account identity, signed access claims, and
refresh. Ghostlight verifies claims locally and owns campaigns, campaign
membership, current campaign selection, and every world mutation.
Ghostlight Dungeon uses Heimdall's private CultNet authentication commands and
the `gamecult.heimdall.access` Eve plugin. Heimdall owns provider OAuth,
persistent attempts, local account identity, entitlement evaluation, signed
access claims, completion redemption, and refresh. Ghostlight verifies claims
locally and owns app sessions, campaigns, campaign membership, current campaign
selection, and every world mutation.
## App identity
- `app_slug`: `ghostlight`
- public URL: `https://yggdrasil.gamecult.org/ghostlight/`
- identity provider: Discord
- public-demo rule: any Heimdall-authenticated Discord identity receives
`app_access`; no GameCult guild role is required
- access rule: Ghostlight supplies its configured KLTST Discord-role policy on
the app-authenticated private boundary; Heimdall evaluates the policy and
grants `app_access` only when it succeeds
## Capabilities
@ -19,7 +22,7 @@ membership, current campaign selection, and every world mutation.
- `campaign_play`: hybrid capability; Ghostlight must also prove that the
authenticated account owns the selected campaign
The browser never carries provider tokens. It receives a one-time completion
code, Ghostlight redeems it server-to-server, verifies the resulting
`aud=ghostlight` claim against Heimdall JWKS, and establishes app-local campaign
authority.
The browser never carries provider tokens or a completion code. The access
plugin stores only an opaque attempt handle. Ghostlight redeems that handle over
the encrypted loopback command plane, verifies the resulting `aud=ghostlight`
claim against Heimdall JWKS, and establishes app-local campaign authority.

View file

@ -71,6 +71,29 @@ bind its own policy and runtime seams onto it.
signed app-facing claim set derived from the account, grants, and app policy
- `AuditEvent`
durable record for login, link, unlink, refresh, denial, and admin overrides
- `AuthAttempt`
Heimdall-owned, expiring OAuth lifecycle record addressed by an opaque handle;
browsers may carry the handle but cannot complete or redeem it themselves
## Eve access plugin and private command plane
`gamecult.heimdall.access` is Heimdall's reusable Eve representation boundary.
It projects access gates, identity summaries, and access status, and declares
the `auth.begin`, `auth.complete`, and `auth.logout` capabilities. Its
executable `describe`, `validate`, and `project` ABI cannot grant access or
mutate provider state.
App backends call `heimdall.auth.begin` and `heimdall.auth.complete` over the
loopback CultNet operation service at `127.0.0.1:4101`. Every private request is
bound to the configured app secret, source runtime, operation, expiry, nonce,
and idempotency key. The MessagePack payload is AES-256-GCM encrypted; the full
envelope is HMAC authenticated. Completion claims are returned only inside the
same encrypted app-bound envelope.
The browser adapter stores one opaque attempt handle and follows only HTTPS
navigation receipts whose origin appears in both the plugin advertisement and
the validated receipt. It never receives access or refresh claims. The host app
redeems the handle, verifies the Heimdall claim, and owns its local session.
## Provider taxonomy

32
docs/eve-access-plugin.md Normal file
View file

@ -0,0 +1,32 @@
# Heimdall Eve Access Boundary
## Objective
Let Eve applications request authentication without learning provider OAuth,
claim, entitlement, or completion mechanics. The browser can render the access
gate and carry one opaque attempt handle; it cannot grant access.
## Authority map
- **Owner:** Heimdall owns OAuth attempts, provider callbacks, entitlement
evaluation, completion redemption, and claim issuance.
- **Inputs:** a signed private CultNet operation from an allowlisted app binding,
provider callback evidence, and Heimdall-owned auth/control-plane state.
- **Outputs:** a navigation receipt for `heimdall.auth.begin`, or an encrypted
single-use completion for `heimdall.auth.complete`.
- **Derived state:** Eve access-gate components, plugin projections, Odin route
metadata, and browser status are projections. They never grant access.
- **Forbidden writers:** browsers, Eve lowerers, Odin, Hermodr, and host apps may
not create or complete Heimdall attempts, evaluate entitlements, or mint
claims. Host apps may create only their own local sessions after verification.
- **Shared paths:** HTTP OAuth starts and private CultNet starts use the same
state-token builder; all provider callbacks use the same callback handler and
completion store; all redemption consumes the same single-use completion.
- **Cut line:** the private command plane is loopback-only and authenticated by
the existing app secret. Public CultMesh receives plugin and route metadata,
never claims, tokens, nonces, secrets, or attempt contents.
The access plugin owns representation and browser navigation semantics. It does
not accept provider commands or mutate authentication state. Its `describe`,
`validate`, and `project` ABI is pure; app commands still cross the provider's
advertised command boundary.

View file

@ -60,6 +60,8 @@ What exists right now is:
- a daemon-owned boundary witness store plus optional Idunn RUDP health pulse
so Heimdall can advertise provider/boundary truth to Odin and Idunn without
pretending HTTP/status checks own the daemon
- the `gamecult.heimdall.access` Eve plugin, persistent auth attempts, and a
loopback-only authenticated CultNet command boundary for Ghostlight
## Primary objective
@ -73,6 +75,25 @@ Build Heimdall as a shared auth authority service that can:
## Current priorities
### 0. Complete the Ghostlight Eve access cut
Landed in Heimdall:
- public plugin manifest, advertisement, state schemas, fixtures, pure ABI, and
browser reference adapter
- persistent attempt lifecycle in memory and Postgres
- encrypted/HMAC-bound `heimdall.auth.begin` and `heimdall.auth.complete`
- exact source-runtime admission, nonce/expiry checks, idempotent retries, and
single-use completion redemption
- Odin-safe plugin and private-route metadata without secret-bearing state
Remaining outside this repo:
- Ghostlight must consume the plugin, verify returned claims, and own its local
sessions
- Idunn must deploy the new release and Odin must witness the plugin and route
metadata
### 1. Lock the service boundary
Goals:

View file

@ -598,13 +598,39 @@ The following are not landed yet:
- revocation flows
- admin/grant management surfaces
- GitHub callback runtime
- runtime CultCache `.cc` witness writing or CultMesh publication
- redacted per-account auth witness export and Odin/CultMesh consumption beyond
the landed boundary/plugin advertisement store
## Private CultNet authentication commands
The live daemon also binds a loopback-only CultNet/RUDP operation service at
`127.0.0.1:4101` by default. Odin may advertise the route, but never proxies or
persists its payloads.
- service: `heimdall.private.commands`
- operations: `heimdall.auth.begin`, `heimdall.auth.complete`
- request envelope: `heimdall.private_command_envelope.v1`
- begin result: `heimdall.auth_begin_receipt.v1`
- completion result: `heimdall.auth_completion_receipt.v1`
Requests are accepted only from a configured app runtime and use the existing
per-app shared secret. Expiry, nonce, operation, app, and idempotency identity
are authenticated. MessagePack payloads and sensitive completion results are
AES-256-GCM wrapped with a fresh nonce. A repeated idempotency key returns the
same result only for the exact same authenticated request; content changes are
denied. Completion consumption remains single-use in Heimdall's canonical
store.
`gamecult.heimdall.access` exposes pure plugin ABI operations on the same
loopback listener. Those operations describe, validate, or project access UI;
they cannot create attempts, mint claims, or establish an app session.
## Odin/Eve provider advertisement
Purpose:
- advertise Heimdall as a read-only Eve provider surface for Odin discovery
- advertise Heimdall's redacted provider, plugin, and command-boundary surfaces
for Odin discovery
- name the redacted CultCache witness document schemas and future `.cc` paths
- avoid touching provider secrets, token custody, store migrations, or runtime
mutation paths

View file

@ -11,14 +11,14 @@ evidence only.
## Owner Map
- Owner: Heimdall owns provider identity/linking, signed session and claim
- Owner: Heimdall owns provider identity/linking, OAuth attempts, signed session and claim
issuance, entitlement refresh, managed provider token custody, grants,
auth-completion handoffs, refresh sessions, and audit events.
- Inputs: provider OAuth callbacks, app profile requests, caller-supplied
entitlement policy, provider API responses, configured signing/encryption
keys, app backend callback receipts, and local Postgres/in-memory store
records.
- Outputs: signed access claims, refresh claims, JWKS, discovery documents,
- Outputs: signed access claims, refresh claims, typed private-command receipts, JWKS, discovery documents,
backend handoff payloads, managed credential projections, audit records, and
app-local verification material.
- Derived state: health/discovery/JWKS responses, browser completion pages,
@ -120,6 +120,9 @@ Authority map:
a runtime-owned `GC_ACCESS_CULTCACHE_PATH` store containing
`gamecult.eve.provider_advertisement.v1`, `heimdall.command_boundary.v1`,
`heimdall.transport_profile.v1`, and `idunn.daemon_health.v1` summary state.
It also publishes the redacted `gamecult.heimdall.access` plugin
advertisement and loopback command-route metadata. No claim, token, secret,
nonce, or opaque attempt handle enters that store.
- Derived state: `/healthz`, JWKS, discovery, systemd, nginx routing, and the
boundary store are projections. They must not mutate auth truth or replace
explicit Heimdall API ownership.
@ -146,6 +149,8 @@ redacted auth witness cut should add these `.cc` targets:
`cultcache/heimdall/entitlements/{accountId}/{provider}/{scope}.cc`
- `heimdall.auth_completion.v0` at
`cultcache/heimdall/auth-completions/{completionCodeHash}.cc`
- `heimdall.auth_attempt.v1` at
`cultcache/heimdall/auth-attempts/{attemptHandleHash}.cc`
- `heimdall.audit_event.v0` at `cultcache/heimdall/audit/{eventId}.cc`
- `heimdall.app_profile.v0` at
`cultcache/heimdall/app-profiles/{appSlug}.cc`