History

Launch built-in Google OAuth for Calendar and Sheets

Rhys Sullivan committed 2 months ago

Commit ac3bea51 parent 67ee8a013 files · +313 −10Browse files

Showing the changes to packages/plugins/openapi (2 of 13 files). Show all

Unified · Split

2 files
  1. packages/plugins/openapi/src/providers/google/index.ts +1 −0
  2. packages/plugins/openapi/src/providers/google/presets.ts +9 −4
packages/plugins/openapi/src/providers/google/index.ts+1−0
@@ -17,6 +17,7 @@ export { · 16 unmodified lines
17 googleStandardUserOAuthPresets,17 googleStandardUserOAuthPresets,
18 googleOAuthConsentScopes,18 googleOAuthConsentScopes,
19 googleOAuthConsentScopesForPreset,19 googleOAuthConsentScopesForPreset,
20 googleCatalogOAuthScopesForPreset,
20 googleServiceSlug,21 googleServiceSlug,
21 googleAudienceWarningsForUrls,22 googleAudienceWarningsForUrls,
22 googlePresetForDiscoveryUrl,23 googlePresetForDiscoveryUrl,
packages/plugins/openapi/src/providers/google/presets.ts+9−4
@@ -317,16 +317,21 @@ const GOOGLE_HEALTH_CHECKS: Readonly<Record<string, HealthCheckSpec>> = { · 316 unmodified lines
317 "google-cloud-resource-manager": { operation: "cloudresourcemanager.projects.list" },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. */
322export const googleCatalogOAuthScopesForPreset = (presetId: string): readonly string[] =>
323 compactGoogleOAuthScopes([
324 ...GOOGLE_IDENTITY_SCOPES,
325 ...googleOAuthConsentScopesForPreset(presetId),
326 ]);
327
320const googleCatalogAuthTemplate = (presetId: string) => [328const googleCatalogAuthTemplate = (presetId: string) => [
321 {329 {
322 slug: GOOGLE_OAUTH_SECURITY_SCHEME,330 slug: GOOGLE_OAUTH_SECURITY_SCHEME,
323 kind: "oauth2" as const,331 kind: "oauth2" as const,
324 authorizationUrl: GOOGLE_OAUTH_AUTHORIZATION_URL,332 authorizationUrl: GOOGLE_OAUTH_AUTHORIZATION_URL,
325 tokenUrl: GOOGLE_OAUTH_TOKEN_URL,333 tokenUrl: GOOGLE_OAUTH_TOKEN_URL,
326 scopes: compactGoogleOAuthScopes([334 scopes: googleCatalogOAuthScopesForPreset(presetId),
327 ...GOOGLE_IDENTITY_SCOPES,
328 ...googleOAuthConsentScopesForPreset(presetId),
329 ]),
330 },335 },
331];336];
332 337

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t