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

[feature] any plan for implementation: authentication layer #284

Open
thinkORo opened this issue Jul 2, 2023 · 9 comments
Open

[feature] any plan for implementation: authentication layer #284

thinkORo opened this issue Jul 2, 2023 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@thinkORo
Copy link

thinkORo commented Jul 2, 2023

For me the authentication layer is the missing feature to use ROAPI in my project(s).
Is there any plan for the implementation? Is there anything I could do?

@houqp
Copy link
Member

houqp commented Jul 6, 2023

I am not actively working on auth right now, but I am very open to pull requests.

What kind of auth do you need? You might be able to get it done with a simple nginx reverse proxy too.

@thinkORo
Copy link
Author

thinkORo commented Jul 9, 2023

Hi QP Hou,

unfortunately I'm too new to Rust as I could make a good implementation starting from the beginning.

What I'd looking for: basic authentication (like password.db in Trino) to restrict the access to the system for the first step.
In the second step I'd like to have a basic authorization to restrict some specific data objects for different user or user groups.

I could help by documenting the requirement or by testing the functionality or by creating the documentation.

What do you mean?

@houqp
Copy link
Member

houqp commented Jul 10, 2023

Got it, if all you need is basic auth, you could stand up a reverse proxy using nginx as a shorterm workaround, see: https://serverfault.com/questions/230749/how-to-use-nginx-to-proxy-to-a-host-requiring-authentication

@thinkORo
Copy link
Author

But I'd need it for all interfaces. Which means this should work for JDBC/ODBC as well. And that's not possible via nginx as faar as I know?

@houqp
Copy link
Member

houqp commented Nov 20, 2023

that's correct, for JDBC, nginx based auth won't work.

@houqp houqp added enhancement New feature or request good first issue Good for newcomers labels Nov 20, 2023
@elliot14A
Copy link
Contributor

elliot14A commented Dec 27, 2023

Hey @houqp, I want to work on this.
I'll try to create a simple master-key authentication, where the user(admin) will specify if using a MASTER_KEY env and he can generate access-keys using it. Then the other users who are trying to access roapi will these generated keys.

routes:
POST /access_key requires MASTER_KEY in Authorization Header - create new access key
DELETE /access_key/invalidate requires MASTER_KEY in Authorization Header - invalidates access key

please let me know if this approach is ok.

@houqp
Copy link
Member

houqp commented Dec 29, 2023

@elliot14A i recommend starting with something simple that allows users to specify the secret keys in the yaml config. Since roapi doesn't persist any data in data stores, runtime dynamic key registration won't work well because we will lose all the keys on restart/redeploy.

@elliot14A
Copy link
Contributor

@houqp, I was going the implementation of meilisearch https://github.com/meilisearch/meilisearch/tree/main/meilisearch-auth . Should we implement something similar?

@houqp
Copy link
Member

houqp commented Jan 19, 2024

@elliot14A you can give it a try, but keep in mind that we don't have ways to persist the dynamically generated key, so it's better to start with supporting static keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants