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

Function oauthIntegrationSpec

e2e/scenarios/oauth-callback-url.test.ts:42–73  ·  view source on GitHub ↗
(oauth: {
  readonly authorizationEndpoint: string;
  readonly tokenEndpoint: string;
})

Source from the content-addressed store, hash-verified

40 * pointed at `oauth`, so the connect modal treats it as an OAuth integration
41 * and a `start` flow has something to attach its connection to. */
42const oauthIntegrationSpec = (oauth: {
43 readonly authorizationEndpoint: string;
44 readonly tokenEndpoint: string;
45}) =>
46 ({
47 spec: {
48 kind: "blob" as const,
49 value: JSON.stringify({
50 openapi: "3.0.3",
51 info: { title: "OAuth-protected API", version: "1.0.0" },
52 paths: {
53 "/me": {
54 get: {
55 operationId: "getMe",
56 tags: ["default"],
57 responses: { "200": { description: "the caller" } },
58 },
59 },
60 },
61 }),
62 },
63 baseUrl: "http://127.0.0.1:59999",
64 authenticationTemplate: [
65 {
66 slug: "oauth",
67 kind: "oauth2" as const,
68 authorizationUrl: oauth.authorizationEndpoint,
69 tokenUrl: oauth.tokenEndpoint,
70 scopes: ["read"],
71 },
72 ],
73 }) as const;
74
75scenario(
76 "OAuth · the authorization-code flow redirects to this platform's /api/oauth/callback",

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected