Showing the changes to packages/plugins/openapi (2 of 13 files). Show all
Unified · Split
| @@ -17,6 +17,7 @@ export { · 16 unmodified lines | ||
| 17 | 17 | googleStandardUserOAuthPresets, |
| 18 | 18 | googleOAuthConsentScopes, |
| 19 | 19 | googleOAuthConsentScopesForPreset, |
| 20 | + googleCatalogOAuthScopesForPreset, | |
| 20 | 21 | googleServiceSlug, |
| 21 | 22 | googleAudienceWarningsForUrls, |
| 22 | 23 | googlePresetForDiscoveryUrl, |
| @@ -317,16 +317,21 @@ const GOOGLE_HEALTH_CHECKS: Readonly<Record<string, HealthCheckSpec>> = { · 316 unmodified lines | ||
| 317 | 317 | "google-cloud-resource-manager": { operation: "cloudresourcemanager.projects.list" }, |
| 318 | 318 | }; |
| 319 | 319 | |
| 320 | +/** Complete Google OAuth scope set requested by a catalog preset, including | |
| 321 | + * identity scopes used to label and distinguish connected accounts. */ | |
| 322 | +export const googleCatalogOAuthScopesForPreset = (presetId: string): readonly string[] => | |
| 323 | + compactGoogleOAuthScopes([ | |
| 324 | + ...GOOGLE_IDENTITY_SCOPES, | |
| 325 | + ...googleOAuthConsentScopesForPreset(presetId), | |
| 326 | + ]); | |
| 327 | + | |
| 320 | 328 | const googleCatalogAuthTemplate = (presetId: string) => [ |
| 321 | 329 | { |
| 322 | 330 | slug: GOOGLE_OAUTH_SECURITY_SCHEME, |
| 323 | 331 | kind: "oauth2" as const, |
| 324 | 332 | authorizationUrl: GOOGLE_OAUTH_AUTHORIZATION_URL, |
| 325 | 333 | tokenUrl: GOOGLE_OAUTH_TOKEN_URL, |
| 326 | − scopes: compactGoogleOAuthScopes([ | |
| 327 | − ...GOOGLE_IDENTITY_SCOPES, | |
| 328 | − ...googleOAuthConsentScopesForPreset(presetId), | |
| 329 | − ]), | |
| 334 | + scopes: googleCatalogOAuthScopesForPreset(presetId), | |
| 330 | 335 | }, |
| 331 | 336 | ]; |
| 332 | 337 | |