diff --git a/docs/openapi/openapi-iam.yaml b/docs/openapi/openapi-iam.yaml index 24f84751..82a3f33f 100644 --- a/docs/openapi/openapi-iam.yaml +++ b/docs/openapi/openapi-iam.yaml @@ -10775,6 +10775,9 @@ userName: type: string description: The username of the recipient. You can use either email and userName. + clientUserId: + type: string + description: Specifies unique identifier for signer email: type: string description: Specifies the email of the recipient diff --git a/docs/openapi/openapi-jwt.yaml b/docs/openapi/openapi-jwt.yaml index 29582f54..059d66d6 100644 --- a/docs/openapi/openapi-jwt.yaml +++ b/docs/openapi/openapi-jwt.yaml @@ -10775,6 +10775,9 @@ userName: type: string description: The username of the recipient. You can use either email and userName. + clientUserId: + type: string + description: Specifies unique identifier for signer email: type: string description: Specifies the email of the recipient diff --git a/docs/openapi/openapi-key.yaml b/docs/openapi/openapi-key.yaml index b3dd8969..e5e70a1a 100644 --- a/docs/openapi/openapi-key.yaml +++ b/docs/openapi/openapi-key.yaml @@ -10775,6 +10775,9 @@ userName: type: string description: The username of the recipient. You can use either email and userName. + clientUserId: + type: string + description: Specifies unique identifier for signer email: type: string description: Specifies the email of the recipient diff --git a/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/ApiHttpRequest.java b/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/ApiHttpRequest.java index 0ef69b91..69068283 100644 --- a/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/ApiHttpRequest.java +++ b/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/ApiHttpRequest.java @@ -33,13 +33,12 @@ * */ public class ApiHttpRequest { - /** Http Body. */ private String body; - /** Http Method. */ private String httpMethod; - + /** Headers. */ + private Map headers; /** Is Request Body Base64 Encoded. */ private Boolean isBase64Encoded; /** Http path. */ @@ -64,6 +63,26 @@ public ApiHttpRequest() { this.requestContext.put("authorizer", authorizer); } + /** + * Get Headers {@link Map}. + * + * @return {@link Map} + */ + public Map headers() { + return this.headers; + } + + /** + * Set Headers. + * + * @param httpHeaders {@link Map} + * @return ApiHttpRequest + */ + public ApiHttpRequest headers(final Map httpHeaders) { + this.headers = httpHeaders; + return this; + } + /** * Get Http Body. * @@ -84,15 +103,9 @@ public ApiHttpRequest body(final String httpBody) { return this; } - @SuppressWarnings("unchecked") - private Map getClaims() { - Map authorizer = (Map) this.requestContext.get("authorizer"); - return (Map) authorizer.get("claims"); - } - /** * Set Http Group. - * + * * @param group {@link String} * @return {@link ApiHttpRequest} */ @@ -101,6 +114,12 @@ public ApiHttpRequest group(final String group) { return this; } + @SuppressWarnings("unchecked") + private Map getClaims() { + Map authorizer = (Map) this.requestContext.get("authorizer"); + return (Map) authorizer.get("claims"); + } + /** * Get HTTP method. * diff --git a/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/HttpRequestToApiHttpRequest.java b/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/HttpRequestToApiHttpRequest.java index c68e9fac..1f6f077d 100644 --- a/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/HttpRequestToApiHttpRequest.java +++ b/fkq-test-utils/src/main/java/com/formkiq/testutils/aws/HttpRequestToApiHttpRequest.java @@ -85,9 +85,13 @@ public ApiHttpRequest apply(final HttpRequest httpRequest) { String group = String.join(" ", decoder.getGroups()); Map> permissions = decoder.getPermissions(); - return new ApiHttpRequest().httpMethod(httpRequest.getMethod().getValue()).resource(resource) - .path(path).pathParameters(pathParameters).queryParameters(queryParameters) - .user(decoder.getUsername()).group(group).permissions(permissions).body(body); + Map httpHeaders = httpRequest.getHeaders().getEntries().stream().collect( + Collectors.toMap(h -> h.getName().getValue(), h -> h.getValues().get(0).getValue())); + + return new ApiHttpRequest().headers(httpHeaders).httpMethod(httpRequest.getMethod().getValue()) + .resource(resource).path(path).pathParameters(pathParameters) + .queryParameters(queryParameters).user(decoder.getUsername()).group(group) + .permissions(permissions).body(body); } /** diff --git a/lambda-api-graalvm/src/main/resources/cloudformation/openapi-iam.yaml b/lambda-api-graalvm/src/main/resources/cloudformation/openapi-iam.yaml index 9347e7a4..d78f823e 100644 --- a/lambda-api-graalvm/src/main/resources/cloudformation/openapi-iam.yaml +++ b/lambda-api-graalvm/src/main/resources/cloudformation/openapi-iam.yaml @@ -10885,6 +10885,9 @@ Resources: userName: type: "string" description: "The username of the recipient. You can use either email and userName." + clientUserId: + type: "string" + description: "Specifies unique identifier for signer" email: type: "string" description: "Specifies the email of the recipient" diff --git a/lambda-api-graalvm/src/main/resources/cloudformation/openapi-jwt.yaml b/lambda-api-graalvm/src/main/resources/cloudformation/openapi-jwt.yaml index 7db905d7..fc7ad91a 100644 --- a/lambda-api-graalvm/src/main/resources/cloudformation/openapi-jwt.yaml +++ b/lambda-api-graalvm/src/main/resources/cloudformation/openapi-jwt.yaml @@ -10885,6 +10885,9 @@ Resources: userName: type: "string" description: "The username of the recipient. You can use either email and userName." + clientUserId: + type: "string" + description: "Specifies unique identifier for signer" email: type: "string" description: "Specifies the email of the recipient" diff --git a/lambda-api-graalvm/src/main/resources/cloudformation/openapi-key.yaml b/lambda-api-graalvm/src/main/resources/cloudformation/openapi-key.yaml index 3e5e2686..159cdfbe 100644 --- a/lambda-api-graalvm/src/main/resources/cloudformation/openapi-key.yaml +++ b/lambda-api-graalvm/src/main/resources/cloudformation/openapi-key.yaml @@ -10885,6 +10885,9 @@ Resources: userName: type: "string" description: "The username of the recipient. You can use either email and userName." + clientUserId: + type: "string" + description: "Specifies unique identifier for signer" email: type: "string" description: "Specifies the email of the recipient"