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

Function spec

e2e/scenarios/oauth-refresh-scope-fallback.test.ts:76–108  ·  view source on GitHub ↗
(
  baseUrl: string,
  oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string },
)

Source from the content-addressed store, hash-verified

74 );
75
76const spec = (
77 baseUrl: string,
78 oauth: { readonly authorizationEndpoint: string; readonly tokenEndpoint: string },
79): string =>
80 JSON.stringify({
81 openapi: "3.0.3",
82 info: { title: "Issues API", version: "1.0.0" },
83 servers: [{ url: baseUrl }],
84 paths: {
85 "/issues": {
86 get: {
87 operationId: "listIssues",
88 summary: "List issues",
89 security: [{ oauth: ["issues.read"] }],
90 responses: { "200": { description: "issues" } },
91 },
92 },
93 },
94 components: {
95 securitySchemes: {
96 oauth: {
97 type: "oauth2",
98 flows: {
99 authorizationCode: {
100 authorizationUrl: oauth.authorizationEndpoint,
101 tokenUrl: oauth.tokenEndpoint,
102 scopes: { "issues.read": "Read issues", "issues.write": "Write issues" },
103 },
104 },
105 },
106 },
107 },
108 });
109
110const invokeByAddressCode = (address: string, args: unknown) => `
111const segments = ${JSON.stringify(address)}.split(".").slice(1);

Calls

no outgoing calls

Tested by

no test coverage detected