Skip to content

Commit

Permalink
Refactored code
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Aug 29, 2023
1 parent 863c473 commit 76fb667
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 260 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.expired.password.identification</artifactId>
<version>1.2.69-SNAPSHOT</version>
<version>1.2.71-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<artifactId>org.wso2.carbon.identity.api.expired.password.identification</artifactId>
<version>1.2.69-SNAPSHOT</version>
<version>1.2.71-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class PasswordExpiredUsersApi {
@ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class),
@ApiResponse(code = 500, message = "Internal Server Error", response = Error.class)
})
public Response getPasswordExpiredUsers( @Valid@ApiParam(value = "The date after which passwords will expire.") @QueryParam("expiredAfter") String expiredAfter, @Valid@ApiParam(value = "The date after which should be excluded.") @QueryParam("excludeAfter") String excludeAfter) {
public Response getPasswordExpiredUsers( @Valid @NotNull(message = "Property cannot be null.") @ApiParam(value = "The date after which passwords will expire.",required=true) @QueryParam("expiredAfter") String expiredAfter, @Valid@ApiParam(value = "The date after which should be excluded.") @QueryParam("excludeAfter") String excludeAfter) {

return delegate.getPasswordExpiredUsers(expiredAfter, excludeAfter );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,6 @@ public List<PasswordExpiredUser> getPasswordExpiredUsers(
private void validateDates(String expiredAfter, String excludeAfter) throws
ExpiredPasswordIdentificationClientException {

// Check if the required parameter 'expiredAfter' is present.
if (StringUtils.isEmpty(expiredAfter)) {
ErrorMessage error = ErrorMessage.ERROR_REQUIRED_PARAMETER_MISSING;
throw new ExpiredPasswordIdentificationClientException(error.getCode(), error.getMessage(),
String.format(error.getDescription(), DATE_EXPIRED_AFTER));
}

// Validate the date format.
validateDateFormat(expiredAfter, DATE_EXPIRED_AFTER);
if (StringUtils.isNotEmpty(excludeAfter)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ info:
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'

servers:
- url: 'https://{server-url}/t/{tenant-domain}/api/expired-password-identification/v1'
- url: 'https://{server-url}/t/{tenant-domain}/api/server/v1/expired-password-identification'
variables:
server-url:
default: "localhost:9443"
Expand All @@ -31,6 +31,7 @@ paths:
parameters:
- in: query
name: expiredAfter
required: true
schema:
type: string
description: The date after which passwords will expire.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>identity-api-server</artifactId>
<groupId>org.wso2.carbon.identity.server.api</groupId>
<version>1.2.69-SNAPSHOT</version>
<version>1.2.71-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit 76fb667

Please sign in to comment.