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

Custom query - permissions #620

Open
ecerichter opened this issue Oct 26, 2021 · 5 comments
Open

Custom query - permissions #620

ecerichter opened this issue Oct 26, 2021 · 5 comments

Comments

@ecerichter
Copy link

Is your feature request related to a problem? Please describe.
In documentation, there is a clear description of how to implement security for acessing tables.
How to do that for custom queries?

Describe the solution you'd like
Implement security settings for custom queries, e document how to do that.

Describe alternatives you've considered
Add server side filters in Apache Http or HaProxy, but they are not effective because there is no user context at this stage.

Additional context

  • not applicable.
@arxdsilva
Copy link
Member

Hi @ecerichter , as long as you have the JWT Authentication setup, the custom queries will also verify the request header for a bearer token, this way it'll only allow access to valid tokens for the provided jwt secret

@ecerichter
Copy link
Author

Thank you. I see... Actually, I misunderstood security settings... I would expect to give a "role" some special permissions, and then associate roles to users... I believe this feature is not implemented (yet, perhaps).
Anyway, I'll check source code and see if we can make it fit our needs. If yes, then we would propose a patch.

@arxdsilva
Copy link
Member

Thank you. I see... Actually, I misunderstood security settings... I would expect to give a "role" some special permissions, and then associate roles to users... I believe this feature is not implemented (yet, perhaps). Anyway, I'll check source code and see if we can make it fit our needs. If yes, then we would propose a patch.

No problem! As we intend to be a API over any db It's hard to enforce any user management or table. There's a basic user setup that can be done so you can authenticate and have a very basic user over /auth route, but it doesnt have any kind of permissions yet.

@gedw99
Copy link

gedw99 commented Jan 21, 2023

Hey @arxdsilva

awesome project !!

I was wondering if formal support for roles to users could be modelled in the db so that queries can use that for:

determining if a user is allowed to execute a query or mutation

Roles can be used in queries and mutations , so that we can search by roles or user.

—-

the later requires this data to exist in the database in order to do it .

jwt as far as I can see is not enough. Pleae let me know.

I need this for my Open Science project .. https://github.com/gedw99/sc-gio

@arxdsilva
Copy link
Member

arxdsilva commented Jan 31, 2023

@gedw99

Hey @arxdsilva, awesome project !!

Thanks the team appreciates :D

We certainly want to upgrade how we do security and permissions, but now there is no easy way and this will likely fall into our API v2. Although even if we had the permissioning that we want for most routes on requests, the permissioning over custom queries probably would be another story, as this can use any table.

Furthermore this is very complicated and I'm not sure how we want to solve now, but probably will have a separate permissioning required, since the user that has access to custom queries should have more rights. We're currently discussing our roadmap for 2023, so feel free to also add your insights here. (:

In the current state of the project we cant assure you that we'll have it anywhere soon. I'm sorry for that, but feel free to contact us in any social media if you want to further discuss this or any other subject around the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants