This pull request makes a minor adjustment to the temporary API key
validation logic. The key is now considered invalid if it has less than
30 seconds remaining before expiry, instead of the previous 20 seconds.
This change helps avoid edge cases where a key might expire during use.
* Remove the query for temp keys. Remove the query for supabase client. Add a function which creates a supabase client with a temp key.
* Add a new query for building the endpoint URL.
* Migrate all oAuth queries and mutations to use the new function for creating a Supabase project client.
* Use the new queries/mutations in the code.
* Use query in refetchInterval for useProjectSettings.
* Replace all uses in StorageExplorer with createProjectSupabaseClient.
* Refactor the iceberg queries and mutations to use getOrRefreshTemporaryApiKey.
* Fix the uses of the mutations.
* Hardcode the temp api keys queries at 60 seconds.
* added ability to download files from storage api directly
* updated to rechange size
* updated test methods
* updated test suite
* updated tests
* updated to remove loops
* removed AI slop
* Updated to use single API key in mem
* Fix the memoization of the getOrRefreshTempApiKey function.
* updated imports
* updated imports
* updated to use import meta
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* Add custom types for queries, mutations and infinite queries.
* Migrate all queries to use the new type.
* Migrate all infinite queries to useCustomInfiniteQueryOptions.
* Migrate all mutations to use useCustomMutationOptions.
* Add type to all imports in `types` folder.
* oAuth clients index layout
* oAuth apps crud
* is public
* add user count and client secret generation and management
* scaffold oauth server settings
* improve oauth server enablement / disablement
* show cover when oAuth server is disabled
* fix update panel update button
* add site url and authorization path settings values
* move oauth server to it's own nav item
* remove unneeded oauth server settings
* let the user disactivate oauth server even after creating oauth apps
* better delete button
* cleanup
* fix typecheck
* test endpoints
* add EnableOAuth21 feature flag
* update OAUTH_SERVER_ auth config api
* load OAUTH_SERVER_ENABLED in oauth list
* Update the api.d.ts. Remove the custom versions of supa libs.
* Add query for getTemporaryAPIKey.
* Add a hook for initializing a supabase client.
* Add hooks for oAuth Server apps.
* Regenerate pnpm-lock.yaml.
* Revert updates to the platform.d.ts. Not needed for this PR.
* Migrate all code to use the new hooks.
* Try to integrate the mutations and fix some of the sheet and dialogs.
* improve default and saving states
* fix oauth app form validation
* unify components into CreateOrUpdateOAuthAppModal
* create or update oauth app
* Update the OAuth Server page.
* Remove extra files.
* Minor various fixes.
* More fixes to the creation of oauth apps.
* Bump the libs to fix a DELETE oauth app error.
* Clean up the scope feature.
* Move the feature flag in the auth layout.
* Bunch of smaller fixes.
* Regenerate pnpm-lock.
* Revert SidePanel and CardDescription changes.
* Add confirm dialog for regenerating secret.
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* Migrate all uses of invalidateQueries to use object syntax.
* Migrate the remainder of useInfiniteQuery.
* Migrate all setQueriesData.
* Migrate all fetchQuery uses.
* Migrate some leftover functions from RQ.
* Fix issues found by Charis.
* Bump temp API key expiry to an hour just for realtime inspector
* Refresh temp api token whenever starting a refresh listen session in realtime inspector if current token in realtime config is a temp key
* feat: use temporary api keys for storage explorer
* Remove service key from storage explorer store + some minor UI nits
* Address TS
* Another TS
* Update
* Use temp API keys in realtime inspector (#37740)
* Use temp API keys in realtime inspector
* Fix
* fix: typo from github web ui…
* fix: opps
* fix: missing import
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Cemal Kılıç <cemalkilic@users.noreply.github.com>
Co-authored-by: Cemal Kilic <cemalkilic96@gmail.com>
* Start
* Add join org logic
* Regenerate the API types and add RQ hooks.
* Various fixes to the UI for SSO config.
* Refactor the components to use RHF.
* Fix the loading/error states in the main file.
* fix: minor changes to SSO UI
* Expanded default attribute mapping preset for `Okta` to include `user_name`, `first_name`, and `last_name` to match our docs.
* Normalized role casing in the "Join Organization on Signup" dropdown to match the roles expected by the backend (`Owner`, `Administrator`, `Developer`).
* Added the role (`Read-only`) to the selectable roles for auto-join.
* Call update mutation when an `ssoConfig` has been retrieved.
* Treats `404` as a valid "create" flow state rather than an error.
* Conditionally renders the SSO config form when config is successfully loaded *or* when the provider is not found, allowing users to onboard from scratch and disable the provider.
* chore: prettier
* feat: add a button linking to SSO setup docs
* Revert "feat: add a button linking to SSO setup docs"
This will be included in a separate docs pr.
This reverts commit 0b616fdd2e.
* General clean up
* Nit copy
* Add empty state for SSO
* Smol change
* One last tweak
---------
Co-authored-by: Chris Stockton <180184+cstockton@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Chris Stockton <chris.stockton@supabase.io>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
* Deprecate getAPIKeys from project settings v2, use new api keys endpoint instead
* use getPreferredKeys where appropriate
* Prevent usage of secret key for storage and realtime inspector
* Add dashboard API api-keys endpoint
* Simplify
* Disable edge functions test if legacy api keys are disabled
* Revert
* Fix graphiql
* Remove all usage of api keys from project settings, except DisplayApiSettings
* Update
* Fix
* Small fix for an undefined upload url.
* Fix the storage state initialization when the resumable url changes.
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* feat: allow disabling and re-enabling of `anon` and `service_role`
* Cleanup the RQ hooks.
* Restructure the enable/disable alert in API keys.
* Minor cleanups.
* Minor fixes.
* Fix a type error.
---------
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
* first pass
* init
* updated types
* fix up key reveal
* Update QuickKeyCopy.tsx
* remove quick key copy
* api key pill now only allows reveal and copy if you have perm
* Update LegacyAPIKeys.tsx
* fix up layouts
* fix copy
* Fix action menu dropdown position, few small nudges
* Remove unused files.
* Remove the hardcoded and rename the feature flag for basic API keys.
* add support for name and description, some smaller improvements
* Fix the trims for the description.
---------
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
* feat: add basic api keys ui
* init JWT secrets. rough
* Update JWTSecretKeysTable.tsx
* added some info hover cards.
• found this this is probably the wrong direction
• will create a new page for next iteration.
* init new version
* add illustrations
* Update JWTSecretKeysTablev2.tsx
* chore: delete API key now works
* some style changes
* added better tables
* Update JWTSecretKeysTablev2.tsx
* add public JWT dialog
* moar
* adding sub layout in
* starts adding in a ButtonGroup
* about to make into separate components
* added quick copy to project loading screen
* build state
* basic loading
* confirm dialog and loading states
* switched for better loading experience
* moved styles of Input to InputVariants
* issue with ref type
* loading,error and rest states
* new loading states
* alt l;ayout
* add group
* updated error states for permissions
* copy button behaviour for secret keys
* delete dialog
* Update QuickKeyCopy.tsx
* fix type errors
* Update JWTSecretKeysTablev2.tsx
* update menu to hide pages
* Update SettingsMenu.utils.tsx
* Update resource-query.ts
* remove old file
* moved JWT secrets to use valtio
* Update api-keys-query.ts
* fix typecheck
* rename files
* remove JWT stuff
* revert file
* remove more JWT stuff
* Update package.json
* Update pnpm-lock.yaml
* Update ProjectLayout.tsx
* Update PublishableAPIKeys.tsx
* Update api-keys-query.ts
* refactor api-keys-query
* Update SettingsMenu.utils.tsx
* Some clean up
* more clean up and refactor
* Update APIKeyRow.tsx
* Update LayoutHeader.tsx
* resolve comments
* Update CreateSecretAPIKeyModal.tsx
* Update APIKeyRow.tsx
* Add perms check for delete API keys
* Remove console log
* Delete ConnectDialog.tsx
* use project ref
---------
Co-authored-by: Stojan Dimitrovski <sdimitrovski@gmail.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>