supabase-community / postgrest-go

Isomorphic Go client for PostgREST. (Now Updating)
https://supabase.io
Apache License 2.0
170 stars 27 forks source link

added functions for setting ApiKey and Authorization Headers #41

Closed whoiscarlo closed 8 months ago

whoiscarlo commented 8 months ago

What kind of change does this PR introduce?

I removed the function TokenAuth, with SetApiKey and SetAuthToken, so that users can change the apiKey and authorization headers individually.

What is the current behavior?

Currently TokenAuth sets the apiKey and authorization header

What is the new behavior?

postgres.SetAuthToken( authToken string)will set the authorization header for subsequent request and postgres.SetApiKey( apiKey string) will set the apiKey header for subsequent request

whoiscarlo commented 8 months ago

Looks good to me!

Maybe consider updating documentation on this to make it clear to users that they might need to set both Headers.

I'm not sure how the version variable should be used, but following semantic versioning, I'd argue that this would be a minor version increase, so 0.1.0?

In any case, I'd like to see this being merged!

@Carnageous yup you got it

muratmirgun commented 8 months ago

Thanks for Contribution 🚀