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