Skip to content

Commit 66706aa

Browse files
authored
Adding the client cert attributes (#366)
* Adding the client cert attributes * adding tests
1 parent 8370536 commit 66706aa

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events/apigateway/APIGatewayProxyRequestEvent.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,32 @@ public static class RequestIdentity implements Serializable {
134134
private String user;
135135

136136
private String accessKey;
137+
138+
private String principalOrgId;
139+
140+
private ClientCert clientCert;
141+
}
142+
143+
@AllArgsConstructor
144+
@Builder(setterPrefix = "with")
145+
@Data
146+
@NoArgsConstructor
147+
public static class ClientCert {
148+
149+
private String clientCertPem;
150+
private String issuerDN;
151+
private String serialNumber;
152+
private String subjectDN;
153+
private Validity validity;
154+
}
155+
156+
@AllArgsConstructor
157+
@Builder(setterPrefix = "with")
158+
@Data
159+
@NoArgsConstructor
160+
public static class Validity {
161+
162+
private String notAfter;
163+
private String notBefore;
137164
}
138165
}

aws-lambda-java-events/src/test/resources/event_models/api_gateway_proxy_request_event.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,18 @@
4141
"cognitoAuthenticationProvider": "",
4242
"userArn": "arn:aws:iam::123456789012:user/kdeding",
4343
"userAgent": "Apache-HttpClient/4.5.x (Java/1.8.0_131)",
44-
"user": "AIDAJTIRKKKER4HCKVJZG"
44+
"user": "AIDAJTIRKKKER4HCKVJZG",
45+
"principalOrgId": "",
46+
"clientCert": {
47+
"clientCertPem": "CERT_CONTENT",
48+
"subjectDN": "www.example.com",
49+
"issuerDN": "Example issuer",
50+
"serialNumber": "a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1",
51+
"validity": {
52+
"notBefore": "May 28 12:30:02 2019 GMT",
53+
"notAfter": "Aug 5 09:36:04 2021 GMT"
54+
}
55+
}
4556
},
4657
"path": "/my/path",
4758
"protocol": "HTTP/1.1",

0 commit comments

Comments
 (0)