-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT 2.20][PLAT-10472] Insecure Account Profile Management
Summary: - Deprecate the API ``` PUT /customers/:cUUID/users/:uUUID/change_password com.yugabyte.yw.controllers.UsersController.changePassword(cUUID: java.util.UUID, uUUID: java.util.UUID, request: Request) ``` - The deprecated change_password API would throw Forbidden response always. Also, it would suggest the user to use the new API for changing the password. - The reason for deprecating this API is because the request body does not support a way to provide the current password. Also, we do not require the userUUID as part of the request as we only allow password change from the same user. - The API ``` PUT /customers/:cUUID/users/:uUUID/update_profile com.yugabyte.yw.controllers.UsersController.updateProfile(cUUID: java.util.UUID, uUUID: java.util.UUID, request: Request) ``` I would throw Forbidden response in case the request attempts to change the password. I would also make a change to disallow a user to change their own Role in the old RBAC way using the update_profile API. - The new API PUT /customers/:cUUID/reset_password is used to reset the password of the loggedin user only. The user is identified using the Auth/API token. ``` { "currentPassword": "oldPassword", "newPassword": "newPassword" } ``` Original commit: db597f2 Original diff: https://phorge.dev.yugabyte.com/D34049 Test Plan: Manual testing with old RBAC and new RBAC flows UTs Reviewers: #yba-api-review, sneelakantan Reviewed By: #yba-api-review, sneelakantan Subscribers: yugaware Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D34429
- Loading branch information
1 parent
98c737a
commit 9687371
Showing
9 changed files
with
441 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
managed/src/main/java/com/yugabyte/yw/forms/UserPasswordChangeFormData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.yugabyte.yw.forms; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@ApiModel( | ||
value = "UserPasswordChangeFormData", | ||
description = "User registration data. The API and UI use this to validate form data.") | ||
@Getter | ||
@Setter | ||
public class UserPasswordChangeFormData { | ||
|
||
@ApiModelProperty(value = "Current Password", example = "Test@1234") | ||
private String currentPassword; | ||
|
||
@ApiModelProperty(value = "New Password", example = "Test@1234") | ||
private String newPassword; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.