-
Notifications
You must be signed in to change notification settings - Fork 102
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
API to refresh access token api for user #136
Conversation
e4d43df
to
1913cf5
Compare
1913cf5
to
e0e89ad
Compare
e0e89ad
to
abbb243
Compare
abbb243
to
8d0e48c
Compare
8d0e48c
to
2143c2a
Compare
api/design/auser.go
Outdated
@@ -0,0 +1,57 @@ | |||
// Copyright © 2020 The Tekton Authors. |
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.
Should it be 2021 ??
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.
yep
api/design/auser.go
Outdated
Header("refreshToken:Authorization") | ||
|
||
Response(StatusOK) | ||
Response("internal-error", StatusInternalServerError) |
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.
Are we missing invalid authorization code error ??
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.
why do we need invalid authorization code error
? this is not login api
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.
Then why are we mentioning it above ??
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.
ohh.. willl remove it :P
api/pkg/service/user/user.go
Outdated
@@ -0,0 +1,130 @@ | |||
// Copyright © 2020 The Tekton Authors. |
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.
Same as above
api/design/auser.go
Outdated
var _ = Service("user", func() { | ||
Description("The user service exposes endpoint to get user specific specs") | ||
|
||
Error("invalid-code", ErrorResult, "Invalid Authorization code") |
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.
not needed
9a1c3ad
to
a05a0f0
Compare
This adds an API to refresh access token for user. This requires user refresh token to be passed to get a new access token. Signed-off-by: Shivam Mukhade <[email protected]>
a05a0f0
to
29a4462
Compare
/lgtm |
return userScopes, nil | ||
} | ||
|
||
func createChecksum(token string) string { |
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.
Can you please add a unit test for this
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.
Do we need a separate test? this is being tested with the API as we store it in db and check the db record.
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.
In db we just check if we have checksum, what I think is passing the token it should return the checksum is what this function does and hence I think we need to test 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.
yeah but before checking in db it creates the checksum
Description("The user service exposes endpoint to get user specific specs") | ||
|
||
Error("invalid-token", ErrorResult, "Invalid User token") | ||
Error("invalid-scopes", ErrorResult, "Invalid User scope") |
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.
I don't think we have used this error in the implementation of the api
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.
It is being by the auth service while verifying jwt
/lgtm |
/approve |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: PuneetPunamiya The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/woof |
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This adds implementation for API to refresh access token for user. This
requires user refresh token to be passed to get a new access token.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.