feat: add aasp route support#39
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adds Apple App Site Association (AASA) support by introducing a way to register Apple app identifiers (<TEAMID>.<BUNDLEID>) per OAuth client, publishing them via a new /.well-known/apple-app-site-association route for passkey domain binding.
Changes:
- Add a new
oauth_client_app_idstable + migration to persist Apple app IDs tied to OAuth clients. - Add an AASA payload builder (with unit tests) and a new Next.js route to serve
webcredentials.apps. - Extend the admin client detail UI and server actions to add/remove app IDs, plus E2E endpoints/tests for seeding and validating AASA output.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/validations/admin.ts | Adds Zod validation for registering Apple app IDs on a client. |
| lib/db/schema/oauth-client-app-ids.ts | Introduces Drizzle schema for persisted OAuth client app IDs. |
| lib/db/schema/index.ts | Re-exports the new schema module. |
| lib/db/migrations/meta/0006_snapshot.json | Updates Drizzle migration snapshot to include the new table. |
| lib/db/migrations/meta/_journal.json | Adds migration journal entry for version 6. |
| lib/db/migrations/0006_familiar_mandarin.sql | Creates oauth_client_app_ids table and indexes. |
| lib/aasa/build-aasa.ts | Adds helper to build a stable AASA document from app IDs. |
| lib/aasa/build-aasa.test.ts | Unit tests for deduplication/sorting and AASA document shape. |
| e2e/aasa.spec.ts | Playwright E2E coverage for AASA route output and union semantics. |
| components/admin/client-detail-tabs.tsx | Wires app IDs into the admin client detail view. |
| components/admin/client-app-ids-card.tsx | Adds UI card for adding/removing Apple app IDs per client. |
| app/api/e2e/oauth-client-app-ids/route.ts | Adds E2E-only API for seeding/clearing app IDs without UI. |
| app/admin/dashboard/clients/[id]/page.tsx | Fetches app IDs for the client detail page. |
| app/.well-known/apple-app-site-association/route.ts | Serves the AASA JSON payload derived from stored app IDs. |
| actions/admin/clients/app-ids.ts | Adds server actions for listing/adding/removing app IDs + cache revalidation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+47
to
+55
| setAppIds([ | ||
| { | ||
| id: result.id, | ||
| clientId, | ||
| appId: trimmed, | ||
| createdAt: new Date(), | ||
| }, | ||
| ...appIds, | ||
| ]); |
Comment on lines
+70
to
+72
| if (result.success) { | ||
| setAppIds(appIds.filter((a) => a.id !== id)); | ||
| } else { |
| try { | ||
| await requireAdmin(); | ||
|
|
||
| await db.delete(oauthClientAppIds).where(eq(oauthClientAppIds.id, id)); |
| // Apple app identifier: <TEAMID>.<BUNDLEID> | ||
| // - TEAMID: 10-char uppercase alphanumeric Apple Developer Team ID | ||
| // - BUNDLEID: reverse-DNS bundle id (letters, digits, dots, dashes) | ||
| const appleAppIdRegex = /^[A-Z0-9]{10}\.[A-Za-z0-9][A-Za-z0-9.\-]*$/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.