(client: Client, label: string, spec = pingSpec)
| 60 | |
| 61 | /** Registers a fresh apiKey-authenticated integration for connections to bind to. */ |
| 62 | const registerIntegration = (client: Client, label: string, spec = pingSpec) => |
| 63 | Effect.gen(function* () { |
| 64 | const slug = IntegrationSlug.make(`${label}-${randomBytes(4).toString("hex")}`); |
| 65 | yield* client.openapi.addSpec({ |
| 66 | payload: { |
| 67 | spec: { kind: "blob", value: spec }, |
| 68 | slug, |
| 69 | baseUrl: "http://127.0.0.1:59999", // never contacted during registration |
| 70 | authenticationTemplate: [ |
| 71 | { |
| 72 | slug: "apiKey", |
| 73 | type: "apiKey", |
| 74 | headers: { authorization: ["Bearer ", { type: "variable", name: "token" }] }, |
| 75 | }, |
| 76 | ], |
| 77 | }, |
| 78 | }); |
| 79 | return slug; |
| 80 | }); |
| 81 | |
| 82 | const freshConnectionName = () => ConnectionName.make(`conn${randomBytes(4).toString("hex")}`); |
| 83 |
no test coverage detected