Heimdall/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 053cb0a17e Register apps at runtime instead of at build time
App slugs were a compile-time union of four names. That was fine while every app
was ours and it blocks what Heimdall is for: an app it has never heard of,
running on someone else's machine, registering against a self-hosted instance
without forking and rebuilding the auth authority. A creator self-hosting
Erycina alongside Heimdall would otherwise maintain a patched auth server
forever.

AppSlug is now a string, which it always was on the wire; the union was a
narrowing the type system could enforce only because the set was closed.
Membership moved from appSlugs.includes to the registry, and where no store is
reachable — the offline token verifier is the case that matters — it is a shape
check, isAppSlug, rather than a false claim to know what exists. A host app
verifying its own tokens should compare aud against its own slug, which it knows
and Heimdall's built-in list does not.

Registration is data end to end. Storage carries the profile and a hash of the
client secret rather than the secret. Built-in profiles resolve first and their
slugs are refused at registration, in both places, so a registration cannot
shadow a shipped app and inherit its audience.

POST /v1/apps answers in the RFC 7591 shape so an ordinary OAuth client library
can read it, returning client_secret exactly once. It is gated on an operator
secret and closed entirely until one is configured: an open registration
endpoint on an OAuth provider lets anyone create a client that starts Discord
and Patreon flows under the instance's identity, which is a phishing surface
wearing the operator's name. A fresh instance is not accidentally open.

Redirect URIs are validated rather than stored as given. They are where an
authorization code is delivered, so a permissive one is a token-theft primitive:
absolute, no fragment, https unless loopback.

Six call sites assumed an app profile always exists. They now answer 404 for an
app nobody registered, and claim issuance refuses outright rather than signing a
token whose audience no verifier can resolve.

108 tests pass, 34 of them new. Zero type errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-07 00:11:41 +02:00
..
access-plugin.test.ts Bind auth completions to their attempt handles 2026-08-22 12:01:56 +02:00
app-registration-endpoint.test.ts Register apps at runtime instead of at build time 2026-09-07 00:11:41 +02:00
app-registry.test.ts Register apps at runtime instead of at build time 2026-09-07 00:11:41 +02:00
app.test.ts Retire the Spotiverse profile; keep the spotify provider intact for restore 2026-09-06 01:47:10 +02:00
browser-adapter.test.ts Resume Heimdall auth from browser return witness 2026-08-22 11:42:28 +02:00
capability-rules.test.ts Make app capability rules data instead of code 2026-09-06 23:58:58 +02:00
idunn-candidate-bind.test.ts Move the private command port with the candidate 2026-09-06 22:15:34 +02:00
idunn-rudp-health.test.ts Label signed health with its schema 2026-08-22 02:50:40 +02:00
odin-publication.test.ts Give Heimdall Odin documents unique catalog keys 2026-08-22 03:47:02 +02:00
presence-identity-descriptor.test.ts Read Idunn stores in the layout Idunn actually writes 2026-09-06 16:07:47 +02:00
process-write-lease.test.ts Retract the CultLib divergence claim; read each .cc with the right client 2026-09-06 19:11:19 +02:00
security.test.ts Authenticate Heimdall health publications 2026-08-20 19:56:35 +02:00
store.test.ts Add Eve access plugin and private auth plane 2026-08-22 00:44:57 +02:00
verse-runtime.test.ts Retire the Spotiverse profile; keep the spotify provider intact for restore 2026-09-06 01:47:10 +02:00
verse-witness.test.ts Retire the Spotiverse profile; keep the spotify provider intact for restore 2026-09-06 01:47:10 +02:00