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

only partial schema is visible when backend only perm is true #5059

Closed
aaronhayes opened this issue Jun 11, 2020 · 7 comments
Closed

only partial schema is visible when backend only perm is true #5059

aaronhayes opened this issue Jun 11, 2020 · 7 comments
Assignees
Labels
a/authz Issues related to "authorization" and the policy engine after session claims are procesed c/server Related to server e/easy can be wrapped up in a couple of days k/bug Something isn't working

Comments

@aaronhayes
Copy link

It appears having nested object relationships that have backend only insert permissions breaks schema introspection when the parent object has insert permissions without the backend only flag set. (For the same role)

Error produced when:
Parent Table Insert: backend-only = false
Child Table Insert: backend-only = true

No error is produced when both the parent and child insert permissions have the same value for backend-only.

The server outputs this error:

"error":{"path":"$","error":"type info not found for: 'audiences_obj_rel_insert_input'","code":"unexpected"}

Server Version: 1.2.2
CLI Version 1.2.2
Metadata Version: 2

@aaronhayes
Copy link
Author

aaronhayes commented Jun 11, 2020

okay it seems when I set x-hasura-use-backend-only-permissions true I actually doesn't have access to any permissions where backend-only is false; for the provided x-hasura-role.

I would have assumed all permissions (for the given role) would be available to the trusted backend rather than just those that have explicitly been set to backend-only true.

Is this a bug? Expected?

IMO when setting x-hasura-use-backend-only-permissions to be true the user should be able to run any insert mutation that the role has permissions for regardless of if backend_only true OR false. Currently it only has access to insert mutations that at backend_only true.

EDIT: This explains why the schema introspection is broken.

@tirumaraiselvan tirumaraiselvan added support/needs-action support ticket that requires action by team support/needs-triage Needs to be triaged so that we have enough information to add this to our backlog and removed support/needs-action support ticket that requires action by team labels Jun 16, 2020
@rakeshkky rakeshkky added c/server Related to server e/easy can be wrapped up in a couple of days k/bug Something isn't working and removed support/needs-triage Needs to be triaged so that we have enough information to add this to our backlog labels Jun 16, 2020
@rakeshkky
Copy link
Member

rakeshkky commented Jun 16, 2020

We are not treating the absence of backend_only configuration and backend_only: false same. Hence the bug exist.

@tirumaraiselvan tirumaraiselvan changed the title Nested backend only permissions breaks Schema Introspection only partial schema is visible when backend only perm is true Jun 17, 2020
@husniadil
Copy link

This has been happening to me as well, happily I found this, I thought it was happening only on my side.

@aaronhayes
Copy link
Author

@husniadil in the interim I've just been user an extra user-backend role.

@pacoccino
Copy link

UP this as I have the same problem on v1.3.3

On the console, when I switch to the Relay API, the introspection works. On the regular GraphQL endpoint I get the schema introspection failed for {table}_obj_rel_insert_input

@vaishnavigvs vaishnavigvs added the a/authz Issues related to "authorization" and the policy engine after session claims are procesed label Jun 28, 2021
@dminkovsky
Copy link
Contributor

dminkovsky commented Jul 18, 2021

On 10/20/2020 @tirumaraiselvan wrote on #6035 that this was a dupe and fixed in master. Is that correct?

Edit: This appears to be fixed in 2.0.2

@aaronhayes
Copy link
Author

I'm pretty sure this has been fixed, so going to close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/authz Issues related to "authorization" and the policy engine after session claims are procesed c/server Related to server e/easy can be wrapped up in a couple of days k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants