Skip to content

Commit d70ed2e

Browse files
authored
chore: Add new OAuth scopes for analytics config to studio (supabase#44826)
## Summary Adds support for new OAuth scopes for reading and writing analytics config to the app creation dialog and consent screen. Depends on supabase/platform#31539
1 parent 82f5521 commit d70ed2e

6 files changed

Lines changed: 25 additions & 6 deletions

File tree

apps/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ export const AuthorizeRequesterDetails = ({
9898
hasReadScope={scopes.includes(OAuthScope.ANALYTICS_READ)}
9999
hasWriteScope={scopes.includes(OAuthScope.ANALYTICS_WRITE)}
100100
/>
101+
<ScopeSection
102+
description={PERMISSIONS_DESCRIPTIONS.ANALYTICS_CONFIG}
103+
hasReadScope={scopes.includes(OAuthScope.ANALYTICS_CONFIG_READ)}
104+
hasWriteScope={scopes.includes(OAuthScope.ANALYTICS_CONFIG_WRITE)}
105+
/>
101106
<ScopeSection
102107
description={PERMISSIONS_DESCRIPTIONS.AUTH}
103108
hasReadScope={scopes.includes(OAuthScope.AUTH_READ)}

apps/studio/components/interfaces/Organization/OAuthApps/OAuthApps.constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export const PERMISSIONS_DESCRIPTIONS = {
22
ANALYTICS: 'access to analytics logs.',
3+
ANALYTICS_CONFIG: 'access to analytics logs configurations.',
34
AUTH: 'access to auth configurations and SSO providers.',
45
DATABASE:
56
'access to Postgres configurations, SQL snippets, SSL enforcement configurations and Typescript schema types.',

apps/studio/components/interfaces/Organization/OAuthApps/PublishAppSidePanel/Scopes.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ export const ScopesPanel = ({
116116
scopes={scopes}
117117
setScopes={setScopes}
118118
/>
119+
<Scope
120+
title="Analytics Config"
121+
description={PERMISSIONS_DESCRIPTIONS.ANALYTICS_CONFIG}
122+
readScopeName={OAuthScope.ANALYTICS_CONFIG_READ}
123+
writeScopeName={OAuthScope.ANALYTICS_CONFIG_WRITE}
124+
scopes={scopes}
125+
setScopes={setScopes}
126+
/>
119127
<Scope
120128
title="Auth"
121129
description={PERMISSIONS_DESCRIPTIONS.AUTH}

apps/studio/components/interfaces/Organization/ProjectClaim/confirm.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ export const ProjectClaimConfirm = ({
199199
hasReadScope={requester.scopes.includes(OAuthScope.ANALYTICS_READ)}
200200
hasWriteScope={requester.scopes.includes(OAuthScope.ANALYTICS_WRITE)}
201201
/>
202+
<ScopeSection
203+
description={PERMISSIONS_DESCRIPTIONS.ANALYTICS_CONFIG}
204+
hasReadScope={requester.scopes.includes(OAuthScope.ANALYTICS_CONFIG_READ)}
205+
hasWriteScope={requester.scopes.includes(OAuthScope.ANALYTICS_CONFIG_WRITE)}
206+
/>
202207
<ScopeSection
203208
description={PERMISSIONS_DESCRIPTIONS.AUTH}
204209
hasReadScope={requester.scopes.includes(OAuthScope.AUTH_READ)}

apps/studio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@supabase/mcp-utils": "^0.4.0",
6565
"@supabase/pg-meta": "workspace:*",
6666
"@supabase/realtime-js": "catalog:",
67-
"@supabase/shared-types": "0.1.84",
67+
"@supabase/shared-types": "0.1.88",
6868
"@supabase/sql-to-rest": "^0.1.6",
6969
"@supabase/supabase-js": "catalog:",
7070
"@tanstack/react-query": "^5.0.0",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)