MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / registerIntegration

Function registerIntegration

e2e/cloud/connections-credentials.test.ts:37–55  ·  view source on GitHub ↗
(client: Client)

Source from the content-addressed store, hash-verified

35
36/** Registers a fresh apiKey-authenticated integration for connections to bind to. */
37const 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.
58const freshConnectionName = () => ConnectionName.make(`conn${randomBytes(4).toString("hex")}`);

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected