Skip to content

JWT-mode anonymous/public API access — AppContextStrategy (KYTE-#229)#102

Draft
kennethphough wants to merge 1 commit into
masterfrom
feature/jwt-anonymous-app-context
Draft

JWT-mode anonymous/public API access — AppContextStrategy (KYTE-#229)#102
kennethphough wants to merge 1 commit into
masterfrom
feature/jwt-anonymous-app-context

Conversation

@kennethphough
Copy link
Copy Markdown
Member

Server-side half of #229: lets JWT-mode sites serve requireAuth=false controllers to anonymous visitors via x-kyte-appid only. New AppContextStrategy (strict matches, account-only/no-user/no-hasSession), per-app allow_public opt-in + migration, read-only enforcement, shadow-harness skip, tests. kyte-api-js anonymous fall-through ships alongside. Draft until dev QA.

🤖 Generated with Claude Code

Server-side half of the two-repo change letting JWT-mode sites serve
requireAuth=false controllers to anonymous visitors (public browsing before
login) via x-kyte-appid only.

- AppContextStrategy: strict header-only matches() (appid present, no
  Bearer/signature/identity → mutually exclusive with HMAC/JWT); preAuth
  resolves the app's account but NEVER a user and NEVER hasSession (the
  invariant that keeps requireAuth=true controllers at 403). Slotted in
  AuthDispatcher after Jwt, before Hmac.
- Defense in depth: per-app opt-in Application.allow_public (default 0,
  migration 4.11.0_application_allow_public.sql) enforced in preAuth;
  ModelController restricts an app_context request to GET (read-only);
  AuthShadowHarness skips app_context (no legacy equivalent).
- tests/AppContextStrategyTest.php (added to phpunit.xml.dist).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant