(oauth: {
readonly authorizationEndpoint: string;
readonly tokenEndpoint: string;
})
| 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. */ |
| 42 | const 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 | |
| 75 | scenario( |
| 76 | "OAuth · the authorization-code flow redirects to this platform's /api/oauth/callback", |
no outgoing calls
no test coverage detected