dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

fix(GraphQL) fix auth query rewriting with ID filter (cherry-pick-7740)

Open joshua-goldstein opened this issue 2 years ago • 2 comments

Refers to this PR. Cherry pick 7740.

joshua-goldstein avatar Aug 19 '22 23:08 joshua-goldstein

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: joshua-goldstein
:white_check_mark: matthewmcneely
:x: minhaj-shakeel
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Aug 19 '22 23:08 CLAassistant

Coverage Status

Coverage increased (+0.003%) to 37.102% when pulling 50ee38a484563ec1f90859cc0674ef178af62bd4 on cherry-pick-7740 into 9b670174e6af72b773ae59350d7fa3f75e91c80f on main.

coveralls avatar Sep 15 '22 21:09 coveralls

@joshua-goldstein - the tests seem to have failed, I am re-running them (because I suspect this must have happened when one of us was mucking with the runners)

skrdgraph avatar Sep 26 '22 16:09 skrdgraph

Please don't merge this yet. Getting a panic when testing this locally.

matthewmcneely avatar Sep 26 '22 18:09 matthewmcneely

Please don't merge this yet. Getting a panic when testing this locally.

Hi Matthew, any idea why this might be happening locally? Do you have a stack trace of the panic? I reran the test on our runners three times and we see the test passing there.

joshua-goldstein avatar Sep 27 '22 21:09 joshua-goldstein

@joshua-goldstein, @skrdgraph Could you guys review my recent commits to this branch?

matthewmcneely avatar Sep 27 '22 21:09 matthewmcneely

Please don't merge this yet. Getting a panic when testing this locally.

Hi Matthew, any idea why this might be happening locally? Do you have a stack trace of the panic? I reran the test on our runners three times and we see the test passing there.

@joshua-goldstein The issue was that the tests were not creating all the conditions in which an ID-assigned JWT variable was being passed—namely, the tests covered arrays (slices), but not single values. I uncovered this by actually deploying a graph with auth protected types and running queries with actual JWTs in the requests.

So the fix was to check for that single value, not just the slice. I added another test to cover this condition.

matthewmcneely avatar Sep 27 '22 23:09 matthewmcneely