Conversation
|
Are we still planning on having endpoints to add or remove one star at a time? |
|
@MattCCS as part of the implementation, I believe we also discussed adding the |
| public void setUserSettings( | ||
| @ApiParam("The user id to use") @QueryParam("userId") String userId, | ||
| @ApiParam("The new settings") SingularityUserSettings settings) { | ||
| userManager.updateUserSettings(SingularityValidator.encodeZkName(userId), settings); |
There was a problem hiding this comment.
this ZK encoding stuff should be inside UserManager -- the point of it is to encapsulate away all ZK-related stuff
| private String getAuthUserId() { | ||
| checkBadRequest(user.isPresent() && user.get().getName().isPresent(), "Singularity userId must be provided by auth"); | ||
| return user.get().getName().get(); | ||
| } |
There was a problem hiding this comment.
This method needs some work:
- The error message isn't accurate because we're not using the
userIdquery param anymore. - Being unauthenticated should return an Unauthorized response, not a Bad Request response. Use SingularityAuthorizationHelper as a guide here; it uses
checkUnauthorized(user.isPresent(), "Please log in to perform this action.");for stuff like this. - It's using the
namefield of SingularityUser (Thomas Petr) when it should be using theidfield (tpetr).
There was a problem hiding this comment.
Ah, my bad. So, should I be checking authEnabled before I do the checkAuthorized() call (as happens in SingularityAuthorizationHelper)? Or should I just be calling checkAuthorized() every time?
|
|
||
| import static com.google.common.base.Preconditions.checkNotNull; | ||
|
|
||
| import javax.ws.rs.HEAD; |
There was a problem hiding this comment.
i think this came in from a merge conflict
|
@tpetr any problem with merging this one now? |
This PR enables "starred" Singularity requests to persist in Zookeeper, rather than be stored client-side, so clearing the cache or changing devices won't require re-starring.
/cc @ssalinas @tpetr