-
Notifications
You must be signed in to change notification settings - Fork 1
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
WIP: Refresh session param for whoami endpoint, PLATFORM-6607 #48
Conversation
session/handler.go
Outdated
// Redirect to public endpoint | ||
admin.Handle(m, RouteWhoami, x.RedirectToPublicRoute(h.r)) | ||
} | ||
admin.DELETE(RouteIdentityManagement, h.deleteIdentitySessions) | ||
admin.PATCH(RouteSession, h.adminSessionRefresh) |
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.
Wouldn't it be more sensible to have session refresh only on PATCH
method? GET
should be non-mutable.
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 missed that sorry
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.
The upstream PR got merged btw 😉
92383e9
to
85a92a1
Compare
85a92a1
to
9479410
Compare
Can you make a PR against our repo? :) |
Ah got it, will take a look to confirm |
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 think this looks really good! Just needs some more tests :)
@@ -178,6 +183,15 @@ func (h *Handler) whoami(w http.ResponseWriter, r *http.Request, ps httprouter.P | |||
return | |||
} | |||
|
|||
// Refresh session if param was true | |||
refresh := r.URL.Query().Get("refresh") |
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.
Add this to the OpenAPI spec :)
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.
Fix in b69eb97
Co-authored-by: Mikołaj Meller <[email protected]>
Co-authored-by: Mikołaj Meller <[email protected]>
- oryAccessToken: [] | ||
summary: |- | ||
Calling this endpoint refreshes a current user session. | ||
If `session.refresh_time_window` is set it will only refresh the session after this time has passed. |
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.
If `session.refresh_time_window` is set it will only refresh the session after this time has passed. | |
If `session.refresh_min_time_left` is set it will only refresh the session after this time has passed. |
3be64f1
to
0caadac
Compare
Add a way to refresh a currently used session in the whoami endpoint.
Issue tracked in upstream: #615
Admin part is based on this pr: #2011