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