Open princefishthrower opened 1 year ago
Thanks for opening your first issue here! 🎉 I'm looking to inspect and correct
There is the TokenAuth
method on the client that will add both the bearer token and the apikey
. But, actually, this is a bit strange isn't it? Is this supposed to be a generic PostgREST client? Then I wouldn't expect that invoking TokenAuth
would also set the apikey
header. I had a look at the JS and Rust clients and they do not set that header.
@craigpastro I created a separate issue (https://github.com/supabase-community/postgrest-go/issues/32) which I think addresses your comment. Being able to independently set the Authorization and apiKey headers would be useful for Row Level Security purposes.
@zoogeny Yeah, that is perfect. Thanks for that 🙌
hey @craigpastro I just I created a PR #41 to help fix this issue =)
Just wasted approx 5 hours when I realized you need to pass both an
apikey
ANDAuthorization
key when initializing the client:IMO opinion this should anyway become a single field call 'key' or something, and then within the library itself it is applied to
Hoping this helps anyone who probably otherwise assumed (like I did) that this library was broken!
Please update the README to reflect this information!