-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add methods about user in auth-server (#26)
* feat: implemented user api Signed-off-by: BoGyum Kim | 김보겸 <[email protected]> * test: refactor test with fixture creation methods Signed-off-by: BoGyum Kim | 김보겸 <[email protected]> * refactor: remove randome username generator dependency Signed-off-by: BoGyum Kim | 김보겸 <[email protected]> --------- Signed-off-by: BoGyum Kim | 김보겸 <[email protected]>
- Loading branch information
1 parent
90edfef
commit 52e4379
Showing
18 changed files
with
1,083 additions
and
14 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
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
47 changes: 47 additions & 0 deletions
47
src/main/java/io/litmuschaos/request/PasswordResetRequest.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,47 @@ | ||
package io.litmuschaos.request; | ||
|
||
import io.litmuschaos.util.Builder; | ||
|
||
public class PasswordResetRequest { | ||
|
||
private final String username; | ||
private final String newPassword; | ||
|
||
private PasswordResetRequest(PasswordResetRequestBuilder builder) { | ||
this.username = builder.username; | ||
this.newPassword = builder.newPassword; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public String getNewPassword() { | ||
return newPassword; | ||
} | ||
|
||
public static class PasswordResetRequestBuilder implements Builder<PasswordResetRequest> { | ||
private String username; | ||
private String newPassword; | ||
|
||
public PasswordResetRequestBuilder() {} | ||
|
||
public PasswordResetRequestBuilder username(String username) { | ||
this.username = username; | ||
return this; | ||
} | ||
|
||
public PasswordResetRequestBuilder newPassword(String newPassword) { | ||
this.newPassword = newPassword; | ||
return this; | ||
} | ||
|
||
public PasswordResetRequest build() { | ||
return new PasswordResetRequest(this); | ||
} | ||
} | ||
|
||
public static PasswordResetRequestBuilder builder() { | ||
return new PasswordResetRequestBuilder(); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/main/java/io/litmuschaos/request/PasswordUpdateRequest.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,63 @@ | ||
package io.litmuschaos.request; | ||
|
||
import io.litmuschaos.util.Builder; | ||
|
||
public class PasswordUpdateRequest { | ||
|
||
private final String username; | ||
|
||
private final String oldPassword; | ||
|
||
private final String newPassword; | ||
|
||
private PasswordUpdateRequest(PasswordUpdateRequestBuilder builder) { | ||
this.username = builder.username; | ||
this.oldPassword = builder.oldPassword; | ||
this.newPassword = builder.newPassword; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public String getOldPassword() { | ||
return oldPassword; | ||
} | ||
|
||
public String getNewPassword() { | ||
return newPassword; | ||
} | ||
|
||
public static class PasswordUpdateRequestBuilder implements Builder<PasswordUpdateRequest> { | ||
private String username; | ||
|
||
private String oldPassword; | ||
|
||
private String newPassword; | ||
|
||
public PasswordUpdateRequestBuilder(){} | ||
|
||
public PasswordUpdateRequestBuilder username(String username){ | ||
this.username = username; | ||
return this; | ||
} | ||
|
||
public PasswordUpdateRequestBuilder oldPassword(String oldPassword){ | ||
this.oldPassword = oldPassword; | ||
return this; | ||
} | ||
|
||
public PasswordUpdateRequestBuilder newPassword(String newPassword){ | ||
this.newPassword = newPassword; | ||
return this; | ||
} | ||
|
||
public PasswordUpdateRequest build(){ | ||
return new PasswordUpdateRequest(this); | ||
} | ||
} | ||
|
||
public static PasswordUpdateRequestBuilder builder(){ | ||
return new PasswordUpdateRequestBuilder(); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/io/litmuschaos/request/TokenCreateRequest.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,59 @@ | ||
package io.litmuschaos.request; | ||
|
||
import io.litmuschaos.util.Builder; | ||
|
||
public class TokenCreateRequest { | ||
// Field names in token dto follow snake case convention to maintain consistency with chaos center API response format | ||
private final String user_id; | ||
private final String name; | ||
private final Integer days_until_expiration; | ||
|
||
private TokenCreateRequest(TokenCreateRequestBuilder builder) { | ||
this.user_id = builder.userID; | ||
this.name = builder.name; | ||
this.days_until_expiration = builder.daysUntilExpiration; | ||
} | ||
|
||
public String getUserID() { | ||
return user_id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Integer getDaysUntilExpiration() { | ||
return days_until_expiration; | ||
} | ||
|
||
public static class TokenCreateRequestBuilder implements Builder<TokenCreateRequest> { | ||
private String userID; | ||
private String name; | ||
private Integer daysUntilExpiration; | ||
|
||
public TokenCreateRequestBuilder() {} | ||
|
||
public TokenCreateRequestBuilder userID(String userId) { | ||
this.userID = userId; | ||
return this; | ||
} | ||
|
||
public TokenCreateRequestBuilder name(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public TokenCreateRequestBuilder daysUntilExpiration(Integer daysUntilExpiration) { | ||
this.daysUntilExpiration = daysUntilExpiration; | ||
return this; | ||
} | ||
|
||
public TokenCreateRequest build() { | ||
return new TokenCreateRequest(this); | ||
} | ||
} | ||
|
||
public static TokenCreateRequestBuilder builder() { | ||
return new TokenCreateRequestBuilder(); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/io/litmuschaos/request/TokenDeleteRequest.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,47 @@ | ||
package io.litmuschaos.request; | ||
|
||
import io.litmuschaos.util.Builder; | ||
|
||
public class TokenDeleteRequest { | ||
private final String userID; | ||
private final String token; | ||
|
||
private TokenDeleteRequest(TokenDeleteRequestBuilder builder) { | ||
this.userID = builder.userID; | ||
this.token = builder.token; | ||
} | ||
|
||
public String getUserID() { | ||
return userID; | ||
} | ||
|
||
public String getName() { | ||
return token; | ||
} | ||
|
||
|
||
public static class TokenDeleteRequestBuilder implements Builder<TokenDeleteRequest> { | ||
private String userID; | ||
private String token; | ||
|
||
public TokenDeleteRequestBuilder() {} | ||
|
||
public TokenDeleteRequestBuilder userID(String userId) { | ||
this.userID = userId; | ||
return this; | ||
} | ||
|
||
public TokenDeleteRequestBuilder token(String token) { | ||
this.token = token; | ||
return this; | ||
} | ||
|
||
public TokenDeleteRequest build() { | ||
return new TokenDeleteRequest(this); | ||
} | ||
} | ||
|
||
public static TokenDeleteRequestBuilder builder() { | ||
return new TokenDeleteRequestBuilder(); | ||
} | ||
} |
Oops, something went wrong.