Skip to content

Commit b5caa24

Browse files
committed
docs(webapp): correct the environment-scope comments on the environments route
1 parent 6fd9df4 commit b5caa24

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

apps/webapp/app/routes/api.v1.projects.$projectRef.environments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const loader = createLoaderPATApiRoute(
4141
return json({ error: "Project not found" }, { status: 404 });
4242
}
4343

44-
// A delegated token signed for one environment only ever lists that one.
44+
// An org claim makes the org the boundary; an environment claim alone lists that one only.
4545
const scope = await resolveUserActorEnvironmentScope(
4646
authentication.userActor,
4747
{ projectId: project.id },

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export async function resolveUserActorEnvironmentScope(
145145
if (!project) {
146146
throw forbiddenEnvironment("This token isn't scoped to that organization.");
147147
}
148+
// Nothing narrows, so `requestedEnvironmentSlugs` is the caller's own filter and isn't
149+
// refused here. A route that opted in must not rely on this for environment filtering.
148150
return { scoped: false };
149151
}
150152

0 commit comments

Comments
 (0)