diff --git a/.dev.vars.example b/.dev.vars.example index ec3e7b8b4..f14a86f6f 100644 --- a/.dev.vars.example +++ b/.dev.vars.example @@ -28,23 +28,6 @@ BETTER_AUTH_SECRET=replace-with-openssl-rand-base64-32-output # Base URL for Better Auth callbacks and redirects BETTER_AUTH_URL=http://localhost:8787 -# ─── Clerk Authentication (deprecated — remove after migration) ────────────── -# Clerk is retained as a fallback for existing sessions during migration. -# Clerk is DISABLED by default — set DISABLE_CLERK_FALLBACK=false in .dev.vars to re-enable. -# Get keys from https://dashboard.clerk.com → API Keys -# Publishable key (non-secret — production value lives in wrangler.toml [vars]) -CLERK_PUBLISHABLE_KEY=pk_test_... -# JWKS URL (non-secret — production value lives in wrangler.toml [vars]) -CLERK_JWKS_URL=https://your-instance.clerk.accounts.dev/.well-known/jwks.json -# Secret key (secret — production: `wrangler secret put CLERK_SECRET_KEY`) -CLERK_SECRET_KEY=sk_test_... -# Webhook signing secret (secret — production: `wrangler secret put CLERK_WEBHOOK_SECRET`) -CLERK_WEBHOOK_SECRET=whsec_... -# Set to 'false' to re-enable Clerk fallback (migration period only) -DISABLE_CLERK_FALLBACK=true -# Set to 'false' to re-enable Clerk webhook processing (migration period only) -DISABLE_CLERK_WEBHOOKS=true - # ─── Cloudflare Turnstile ──────────────────────────────────────────────────── # Site key (non-secret — production value lives in wrangler.toml [vars]) # Test keys below always pass verification — safe for local dev. diff --git a/.github/workflows/neon-branch-create.yml b/.github/workflows/neon-branch-create.yml index d28320f55..5c0de5dfd 100644 --- a/.github/workflows/neon-branch-create.yml +++ b/.github/workflows/neon-branch-create.yml @@ -182,17 +182,10 @@ jobs: database: ${{ steps.db-config.outputs.db_name }} # ── 4. Set up pnpm + Node.js for Prisma CLI ───────────────────────── - # pnpm must be installed BEFORE setup-node so the pnpm cache works - - name: Install pnpm - uses: pnpm/action-setup@v6.0.0 + - name: Setup pnpm and Node.js + uses: ./.github/actions/setup-pnpm-node with: - version: 10.31.0 - - - name: Set up Node.js - uses: actions/setup-node@v6.3.0 - with: - node-version: '20' - cache: 'pnpm' + node-version: '22' # Install only the dependencies needed for Prisma migrations - name: Install dependencies diff --git a/deno.lock b/deno.lock index e73c63c15..120940ad3 100644 --- a/deno.lock +++ b/deno.lock @@ -43,6 +43,7 @@ "npm:hono@^4.12.12": "4.12.12", "npm:hono@^4.12.8": "4.12.12", "npm:jose@^6.2.1": "6.2.2", + "npm:prisma@*": "7.5.0_typescript@6.0.2_@types+react@19.2.14_react@19.2.5_react-dom@19.2.5__react@19.2.5", "npm:prisma@7.5.0": "7.5.0_typescript@6.0.2_@types+react@19.2.14_react@19.2.5_react-dom@19.2.5__react@19.2.5", "npm:prisma@^7.5.0": "7.5.0_typescript@6.0.2_@types+react@19.2.14_react@19.2.5_react-dom@19.2.5__react@19.2.5", "npm:svix@^1.62.0": "1.90.0", diff --git a/docs/api/cloudflare-schema.yaml b/docs/api/cloudflare-schema.yaml index d184b8626..00bdcf182 100644 --- a/docs/api/cloudflare-schema.yaml +++ b/docs/api/cloudflare-schema.yaml @@ -51,13 +51,13 @@ tags: - name: Authentication description: >- - User-level authentication endpoints — API key management and webhook receivers. Requires Clerk JWT or API - key auth. + User-level authentication endpoints — API key management and webhook receivers. Requires Bearer token + (Better Auth JWT or API key). - name: LocalAuth description: >- - Local JWT auth bridge — self-contained sign-up/login until Clerk is production-ready. When `CLERK_JWKS_URL` - is set the provider auto-switches to Clerk and these endpoints are no longer used. + Local JWT auth bridge — self-contained sign-up/login. When Better Auth is configured these endpoints are no + longer the primary auth flow. - name: Info description: 'API metadata and self-describing schema endpoints (anonymous access, cached).' @@ -1303,11 +1303,11 @@ paths: description: | Creates a new API key for the authenticated user. The raw API key (with `abc_` prefix) is returned **only once** — store it securely. - Requires Clerk JWT authentication. + Requires Bearer token (Better Auth JWT or API key). operationId: userCreateApiKey security: - - ClerkJWT: [] + BearerAuth: [] requestBody: required: true content: @@ -1332,11 +1332,11 @@ paths: description: | Lists all API keys belonging to the authenticated user. Returns metadata only — never the key hash or plaintext. - Requires Clerk JWT authentication. + Requires Bearer token (Better Auth JWT or API key). operationId: userListApiKeys security: - - ClerkJWT: [] + BearerAuth: [] responses: '200': description: List of API keys @@ -1358,7 +1358,7 @@ paths: operationId: userRevokeApiKey security: - - ClerkJWT: [] + BearerAuth: [] parameters: - name: keyId @@ -1390,11 +1390,11 @@ paths: summary: Update API key description: | Updates an API key's name or scopes. Only the key owner can update their own keys. - Requires Clerk JWT authentication. + Requires Bearer token (Better Auth JWT or API key). operationId: userUpdateApiKey security: - - ClerkJWT: [] + BearerAuth: [] parameters: - name: keyId @@ -1423,72 +1423,6 @@ paths: $ref: '#/components/responses/UnauthorizedError' '404': description: API key not found or already revoked - /api/webhooks/clerk: - post: - tags: - - Authentication - summary: Clerk webhook receiver - description: | - Receives Clerk webhook events (user.created, user.updated, user.deleted, session.created). - Verified via Svix webhook signature. This endpoint is called by Clerk's webhook infrastructure - and should not be called directly. - operationId: clerkWebhook - requestBody: - required: true - content: - application/json: - schema: - type: object - description: Clerk webhook event payload (Svix-signed) - properties: - type: - type: string - description: 'Event type (e.g. user.created, user.updated)' - data: - type: object - description: Event-specific payload - object: - type: string - enum: - - event - parameters: - - - name: svix-id - in: header - required: true - schema: - type: string - description: Svix webhook ID - - - name: svix-timestamp - in: header - required: true - schema: - type: string - description: Svix webhook timestamp - - - name: svix-signature - in: header - required: true - schema: - type: string - description: Svix webhook signature - responses: - '200': - description: Webhook processed successfully - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - message: - type: string - '400': - description: Invalid webhook signature or payload - '401': - description: Webhook signature verification failed /admin/migrate/d1-to-pg: post: tags: @@ -2017,8 +1951,7 @@ paths: **Rate limited** (anonymous tier). Returns a signed HS256 JWT on success. - > Only active when `CLERK_JWKS_URL` is not configured. When Clerk is live, - > sign up via the Clerk-hosted UI instead. + > Only active when Better Auth is not the primary provider. operationId: localSignup requestBody: required: true @@ -2411,7 +2344,7 @@ paths: - `TIER_REGISTRY` — all tiers with rate limits and ordering - `ROUTE_PERMISSION_REGISTRY` — all registered route permission rules - Also reports which auth provider is active (`local-jwt` vs `clerk`). + Also reports which auth provider is active (`local-jwt` vs `better-auth`). Requires Admin tier + admin role. operationId: adminAuthConfig security: @@ -2450,7 +2383,7 @@ paths: required: true schema: type: string - description: User ID (UUID or Clerk user ID) + description: User ID (UUID) - name: days in: query @@ -4789,7 +4722,7 @@ components: type: string enum: - local-jwt - - clerk + - better-auth description: Active auth provider roles: type: array @@ -4910,11 +4843,6 @@ components: in: header name: X-Admin-Key description: Admin API key for protected admin endpoints - ClerkJWT: - type: http - scheme: bearer - bearerFormat: JWT - description: Clerk-issued JWT for authenticated user requests. Obtain via Clerk sign-in flow. UserApiKey: type: http scheme: bearer diff --git a/docs/api/openapi.yaml b/docs/api/openapi.yaml index e396e0bbc..132323576 100644 --- a/docs/api/openapi.yaml +++ b/docs/api/openapi.yaml @@ -52,9 +52,9 @@ tags: - name: Browser Rendering description: Endpoints backed by the Cloudflare Browser Rendering binding (`BROWSER`). Used for resolving redirect chains and monitoring filter-list source URLs for changes. - name: Authentication - description: User-level authentication endpoints — API key management and webhook receivers. Requires Clerk JWT or API key auth. + description: User-level authentication endpoints — API key management and webhook receivers. Requires Bearer token (Better Auth JWT or API key). - name: LocalAuth - description: Local JWT auth bridge — self-contained sign-up/login until Clerk is production-ready. When `CLERK_JWKS_URL` is set the provider auto-switches to Clerk and these endpoints are no longer used. + description: Local JWT auth bridge — self-contained sign-up/login. When Better Auth is configured these endpoints are no longer the primary auth flow. - name: Info description: API metadata and self-describing schema endpoints (anonymous access, cached). - name: Configuration @@ -1233,10 +1233,10 @@ paths: description: | Creates a new API key for the authenticated user. The raw API key (with `abc_` prefix) is returned **only once** — store it securely. - Requires Clerk JWT authentication. + Requires Bearer token (Better Auth JWT or API key). operationId: userCreateApiKey security: - - ClerkJWT: [] + - BearerAuth: [] requestBody: required: true content: @@ -1260,10 +1260,10 @@ paths: description: | Lists all API keys belonging to the authenticated user. Returns metadata only — never the key hash or plaintext. - Requires Clerk JWT authentication. + Requires Bearer token (Better Auth JWT or API key). operationId: userListApiKeys security: - - ClerkJWT: [] + - BearerAuth: [] responses: '200': description: List of API keys @@ -1284,7 +1284,7 @@ paths: Only the key owner can revoke their own keys. operationId: userRevokeApiKey security: - - ClerkJWT: [] + - BearerAuth: [] parameters: - name: keyId in: path @@ -1314,10 +1314,10 @@ paths: summary: Update API key description: | Updates an API key's name or scopes. Only the key owner can update their own keys. - Requires Clerk JWT authentication. + Requires Bearer token (Better Auth JWT or API key). operationId: userUpdateApiKey security: - - ClerkJWT: [] + - BearerAuth: [] parameters: - name: keyId in: path @@ -1346,68 +1346,6 @@ paths: '404': description: API key not found or already revoked - /api/webhooks/clerk: - post: - tags: [Authentication] - summary: Clerk webhook receiver - description: | - Receives Clerk webhook events (user.created, user.updated, user.deleted, session.created). - Verified via Svix webhook signature. This endpoint is called by Clerk's webhook infrastructure - and should not be called directly. - operationId: clerkWebhook - requestBody: - required: true - content: - application/json: - schema: - type: object - description: Clerk webhook event payload (Svix-signed) - properties: - type: - type: string - description: Event type (e.g. user.created, user.updated) - data: - type: object - description: Event-specific payload - object: - type: string - enum: [event] - parameters: - - name: svix-id - in: header - required: true - schema: - type: string - description: Svix webhook ID - - name: svix-timestamp - in: header - required: true - schema: - type: string - description: Svix webhook timestamp - - name: svix-signature - in: header - required: true - schema: - type: string - description: Svix webhook signature - responses: - '200': - description: Webhook processed successfully - content: - application/json: - schema: - type: object - properties: - success: - type: boolean - message: - type: string - '400': - description: Invalid webhook signature or payload - '401': - description: Webhook signature verification failed - /admin/migrate/d1-to-pg: post: tags: [Admin] @@ -1904,7 +1842,7 @@ paths: # --------------------------------------------------------------------------- # Local JWT Auth Bridge — POST /auth/signup, /auth/login, GET /auth/me, POST /auth/change-password - # Active when CLERK_JWKS_URL is NOT set. Auto-replaced by Clerk when CLERK_JWKS_URL is set. + # Active when Better Auth is not the primary provider. # --------------------------------------------------------------------------- /auth/signup: @@ -1918,8 +1856,7 @@ paths: **Rate limited** (anonymous tier). Returns a signed HS256 JWT on success. - > Only active when `CLERK_JWKS_URL` is not configured. When Clerk is live, - > sign up via the Clerk-hosted UI instead. + > Only active when Better Auth is not the primary provider. operationId: localSignup requestBody: required: true @@ -2297,7 +2234,7 @@ paths: - `TIER_REGISTRY` — all tiers with rate limits and ordering - `ROUTE_PERMISSION_REGISTRY` — all registered route permission rules - Also reports which auth provider is active (`local-jwt` vs `clerk`). + Also reports which auth provider is active (`local-jwt` vs `better-auth`). Requires Admin tier + admin role. operationId: adminAuthConfig security: @@ -2333,7 +2270,7 @@ paths: required: true schema: type: string - description: User ID (UUID or Clerk user ID) + description: User ID (UUID) - name: days in: query schema: @@ -4668,7 +4605,7 @@ components: example: true provider: type: string - enum: [local-jwt, clerk] + enum: [local-jwt, better-auth] description: Active auth provider roles: type: array @@ -4774,11 +4711,6 @@ components: in: header name: X-Admin-Key description: Admin API key for protected admin endpoints - ClerkJWT: - type: http - scheme: bearer - bearerFormat: JWT - description: Clerk-issued JWT for authenticated user requests. Obtain via Clerk sign-in flow. UserApiKey: type: http scheme: bearer diff --git a/docs/postman/postman-collection.json b/docs/postman/postman-collection.json index 35e992a96..ff736082b 100644 --- a/docs/postman/postman-collection.json +++ b/docs/postman/postman-collection.json @@ -29,10 +29,10 @@ "description": "Admin API key for protected admin endpoints (X-Admin-Key header)" }, { - "key": "clerkToken", + "key": "bearerToken", "value": "", "type": "string", - "description": "Clerk JWT for authenticated user requests (Bearer token)" + "description": "Bearer token for authenticated user requests (Better Auth JWT or API key)" }, { "key": "userApiKey", @@ -2051,7 +2051,7 @@ "config" ] }, - "description": "Returns a read-only snapshot of all three extensibility registries at runtime:\n- `LOCAL_ROLE_REGISTRY` — all defined roles, their tiers, and self-register flag\n- `TIER_REGISTRY` — all tiers with rate limits and ordering\n- `ROUTE_PERMISSION_REGISTRY` — all registered route permission rules\n\nAlso reports which auth provider is active (`local-jwt` vs `clerk`).\nRequires Admin tier + admin role.\n" + "description": "Returns a read-only snapshot of all three extensibility registries at runtime:\n- `LOCAL_ROLE_REGISTRY` — all defined roles, their tiers, and self-register flag\n- `TIER_REGISTRY` — all tiers with rate limits and ordering\n- `ROUTE_PERMISSION_REGISTRY` — all registered route permission rules\n\nAlso reports which auth provider is active (`local-jwt` vs `better-auth`).\nRequires Admin tier + admin role.\n" } }, { @@ -2683,7 +2683,7 @@ }, { "name": "Authentication", - "description": "User-level authentication endpoints — API key management and webhook receivers. Requires Clerk JWT or API key auth.", + "description": "User-level authentication endpoints — API key management and webhook receivers. Requires Bearer token (Better Auth JWT or API key).", "item": [ { "name": "List user's API keys", @@ -2718,7 +2718,7 @@ "keys" ] }, - "description": "Lists all API keys belonging to the authenticated user.\nReturns metadata only — never the key hash or plaintext.\nRequires Clerk JWT authentication.\n" + "description": "Lists all API keys belonging to the authenticated user.\nReturns metadata only — never the key hash or plaintext.\nRequires Bearer token (Better Auth JWT or API key).\n" } }, { @@ -2769,7 +2769,7 @@ } } }, - "description": "Creates a new API key for the authenticated user.\nThe raw API key (with `abc_` prefix) is returned **only once** — store it securely.\nRequires Clerk JWT authentication.\n" + "description": "Creates a new API key for the authenticated user.\nThe raw API key (with `abc_` prefix) is returned **only once** — store it securely.\nRequires Bearer token (Better Auth JWT or API key).\n" } }, { @@ -2828,7 +2828,7 @@ } } }, - "description": "Updates an API key's name or scopes. Only the key owner can update their own keys.\nRequires Clerk JWT authentication.\n" + "description": "Updates an API key's name or scopes. Only the key owner can update their own keys.\nRequires Bearer token (Better Auth JWT or API key).\n" } }, { @@ -2874,64 +2874,12 @@ }, "description": "Revokes (soft-deletes) an API key. The key remains in the database for audit\npurposes but is no longer valid for authentication.\nOnly the key owner can revoke their own keys.\n" } - }, - { - "name": "Clerk webhook receiver", - "description": "Receives Clerk webhook events (user.created, user.updated, user.deleted, session.created).", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "pm.test('Status code is 200', function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test('Response is JSON', function () {", - " pm.response.to.be.json;", - "});" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "url": { - "raw": "{{baseUrl}}/api/webhooks/clerk", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "api", - "webhooks", - "clerk" - ] - }, - "body": { - "mode": "raw", - "raw": "{\n \"type\": \"string\",\n \"data\": {},\n \"object\": \"event\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "description": "Receives Clerk webhook events (user.created, user.updated, user.deleted, session.created).\nVerified via Svix webhook signature. This endpoint is called by Clerk's webhook infrastructure\nand should not be called directly.\n" - } } ] }, { "name": "LocalAuth", - "description": "Local JWT auth bridge — self-contained sign-up/login until Clerk is production-ready. When `CLERK_JWKS_URL` is set the provider auto-switches to Clerk and these endpoints are no longer used.", + "description": "Local JWT auth bridge — self-contained sign-up/login. When Better Auth is configured these endpoints are no longer the primary auth flow.", "item": [ { "name": "Register a new local account", @@ -2981,7 +2929,7 @@ } } }, - "description": "Create a new account using an email address or E.164 phone number and password.\nAll self-registered users receive the `user` role (Free tier).\nAdmin role must be granted via `POST /admin/local-users`.\n\n**Rate limited** (anonymous tier). Returns a signed HS256 JWT on success.\n\n> Only active when `CLERK_JWKS_URL` is not configured. When Clerk is live,\n> sign up via the Clerk-hosted UI instead.\n" + "description": "Create a new account using an email address or E.164 phone number and password.\nAll self-registered users receive the `user` role (Free tier).\nAdmin role must be granted via `POST /admin/local-users`.\n\n**Rate limited** (anonymous tier). Returns a signed HS256 JWT on success.\n\n> Only active when Better Auth is not the primary provider.\n" } }, { diff --git a/docs/postman/postman-environment.json b/docs/postman/postman-environment.json index 9b61dc262..84f889953 100644 --- a/docs/postman/postman-environment.json +++ b/docs/postman/postman-environment.json @@ -14,7 +14,7 @@ "enabled": true }, { - "key": "clerkToken", + "key": "bearerToken", "value": "", "type": "secret", "enabled": true diff --git a/frontend/src/app/admin/api-keys/api-keys.component.spec.ts b/frontend/src/app/admin/api-keys/api-keys.component.spec.ts index 3cca6a095..15712443f 100644 --- a/frontend/src/app/admin/api-keys/api-keys.component.spec.ts +++ b/frontend/src/app/admin/api-keys/api-keys.component.spec.ts @@ -9,7 +9,6 @@ import { ApiKeysComponent } from './api-keys.component'; function makeKey(overrides: Partial<{ id: string; keyPrefix: string; - clerkUserId: string; name: string; revokedAt: string | null; expiresAt: string | null; @@ -17,7 +16,6 @@ function makeKey(overrides: Partial<{ return { id: overrides.id ?? 'key-1', keyPrefix: overrides.keyPrefix ?? 'sk_test', - clerkUserId: overrides.clerkUserId ?? 'user_1', name: overrides.name ?? 'Test Key', scopes: [], rateLimitPerMinute: 60, @@ -105,9 +103,9 @@ describe('ApiKeysComponent', () => { // ── applyFilters() ──────────────────────────────────────────────────────── describe('applyFilters()', () => { const keys = [ - makeKey({ id: 'k1', keyPrefix: 'sk_abc', clerkUserId: 'user_a', name: 'Alpha', expiresAt: FUTURE }), - makeKey({ id: 'k2', keyPrefix: 'sk_xyz', clerkUserId: 'user_b', name: 'Beta', revokedAt: NOW }), - makeKey({ id: 'k3', keyPrefix: 'sk_exp', clerkUserId: 'user_c', name: 'Expired', expiresAt: PAST }), + makeKey({ id: 'k1', keyPrefix: 'sk_abc', name: 'Alpha', expiresAt: FUTURE }), + makeKey({ id: 'k2', keyPrefix: 'sk_xyz', name: 'Beta', revokedAt: NOW }), + makeKey({ id: 'k3', keyPrefix: 'sk_exp', name: 'Expired', expiresAt: PAST }), ]; beforeEach(() => { @@ -135,12 +133,6 @@ describe('ApiKeysComponent', () => { expect(component.filteredKeys().length).toBe(1); }); - it('filters by clerkUserId substring', () => { - component.searchQuery = 'user_c'; - component.applyFilters(); - expect(component.filteredKeys().length).toBe(1); - }); - it('statusFilter "active" returns only active keys', () => { component.statusFilter = 'active'; component.applyFilters(); diff --git a/frontend/src/app/admin/api-keys/api-keys.component.ts b/frontend/src/app/admin/api-keys/api-keys.component.ts index 0b2d63d8c..4667f45fb 100644 --- a/frontend/src/app/admin/api-keys/api-keys.component.ts +++ b/frontend/src/app/admin/api-keys/api-keys.component.ts @@ -29,7 +29,6 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; interface AdminApiKey { readonly id: string; readonly keyPrefix: string; - readonly clerkUserId: string; readonly name: string; readonly scopes: string[]; readonly rateLimitPerMinute: number; @@ -106,8 +105,8 @@ type KeyStatus = 'all' | 'active' | 'revoked' | 'expired';
- Search by prefix or owner - + Search by prefix or name + @@ -142,13 +141,6 @@ type KeyStatus = 'all' | 'active' | 'revoked' | 'expired'; - - Owner - - {{ row.clerkUserId }} - - - Name {{ row.name }} @@ -217,10 +209,6 @@ type KeyStatus = 'all' | 'active' | 'revoked' | 'expired'; Name {{ detailKey()!.name }}
-
- Owner - {{ detailKey()!.clerkUserId }} -
Prefix {{ detailKey()!.keyPrefix }} @@ -354,7 +342,7 @@ export class ApiKeysComponent { readonly detailKey = signal(null); readonly revokingKey = signal(null); - readonly displayedColumns = ['keyPrefix', 'clerkUserId', 'name', 'scopes', 'status', 'createdAt', 'actions']; + readonly displayedColumns = ['keyPrefix', 'name', 'scopes', 'status', 'createdAt', 'actions']; searchQuery = ''; statusFilter: KeyStatus = 'all'; @@ -394,7 +382,6 @@ export class ApiKeysComponent { const q = this.searchQuery.toLowerCase(); keys = keys.filter(k => k.keyPrefix.toLowerCase().includes(q) || - k.clerkUserId.toLowerCase().includes(q) || k.name.toLowerCase().includes(q), ); } diff --git a/frontend/src/app/admin/roles/roles.component.spec.ts b/frontend/src/app/admin/roles/roles.component.spec.ts index 88f11cd28..8d35cd20e 100644 --- a/frontend/src/app/admin/roles/roles.component.spec.ts +++ b/frontend/src/app/admin/roles/roles.component.spec.ts @@ -35,7 +35,7 @@ function makeAssignment(overrides: Partial<{ }> = {}) { return { id: 10, - user_id: 'clerk-abc', + user_id: 'user-abc', role_name: 'editor', assigned_by: 'admin@example.com', assigned_at: '2024-01-02T00:00:00Z', @@ -375,7 +375,7 @@ describe('RolesComponent', () => { it('POSTs assignment and reloads assignments on success', () => { const role = makeRole({ role_name: 'editor' }); component.selectedRole.set(role); - component.assignUserId = 'clerk-xyz'; + component.assignUserId = 'user-xyz'; component.confirmAssign(); expect(component.saving()).toBe(true); @@ -384,7 +384,7 @@ describe('RolesComponent', () => { r.url.includes('/admin/roles/assignments') && r.method === 'POST', ); expect(req.request.body).toEqual({ - user_id: 'clerk-xyz', + user_id: 'user-xyz', role_name: 'editor', }); req.flush({ success: true }); @@ -403,7 +403,7 @@ describe('RolesComponent', () => { component.selectedRole.set(role); component.openAssignDialog(); // Set assignUserId AFTER openAssignDialog() so it isn't cleared - component.assignUserId = 'clerk-xyz'; + component.assignUserId = 'user-xyz'; component.confirmAssign(); httpTesting @@ -423,13 +423,13 @@ describe('RolesComponent', () => { it('DELETEs the assignment and reloads assignments on success', () => { const role = makeRole({ role_name: 'editor' }); component.selectedRole.set(role); - const assignment = makeAssignment({ user_id: 'clerk-del' }); + const assignment = makeAssignment({ user_id: 'user-del' }); component.revokeAssignment(assignment); expect(component.saving()).toBe(true); const req = httpTesting.expectOne(r => - r.url.includes('/admin/roles/assignments/clerk-del') && r.method === 'DELETE', + r.url.includes('/admin/roles/assignments/user-del') && r.method === 'DELETE', ); req.flush({ success: true }); @@ -443,11 +443,11 @@ describe('RolesComponent', () => { it('resets saving flag on error', () => { const role = makeRole({ role_name: 'editor' }); component.selectedRole.set(role); - const assignment = makeAssignment({ user_id: 'clerk-del' }); + const assignment = makeAssignment({ user_id: 'user-del' }); component.revokeAssignment(assignment); httpTesting - .expectOne(r => r.url.includes('/admin/roles/assignments/clerk-del') && r.method === 'DELETE') + .expectOne(r => r.url.includes('/admin/roles/assignments/user-del') && r.method === 'DELETE') .flush('Not Found', { status: 404, statusText: 'Not Found' }); expect(component.saving()).toBe(false); diff --git a/frontend/src/app/admin/roles/roles.component.ts b/frontend/src/app/admin/roles/roles.component.ts index 2f2d70b60..38db5141b 100644 --- a/frontend/src/app/admin/roles/roles.component.ts +++ b/frontend/src/app/admin/roles/roles.component.ts @@ -289,7 +289,7 @@ interface RoleFormData { - Clerk User ID + User ID diff --git a/frontend/src/app/admin/webhooks/webhooks.component.ts b/frontend/src/app/admin/webhooks/webhooks.component.ts index e2eb1d99f..fa930ad6f 100644 --- a/frontend/src/app/admin/webhooks/webhooks.component.ts +++ b/frontend/src/app/admin/webhooks/webhooks.component.ts @@ -1,7 +1,7 @@ /** - * WebhooksComponent — Clerk webhook event viewer. + * WebhooksComponent — Webhook event viewer. * - * Displays recent Clerk webhook events in a read-only Material table + * Displays recent webhook events in a read-only Material table * with a secondary "DLQ" tab for failed events. Gracefully handles * 404 responses (API not yet implemented) with a "Coming soon" message. */ @@ -54,7 +54,7 @@ interface WebhookEventsResponse { Webhooks - Clerk webhook event viewer + Webhook event viewer