-
Notifications
You must be signed in to change notification settings - Fork 0
fix: move api calls to backend for better security #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c369c55
fix: move api calls to backend for better security
ical10 69b6740
fix: move supabase calls to backend with request validations
ical10 ba4b58a
fix: handle error statuses correctly
ical10 b08ecbc
ci: configure all non-public env variables as private
ical10 5c4eb31
ci: add secret envs to netlify-deploy workflow
ical10 96a1c8d
fix: avoid leaking database details via error
ical10 cab04af
fix: avoid putting secrets into build by lazy-loaded supabase client
ical10 d09d8f6
ci: try to expose secret envs
ical10 f19f8ec
fix: server error on /splits page
ical10 f906455
fix: netlify config
ical10 6b9b542
ci: make supabaseUrl detectable
ical10 860cd34
ci: fix supabase access by using publishable key
ical10 cd22654
fix: update env vars
ical10 27d42b2
fix: better type-safety for supabase client
ical10 7a5c6ab
fix: filter splits by payer_address
ical10 c25a86d
fix: maintain proper authorization check for pages
ical10 0ec8e0d
fix: persists connected wallet after refresh
ical10 58e635e
fix: pass walletAddress for more robust authorization check on API
ical10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| [build] | ||
| command = "npm run build" | ||
| publish = "build" | ||
| command = "bun run build" | ||
| publish = ".svelte-kit/build" | ||
|
|
||
| [build.environment] | ||
| BUN_VERSION = "1.2.15" | ||
| VITE_USE_SUPABASE = "true" | ||
| VITE_MOCK_GNOSIS_PAY = "true" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { createClient, type SupabaseClient } from '@supabase/supabase-js'; | ||
| import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_PUBLISHABLE_KEY } from '$env/static/public'; | ||
| import type { Database } from '$lib/supabase-types'; | ||
|
|
||
| let _supabase: SupabaseClient<Database> | undefined; | ||
|
|
||
| export function getSupabase(): SupabaseClient<Database> { | ||
| if (!_supabase) { | ||
| // Use public env vars (baked in at build time) | ||
| const supabaseUrl = PUBLIC_SUPABASE_URL; | ||
| const supabaseKey = PUBLIC_SUPABASE_PUBLISHABLE_KEY; | ||
|
|
||
| if (!supabaseUrl || !supabaseKey) { | ||
| throw new Error( | ||
| `Missing Supabase env vars. URL: ${!!supabaseUrl}, KEY: ${!!supabaseKey}. ` + | ||
| `Make sure PUBLIC_SUPABASE_URL and PUBLIC_SUPABASE_PUBLISHABLE_KEY are set.` | ||
| ); | ||
| } | ||
|
|
||
| _supabase = createClient<Database>(supabaseUrl, supabaseKey, { | ||
| auth: { autoRefreshToken: false, persistSession: false } // Server-side: no auth persistence | ||
| }); | ||
| } | ||
| return _supabase; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.