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

fix password rewriting #5256

Merged
merged 3 commits into from
Apr 24, 2020
Merged

fix password rewriting #5256

merged 3 commits into from
Apr 24, 2020

Conversation

MichaelJCompton
Copy link
Contributor

@MichaelJCompton MichaelJCompton commented Apr 21, 2020

Looks like it's missing type information in the check.


This change is Reviewable

Docs Preview: Dgraph Preview

@MichaelJCompton MichaelJCompton requested review from manishrjain and a team as code owners April 21, 2020 02:15
@MichaelJCompton MichaelJCompton added the area/graphql Issues related to GraphQL support on Dgraph. label Apr 21, 2020
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @manishrjain and @MichaelJCompton)


graphql/resolve/query_test.yaml, line 1157 at r1 (raw file):

  gqlquery: |
    query {
      checkUserPassword(name: "user1", pwd: "Password") {

Is there a test which uses an ID as well? If not could we add one and make sure the filter is added for it as well.


graphql/resolve/query_test.yaml, line 1163 at r1 (raw file):

  dgquery: |-
    query {
      checkUserPassword(func: eq(User.name, "user1")) @filter((eq(val(pwd), 1) AND type(User))) {

Just a thought here for later, this query could be optimized to the following

checkUserPassword(func: uid(pwd)) @filter(eq(val(pwd), 1)) {
  ...
}

Since we already have the uid stored inside pwd from the other query.

Copy link
Contributor Author

@MichaelJCompton MichaelJCompton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @id, @manishrjain, and @pawanrawal)


graphql/resolve/query_test.yaml, line 1157 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Is there a test which uses an ID as well? If not could we add one and make sure the filter is added for it as well.

Looks like it only works for @id fields at the moment.


graphql/resolve/query_test.yaml, line 1163 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Just a thought here for later, this query could be optimized to the following

checkUserPassword(func: uid(pwd)) @filter(eq(val(pwd), 1)) {
  ...
}

Since we already have the uid stored inside pwd from the other query.

I've put up a card to look into this feature some more. There's the id thing above and some other odd corners.

@MichaelJCompton MichaelJCompton merged commit 4687538 into master Apr 24, 2020
@MichaelJCompton MichaelJCompton deleted the mjc/graphql-password branch April 24, 2020 05:27
harshil-goel pushed a commit that referenced this pull request May 18, 2020
harshil-goel pushed a commit that referenced this pull request May 18, 2020
harshil-goel pushed a commit that referenced this pull request May 18, 2020
harshil-goel pushed a commit that referenced this pull request May 20, 2020
harshil-goel added a commit that referenced this pull request May 20, 2020
(cherry picked from commit 4687538)

Co-authored-by: Michael Compton <[email protected]>
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

2 participants