(client: Client)
| 35 | |
| 36 | /** Registers a fresh apiKey-authenticated integration for connections to bind to. */ |
| 37 | const registerIntegration = (client: Client) => |
| 38 | Effect.gen(function* () { |
| 39 | const slug = IntegrationSlug.make(`conn-scn-${randomBytes(4).toString("hex")}`); |
| 40 | yield* client.openapi.addSpec({ |
| 41 | payload: { |
| 42 | spec: { kind: "blob", value: pingSpec }, |
| 43 | slug, |
| 44 | baseUrl: "http://127.0.0.1:59999", // never contacted during registration |
| 45 | authenticationTemplate: [ |
| 46 | { |
| 47 | slug: "apiKey", |
| 48 | type: "apiKey", |
| 49 | headers: { authorization: ["Bearer ", { type: "variable", name: "token" }] }, |
| 50 | }, |
| 51 | ], |
| 52 | }, |
| 53 | }); |
| 54 | return slug; |
| 55 | }); |
| 56 | |
| 57 | // Already in canonical identifier form, so the name round-trips unchanged. |
| 58 | const freshConnectionName = () => ConnectionName.make(`conn${randomBytes(4).toString("hex")}`); |
no test coverage detected