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