-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Send auth variable in custom jwt token. #5220
Conversation
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.
Looks ok, just let me know if the couple of points I've asked about are ok.
Reviewable status: 0 of 4 files reviewed, 7 unresolved discussions (waiting on @arijitAD, @manishrjain, and @MichaelJCompton)
graphql/web/http.go, line 113 at r2 (raw file):
ctx = x.AttachAuthorizationJwt(ctx, r) ctx = x.AttachAccessJwt(ctx, r)
Do we have to do something else here eventually? We'll be either having the enterprise jwt, or the GraphQL on ... or does this just work as is?
x/x.go, line 27 at r2 (raw file):
"encoding/json" "fmt" "github.com/dgrijalva/jwt-go"
Is this dependency the right one? Looks like has lots of github stars. Is it the same thing that we take a JWT dependency on elsewhere?
Also make sure the processing code below is best practice for JWT or same as we do elsewhere in Dgraph.
x/x.go, line 216 at r2 (raw file):
authVariables := jsonMap[CustomClaimsUrl].(map[string]interface{}) return authVariables, nil
how or where are we going to verify the key the JWT is signed with?
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.
Reviewable status: 0 of 4 files reviewed, 7 unresolved discussions (waiting on @golangcibot, @manishrjain, and @MichaelJCompton)
graphql/web/http.go, line 113 at r2 (raw file):
Previously, MichaelJCompton (Michael Compton) wrote…
ctx = x.AttachAuthorizationJwt(ctx, r) ctx = x.AttachAccessJwt(ctx, r)
Do we have to do something else here eventually? We'll be either having the enterprise jwt, or the GraphQL on ... or does this just work as is?
Both store the values in different keys. Hence, both values can co-exist in the context. While extracting the value we query for the key. Should we prioritize if both headers are present?
x/x.go, line 195 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
error strings should not be capitalized or end with punctuation or a newline (from
golint
)
Done.
x/x.go, line 201 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
error strings should not be capitalized or end with punctuation or a newline (from
golint
)
Done.
x/x.go, line 206 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
printf: Errorf call has arguments but no formatting directives (from
govet
)
Done.
x/x.go, line 212 at r1 (raw file):
Previously, golangcibot (Bot from GolangCI) wrote…
printf: Errorf call has arguments but no formatting directives (from
govet
)
Done.
x/x.go, line 27 at r2 (raw file):
Previously, MichaelJCompton (Michael Compton) wrote…
Is this dependency the right one? Looks like has lots of github stars. Is it the same thing that we take a JWT dependency on elsewhere?
Also make sure the processing code below is best practice for JWT or same as we do elsewhere in Dgraph.
Yes, It's the same library used in access_ee.go.
x/x.go, line 216 at r2 (raw file):
Previously, MichaelJCompton (Michael Compton) wrote…
how or where are we going to verify the key the JWT is signed with?
I have added a ToDo above to verify jwt before parsing it. We need a mechanism (via flag) to provide Dgraph the secret key so we can verify it.
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.
Reviewable status: 0 of 4 files reviewed, 7 unresolved discussions (waiting on @golangcibot, @manishrjain, and @MichaelJCompton)
* Send auth variable in custom jwt token. * Verify custom claims using key.
* add Auth directive (#5178) * parse auth rules (#5180) * added query rewriting and e2e tests (#5229) * parse and evaluate RBAC rules. (#5210) * added test cases for auth schema parsing. (#5195) * process auth query rules (#5181) * send auth variable in custom jwt token. (#5220) * auth on get and mutation results (#5259) * delete authorization (#5270) * parse auth meta info from schema. (#5269) * auth on add update mutations (#5300) * query e2e tests for authentication (#5312) * more testing around additional deletes and auth (#5357) * add RSA algo for JWT token verification. (#5358)
* add Auth directive (hypermodeinc#5178) * parse auth rules (hypermodeinc#5180) * added query rewriting and e2e tests (hypermodeinc#5229) * parse and evaluate RBAC rules. (hypermodeinc#5210) * added test cases for auth schema parsing. (hypermodeinc#5195) * process auth query rules (hypermodeinc#5181) * send auth variable in custom jwt token. (hypermodeinc#5220) * auth on get and mutation results (hypermodeinc#5259) * delete authorization (hypermodeinc#5270) * parse auth meta info from schema. (hypermodeinc#5269) * auth on add update mutations (hypermodeinc#5300) * query e2e tests for authentication (hypermodeinc#5312) * more testing around additional deletes and auth (hypermodeinc#5357) * add RSA algo for JWT token verification. (hypermodeinc#5358)
This change is
Docs Preview: