History

Use synthetic placeholders in admin plane comments and tests

Rhys Sullivan committed 3 months ago

Commit a0a398e1 parent 7e2f76b2 files · +6 −6Browse files

Unified · Split

2 files
  1. apps/cloud/src/admin/admin-users-api.ts +1 −1
  2. apps/cloud/src/auth/org-api-key-mint.node.test.ts +5 −5
apps/cloud/src/admin/admin-users-api.ts+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 // 1. an ORG-SCOPED api key -> `PlatformAuth`. The key IS the authority: WorkOS
88 // validated it and reported which org owns it, and there is no member
99 // behind it to check membership for. This is the machine credential
10−// (owner.com's server calling us).
10+// (a customer's backend calling us).
1111 // 2. an admin SESSION member -> the console. Requires a live `getUserOrgMembership`
1212 // whose role slug is `admin` AND whose status is `active`, matching the
1313 // strictest existing cloud guard (`auth/handlers.ts`'s org-delete check) —
apps/cloud/src/auth/org-api-key-mint.node.test.ts+5−5
@@ -64,10 +64,10 @@ describe("organization API keys", () => { · 63 unmodified lines
6464 }),
6565 });
6666
67− const created = yield* apiKeys.createOrgKey({ organizationId: ORG, name: "owner.com" });
67+ const created = yield* apiKeys.createOrgKey({ organizationId: ORG, name: "acme-backend" });
6868
6969 expect(created.id).toBe("key_org_1");
70− expect(created.name).toBe("owner.com");
70+ expect(created.name).toBe("acme-backend");
7171 expect(created.value, "create returns the one-time plaintext secret").toBe(
7272 "sk_org_plaintext",
7373 );
@@ -84,7 +84,7 @@ describe("organization API keys", () => { · 10 unmodified lines
8484 Effect.succeed({
8585 object: "list",
8686 data: [
87− orgKeyResponse(organizationId, "key_org_1", "owner.com"),
87+ orgKeyResponse(organizationId, "key_org_1", "acme-backend"),
8888 orgKeyResponse(organizationId, "key_org_2", "ci"),
8989 ],
9090 listMetadata: { before: null, after: null },
@@ -93,7 +93,7 @@ describe("organization API keys", () => { · 2 unmodified lines
9393
9494 const keys = yield* apiKeys.listOrgKeys({ organizationId: ORG });
9595
96− expect(keys.map((key) => key.name)).toEqual(["owner.com", "ci"]);
96+ expect(keys.map((key) => key.name)).toEqual(["acme-backend", "ci"]);
9797 expect(JSON.stringify(keys), "the list never carries a plaintext secret").not.toContain(
9898 "sk_org_plaintext",
9999 );
@@ -136,7 +136,7 @@ describe("organization API keys", () => { · 36 unmodified lines
136136 });
137137
138138 const error = yield* Effect.flip(
139− apiKeys.createOrgKey({ organizationId: ORG, name: "owner.com" }),
139+ apiKeys.createOrgKey({ organizationId: ORG, name: "acme-backend" }),
140140 );
141141
142142 expect(error).toBeInstanceOf(ApiKeyManagementError);