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

Function createHandoffCode

e2e/scenarios/oauth-client-handoff.test.ts:70–89  ·  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

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