Skip to content
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

fix(supabase)!: make Supabase credentials private in SupabaseClient #649

Merged
merged 7 commits into from
Oct 4, 2023

Conversation

dshukertjr
Copy link
Member

@dshukertjr dshukertjr commented Oct 1, 2023

What kind of change does this PR introduce?

Make the following private, because users shouldn't need to access them using the client library.

  • Supabase Key
  • Supabase URL
  • realtime (RealtimeClient instance)
  • rest (PostgrestClient instance)

Additional context

I feel like there might have been a use case where the rest needed be public, but I cannot find the issue that had context about it. I feel like it had something to do with headers, which I think should now be solved since we expose a setter, but if anyone has a use cases for any of these to be public, please do let me know!

Edited:

Not making rest and realtime private #649 (comment)

@dshukertjr dshukertjr changed the title fix!(supabase): fix!(supabase): make some SupabaseClient properties private Oct 1, 2023
@dshukertjr dshukertjr changed the title fix!(supabase): make some SupabaseClient properties private fix!(supabase): make some members of SupabaseClient private Oct 1, 2023
@dshukertjr dshukertjr marked this pull request as draft October 1, 2023 15:38
Comment on lines -102 to -118
/// Creates a Supabase client to interact with your Supabase instance.
///
/// [supabaseUrl] and [supabaseKey] can be found on your Supabase dashboard.
///
/// You can access none public schema by passing different [schema].
///
/// Default headers can be overridden by specifying [headers].
///
/// Custom http client can be used by passing [httpClient] parameter.
///
/// [storageRetryAttempts] specifies how many retry attempts there should be to
/// upload a file to Supabase storage when failed due to network interruption.
///
/// [realtimeClientOptions] specifies different options you can pass to `RealtimeClient`.
///
/// Pass an instance of `YAJsonIsolate` to [isolate] to use your own persisted
/// isolate instance. A new instance will be created if [isolate] is omitted.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chunk of comment is included in the macro below.

@dshukertjr dshukertjr marked this pull request as ready for review October 1, 2023 15:48
@dshukertjr dshukertjr changed the title fix!(supabase): make some members of SupabaseClient private fix(supabase)!: make some members of SupabaseClient private Oct 2, 2023
@Vinzent03
Copy link
Collaborator

I really like the new tests! But I think we should keep rest and realtime public. Some might do some heavy channel management via the realtime object and the headers should be editable per sub library as concluded here

@dshukertjr dshukertjr changed the title fix(supabase)!: make some members of SupabaseClient private fix(supabase)!: make Supabase credentials private in SupabaseClient Oct 3, 2023
@dshukertjr
Copy link
Member Author

@Vinzent03 Thanks for the reminder. Made rest and realtime public again.

@dshukertjr dshukertjr merged commit fa341bf into next Oct 4, 2023
5 checks passed
@dshukertjr dshukertjr deleted the fix/make-private branch October 4, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants