Skip to content

Supabase auth #25

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

Closed

Conversation

gatewaynode
Copy link
Contributor

What kind of change does this PR introduce?

SupaBase specific feature addition and documentation update.

What is the current behavior?

Only works with the PostgRest JWT only auth scheme.

What is the new behavior?

This addition adds support for the Kong gateway API key in SupaBase as an alternate authorization trait (supa_auth()). Documentation also captures the API path needed.

Additional context

New doc and unit tests added. All tests passing locally.

@soedirgo
Copy link
Collaborator

soedirgo commented May 8, 2021

Thanks for the PR!

This repo is for PostgREST in general, not specific to Supabase, so I don't think it's apt to have supa_auth(). As a workaround, in postgrest-js you'd pass the headers as an optional parameter in the constructor, but this breaks the API in Rust so my suggestion is to have a header() method in the builder that does self.headers.insert(key, value). WDYT?

@gatewaynode
Copy link
Contributor Author

Rewrite as a generic header injection method? I think that's a fair compromise. I would like the documentation to specify how that would work with SupaBase as the example though.

@soedirgo
Copy link
Collaborator

I would like the documentation to specify how that would work with SupaBase as the example though.

Yup! That's perfectly fine.

@gatewaynode
Copy link
Contributor Author

We can close this as I've created the compromise solution in #26

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