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

Function createHandoffCode

e2e/scenarios/oauth-client-handoff.test.ts:71–90  ·  view source on GitHub ↗
(input: {
  readonly integration: string;
  readonly slug: string;
  readonly clientId: string;
  readonly authorizationUrl: string;
  readonly tokenUrl: string;
})

Source from the content-addressed store, hash-verified

69// ---------------------------------------------------------------------------
70
71const createHandoffCode = (input: {
72 readonly integration: string;
73 readonly slug: string;
74 readonly clientId: string;
75 readonly authorizationUrl: string;
76 readonly tokenUrl: string;
77}) => `
78const handoff = await tools.executor.coreTools.oauth.clients.createHandoff({
79 integration: ${JSON.stringify(input.integration)},
80 owner: "user",
81 slug: ${JSON.stringify(input.slug)},
82 grant: "client_credentials",
83 clientId: ${JSON.stringify(input.clientId)},
84 authorizationUrl: ${JSON.stringify(input.authorizationUrl)},
85 tokenUrl: ${JSON.stringify(input.tokenUrl)},
86});
87return handoff.ok
88 ? { ok: true, url: handoff.data.url, instructions: handoff.data.instructions }
89 : { ok: false, error: handoff.error };
90`;
91
92// The same call, but with a `clientSecret` the tool does not declare. Whatever
93// the boundary does with the excess field (drop or reject), the secret VALUE

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected