Skip to content

Commit 7c9efac

Browse files
committed
Added apiKeyId field to address #136 and moved initialization of request fields to the constructor
1 parent 5f706f2 commit 7c9efac

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/model/ApiGatewayRequestIdentity.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public class ApiGatewayRequestIdentity {
3333
//-------------------------------------------------------------
3434

3535
private String apiKey;
36+
private String apiKeyId;
3637
private String userArn;
3738
private String cognitoAuthenticationType;
3839
private String caller;
@@ -60,6 +61,16 @@ public void setApiKey(String apiKey) {
6061
}
6162

6263

64+
public String getApiKeyId() {
65+
return apiKeyId;
66+
}
67+
68+
69+
public void setApiKeyId(String apiKeyId) {
70+
this.apiKeyId = apiKeyId;
71+
}
72+
73+
6374
public String getUserArn() {
6475
return userArn;
6576
}

aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/model/AwsProxyRequest.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,20 @@ public class AwsProxyRequest {
3232
private String resource;
3333
private ApiGatewayRequestContext requestContext;
3434
private Map<String, String> queryStringParameters;
35-
private Map<String, String> headers = new HashMap<>(); // avoid NPE
35+
private Map<String, String> headers;
3636
private Map<String, String> pathParameters;
3737
private String httpMethod;
3838
private Map<String, String> stageVariables;
3939
private String path;
4040
private boolean isBase64Encoded;
4141

42+
public AwsProxyRequest() {
43+
queryStringParameters = new HashMap<>();
44+
headers = new HashMap<>();
45+
pathParameters = new HashMap<>();
46+
stageVariables = new HashMap<>();
47+
}
48+
4249

4350
//-------------------------------------------------------------
4451
// Methods - Getter/Setter

0 commit comments

Comments
 (0)