-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add sessions and refresh tokens to Users Management API #654
Conversation
@desusai7 @jimmyjames Sorry for the direct tags - I can see you've been recently active in the repo. Is this change acceptable? I'd welcome any and all feedback. Thanks |
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class SessionsPage { |
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.
We can use inheritance and extend generic Page<> class. For reference, refer ClientsPage class
@JsonProperty("clients") | ||
private List<Client> clients; | ||
@JsonProperty("authentication") | ||
private Authentication authentication; |
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.
last_interacted_at field is missing. For reference - https://auth0.com/docs/api/management/v2/users/get-sessions-for-user
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class RefreshTokensPage { |
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.
We can use inheritance and extend generic Page<> class. For reference, refer ClientsPage class
@JsonProperty("rotating") | ||
private Boolean rotating; | ||
@JsonProperty("resource_servers") | ||
private List<ResourceServer> resourceServers; |
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.
Device object and last_exchanged_at fields are missing. For reference - https://auth0.com/docs/api/management/v2/users/get-refresh-tokens-for-user#scopes
@@ -0,0 +1,38 @@ | |||
package com.auth0.client.mgmt.filter; | |||
|
|||
public class CheckpointPaginationFilter extends BaseFilter { |
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.
We can use PageFilter for now instead of creating new class CheckpointPaginationFilter
* @return a Request to execute | ||
*/ | ||
public Request<SessionsPage> listSessions(String userId, CheckpointPaginationFilter filter) { | ||
Asserts.assertNotNull(userId, "user id"); |
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.
Lets use "user ID" everywhere
* @param filter an optional pagination filter | ||
* @return a Request to execute | ||
*/ | ||
public Request<SessionsPage> listSessions(String userId, CheckpointPaginationFilter filter) { |
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.
We can use PageFilter for now instead of creating new class CheckpointPaginationFilter
* @return a Request to execute | ||
*/ | ||
public Request<RefreshTokensPage> listRefreshTokens(String userId, CheckpointPaginationFilter filter) { | ||
Asserts.assertNotNull(userId, "user id"); |
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.
Lets use "user ID" everywhere
* @param filter an optional pagination filter | ||
* @return a Request to execute | ||
*/ | ||
public Request<RefreshTokensPage> listRefreshTokens(String userId, CheckpointPaginationFilter filter) { |
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.
We can use PageFilter for now instead of creating new class CheckpointPaginationFilter
Changes
Adds support for the following APIs:
These APIs only support the checkpoint pagination so I've added a different filter for them.
References
Fixes #653
Testing
Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.
Checklist