diff --git a/package-lock.json b/package-lock.json index 9db6b170ae6..4ab022be6d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15279,11 +15279,6 @@ "websocket": "^1.0.34" } }, - "node_modules/@supabase/shared-types": { - "version": "0.1.47", - "resolved": "https://registry.npmjs.org/@supabase/shared-types/-/shared-types-0.1.47.tgz", - "integrity": "sha512-OsXFgKd7yID/5mHuQ8k7I+dCT++ctEEj4YqV8soAik2EP0oiqqRzPwJ8kdmpwK+YyB0Z+AfOxex4dVa7J9J6eA==" - }, "node_modules/@supabase/storage-js": { "version": "2.5.1", "license": "MIT", @@ -42949,7 +42944,7 @@ "@supabase/auth-helpers-nextjs": "^0.5.6", "@supabase/auth-helpers-react": "^0.3.1", "@supabase/react-data-grid": "^7.1.0-beta.7", - "@supabase/shared-types": "0.1.47", + "@supabase/shared-types": "0.1.51", "@supabase/supabase-js": "^2.23.0", "@tanstack/react-query": "^4.22.0", "@tanstack/react-query-devtools": "^4.22.0", @@ -43274,6 +43269,11 @@ "url": "https://opencollective.com/storybook" } }, + "studio/node_modules/@supabase/shared-types": { + "version": "0.1.51", + "resolved": "https://registry.npmjs.org/@supabase/shared-types/-/shared-types-0.1.51.tgz", + "integrity": "sha512-ZCm3sdxFwFDIOakciAH+or1gWQ6SKqiSWmmejsUCyH5QfMl4ngFc6hZcNEky5+NJ5wI7YtukUpvKihNVR0iNSg==" + }, "studio/node_modules/@tanstack/match-sorter-utils": { "version": "8.7.6", "license": "MIT", diff --git a/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx b/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx index 6fc508b5974..c826d2555ce 100644 --- a/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx +++ b/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx @@ -1,13 +1,62 @@ +import { OAuthScope } from '@supabase/shared-types/out/constants' +import { IconCheck } from 'ui' + export interface AuthorizeRequesterDetailsProps { icon: string | null name: string domain: string + scopes: OAuthScope[] } -const AuthorizeRequesterDetails = ({ icon, name, domain }: AuthorizeRequesterDetailsProps) => { +const ScopeSection = ({ + description, + hasReadScope, + hasWriteScope, +}: { + description: string + hasReadScope: boolean + hasWriteScope: boolean +}) => { + if (hasReadScope || hasWriteScope) { + const perms = [hasReadScope ? 'Read' : null, hasWriteScope ? 'Write' : null] + .filter(Boolean) + + .map((str) => ( + + {str} + + )) + .reduce((acc, v) => ( + <> + {acc} + and + {v} + > + )) + + return ( +
+ {name} ({domain}) is requesting API access to an organization. +
++ The following scopes will apply for the{' '} + selected organization and all of its projects. +
+- {name} ({domain}) is requesting API access to an organization. The application will be able - to{' '} - - read and write the organization's settings and all of its projects. - -
{accessDescription}
+ +
diff --git a/studio/components/layouts/APIAuthorizationLayout.tsx b/studio/components/layouts/APIAuthorizationLayout.tsx
index c517fbcbce3..ad7e43de299 100644
--- a/studio/components/layouts/APIAuthorizationLayout.tsx
+++ b/studio/components/layouts/APIAuthorizationLayout.tsx
@@ -1,9 +1,9 @@
+import Divider from 'components/ui/Divider'
+import { BASE_PATH } from 'lib/constants'
+import { useTheme } from 'next-themes'
import Head from 'next/head'
import Image from 'next/image'
-import { useTheme } from 'next-themes'
import { PropsWithChildren } from 'react'
-import { BASE_PATH } from 'lib/constants'
-import Divider from 'components/ui/Divider'
export interface APIAuthorizationLayoutProps {}
@@ -37,7 +37,7 @@ const APIAuthorizationLayout = ({ children }: PropsWithChildren