Skip to content

Commit 18e0701

Browse files
matt-aitkenclaude
andcommitted
refactor(webapp): drop ApiAuthenticationResultSuccess.scopes + delete dead authorization.server.ts
Two related cleanups falling out of the RBAC migration. The `scopes?: string[]` field on `ApiAuthenticationResultSuccess` was populated from JWT claims by the legacy auth path and consumed only by `services/authorization.server.ts`'s `checkAuthorization`. The new apiBuilder bridge (which constructs the same result type) doesn't populate scopes, and every call site has migrated to the rbac ability model. Verified by grep: no handler reads `authentication.scopes` / `authenticationResult.scopes` anywhere outside the dead `authorization.server` module. A perpetually-undefined optional field is a footgun — future code might branch on it and silently misbehave. Drop it from the type and remove the two dead-write populations in `authenticateApiKey` and `authenticateApiKeyWithFailure`. `services/authorization.server.ts` (the file that defined `AuthorizationEntity`, `AuthorizationResources`, and the `checkAuthorization` function) is wholly dead — nothing in `apps/webapp/app` imports it any more. Delete it. The route comments that reference "the legacy `checkAuthorization`" are kept for historical context. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8953f21 commit 18e0701

2 files changed

Lines changed: 0 additions & 116 deletions

File tree

apps/webapp/app/services/apiAuth.server.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export type ApiAuthenticationResultSuccess = {
5252
apiKey: string;
5353
type: "PUBLIC" | "PRIVATE" | "PUBLIC_JWT";
5454
environment: AuthenticatedEnvironment;
55-
scopes?: string[];
5655
oneTimeUse?: boolean;
5756
realtime?: {
5857
skipColumns?: string[];
@@ -163,7 +162,6 @@ export async function authenticateApiKey(
163162
ok: true,
164163
...result,
165164
environment: validationResults.environment,
166-
scopes: parsedClaims.success ? parsedClaims.data.scopes : [],
167165
oneTimeUse: parsedClaims.success ? parsedClaims.data.otu : false,
168166
realtime: parsedClaims.success ? parsedClaims.data.realtime : undefined,
169167
};
@@ -246,7 +244,6 @@ async function authenticateApiKeyWithFailure(
246244
ok: true,
247245
...result,
248246
environment: validationResults.environment,
249-
scopes: parsedClaims.success ? parsedClaims.data.scopes : [],
250247
oneTimeUse: parsedClaims.success ? parsedClaims.data.otu : false,
251248
realtime: parsedClaims.success ? parsedClaims.data.realtime : undefined,
252249
};

apps/webapp/app/services/authorization.server.ts

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)