MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / seedIdentity

Function seedIdentity

apps/host-selfhost/src/scope-isolation.test.ts:56–84  ·  view source on GitHub ↗
(userId: string, organizationId: string)

Source from the content-addressed store, hash-verified

54// connection named after the subject. Tenant isolation means each identity's
55// catalog is independent; subject isolation means the user connection is private.
56const seedIdentity = async (userId: string, organizationId: string): Promise<void> => {
57 const headers = headersFor(userId, organizationId);
58 const add = await handler(
59 new Request("http://localhost/api/openapi/specs", {
60 method: "POST",
61 headers,
62 body: JSON.stringify({
63 spec: { kind: "blob", value: TINY_SPEC },
64 slug: "iso",
65 baseUrl: "",
66 }),
67 }),
68 );
69 expect(add.status).toBe(200);
70 const conn = await handler(
71 new Request("http://localhost/api/connections", {
72 method: "POST",
73 headers,
74 body: JSON.stringify({
75 owner: "user",
76 name: `conn-${userId}`,
77 integration: "iso",
78 template: "bearer",
79 value: `token-${userId}`,
80 }),
81 }),
82 );
83 expect(conn.status).toBe(200);
84};
85
86const listConnectionAddresses = async (
87 userId: string,

Callers 1

Calls 2

headersForFunction · 0.85
handlerFunction · 0.50

Tested by

no test coverage detected