-
Notifications
You must be signed in to change notification settings - Fork 150
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
feat(graphql): add allowUnauthenticated parameter to auth rules #355
feat(graphql): add allowUnauthenticated parameter to auth rules #355
Conversation
Hey @mathix420, thanks for the contribution! This really needs some integration tests to prove that unexpected errors won't be thrown on execution of the Cypher. |
@darrellwarde Should I open 2 separate issues to explain more in details the |
Hey @mathix420, sorry for the slow reply here! No need to open 2 PRs, happy to review as a batch - was just waiting on some integration tests but realise now I missed your commit! |
It does look like you have some unit test failures though which will need reviewing. |
Yup, sorry dumb mistake I was focalized on I'm not sure if I should replace all others occurences of |
Hey, no need to replace all other |
@danstarns great, have a nice day! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR, always grateful for contributions! 🙂
Please see code comments, and also, I would like to see some integration tests for more complex cases. For example, what happens with allow
and allowUnauthenticated
if there is one post which is published and one that isn't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Literally just a single word documentation change, which I think can just be applied from my suggestion once I've finished this review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As expected, I was able to just apply my word change suggestion.
In which case, this all looks good! 🚀 Thanks for the improvement, and working through changes so quickly!
Thanks @mathix420 |
Description
Add allowUnauthenticated parameter in auth rules to avoid throwing exceptions if no auth is provided.
Changes:
auth/authentication
.paramValue
isundefined
injectfalse
instead of the previous conditionkey = $param
, as it should always be falsyparamValue
isnull
,apoc.validate
raise an exception if the check is done like thisvalue = null
. So I just replaced the condition for it to bevalue IS null
(more infos)EXISTS()
with recommandedIS NOT NULL
. (more infos)Issue
#345
Checklist