(userId: string, organizationId: string)
| 54 | // connection named after the subject. Tenant isolation means each identity's |
| 55 | // catalog is independent; subject isolation means the user connection is private. |
| 56 | const 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 | |
| 86 | const listConnectionAddresses = async ( |
| 87 | userId: string, |
no test coverage detected