-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Auth not working for InputObjectGraphType<> #27
Comments
Indeed that should have been working with that PR (though I failed to ask for tests to verify). Can you provide a failing test to demonstrate the issue? |
I'm also having this issue. I tried creating a test to prove it, without success. I can report, though, that at least in my setup, the |
From stepping through local code, I'm also seeing that an To be clear, the field I want to authorize on is on one of the variable values. @okarlsson, @cotzo, is that also what you are doing? |
I tried fork this repo and replicate the issue with some unit tests, but everything seemed to work there. Currently I'm using my own implementations of IValidationRule so I dont have this problem in my project any longer. Have you found anything else regarding this @chris-nissen or should we close the issue for now? |
No, I haven't found anything more. I worked around this by adding a custom requirement that implements IAuthorizationRequirement, so I'm OK. But neither do I necessarily think this should be closed. There's definitely an issue here. I know that @joemcbride has been busy with his job, so maybe he'll be able to chime in when he has more time. |
Hi guys, I encountered this problem also. It seems that it partially works.
InputObjectGraphType class:
Works in case 1:
Doesn't works in case 2:
From the debugging I've made I concluded that:
|
@okarlsson could you provide the implementation for I am also having the issue that authorization is not being checked for |
@furier - I posted a comment in a different issue that gives an example for the implementation. You can find it here: #6 (comment) I also recommend you to check out the Authorization chapter in the docs that my solution is heavily based on: https://graphql-dotnet.github.io/docs/getting-started/authorization. |
@okarlsson thanks, but seems I have a different problem then. the However |
I've added a fix for the issue I've explained in the comments above. @joemcbride please take a look and let me know what you think. Thanks |
@bogdancice seems to work for the complex type it self but not it's fields, at least for me... variableData does not contain the keys of the fields that I passed in and therefore no authorization checks are performed on the |
@furier good point, you are right. I fixed the issue and added unit tests |
@joemcbride when you have some spare time can you please check the PR and let me know what you think? We need Variables Validation in our projects |
Fixed in #179. Will be released in v4.1. |
I'm having some issues with auth between input and output types. With the following types I only got an error if I tried to use the name field in a query, but not in my mutation.
I'm using GraphQL.Authorization 2.0.27 and it seems like this should have been resolved in #17 ?
The text was updated successfully, but these errors were encountered: