This is an automated email from the ASF dual-hosted git repository.
ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new db04976 PostAuthenticationRequest schema added for auth body payload
(FINERACT-1369)
db04976 is described below
commit db04976f4f32c6252ead264d0d61d95717bc1cdf
Author: Danish Jamal <[email protected]>
AuthorDate: Sun Aug 8 06:24:23 2021 +0530
PostAuthenticationRequest schema added for auth body payload (FINERACT-1369)
---
.../security/api/AuthenticationApiResource.java | 5 ++++-
.../security/api/AuthenticationApiResourceSwagger.java | 13 +++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java
index dba7ea5..f102792 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResource.java
@@ -21,8 +21,10 @@ package org.apache.fineract.infrastructure.security.api;
import com.google.gson.Gson;
import com.sun.jersey.core.util.Base64;
import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
+import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -93,10 +95,11 @@ public class AuthenticationApiResource {
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Verify authentication", description = "Authenticates
the credentials provided and returns the set roles and permissions allowed.")
+ @RequestBody(required = true, content = @Content(schema =
@Schema(implementation =
AuthenticationApiResourceSwagger.PostAuthenticationRequest.class)))
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
AuthenticationApiResourceSwagger.PostAuthenticationResponse.class))),
@ApiResponse(responseCode = "400", description = "Unauthenticated.
Please login") })
- public String authenticate(final String apiRequestBodyAsJson,
+ public String authenticate(@Parameter(hidden = true) final String
apiRequestBodyAsJson,
@QueryParam("returnClientList") @DefaultValue("false") boolean
returnClientList) {
// TODO FINERACT-819: sort out Jersey so JSON conversion does not have
// to be done explicitly via GSON here, but implicit by arg
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java
index efc5559..22a7d17 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/security/api/AuthenticationApiResourceSwagger.java
@@ -32,6 +32,19 @@ final class AuthenticationApiResourceSwagger {
}
+ @Schema(description = "PostAuthenticationRequest")
+ public static final class PostAuthenticationRequest {
+
+ private PostAuthenticationRequest() {
+
+ }
+
+ @Schema(required = true, example = "mifos")
+ public String username;
+ @Schema(required = true, example = "password")
+ public String password;
+ }
+
@Schema(description = "PostAuthenticationResponse")
public static final class PostAuthenticationResponse {