@@ -161,6 +161,64 @@ def apigateway_proxy_event():
161
161
TransformerUtility .regex (IP_REGEX .strip ("^$" ), "<ip>" ),
162
162
]
163
163
164
+ @staticmethod
165
+ def apigatewayv2_jwt_authorizer_event ():
166
+ return [
167
+ TransformerUtility .jsonpath ("$..claims.auth_time" , "claims-auth-time" ),
168
+ TransformerUtility .jsonpath ("$..claims.client_id" , "claims-client-id" ),
169
+ TransformerUtility .jsonpath ("$..claims.exp" , "claims-exp" ),
170
+ TransformerUtility .jsonpath ("$..claims.iat" , "claims-iat" ),
171
+ TransformerUtility .jsonpath ("$..claims.jti" , "claims-jti" ),
172
+ TransformerUtility .jsonpath ("$..claims.sub" , "claims-sub" ),
173
+ ]
174
+
175
+ @staticmethod
176
+ def apigatewayv2_lambda_proxy_event ():
177
+ return [
178
+ TransformerUtility .key_value ("resourceId" ),
179
+ TransformerUtility .key_value ("sourceIp" ),
180
+ TransformerUtility .jsonpath ("$..requestContext.accountId" , "account-id" ),
181
+ TransformerUtility .jsonpath ("$..requestContext.apiId" , "api-id" ),
182
+ TransformerUtility .jsonpath ("$..requestContext.domainName" , "domain-name" ),
183
+ TransformerUtility .jsonpath ("$..requestContext.domainPrefix" , "domain-prefix" ),
184
+ TransformerUtility .jsonpath (
185
+ "$..requestContext.extendedRequestId" , "extended-request-id"
186
+ ),
187
+ TransformerUtility .jsonpath ("$..requestContext.requestId" , "request-id" ),
188
+ TransformerUtility .jsonpath (
189
+ "$..requestContext.requestTime" ,
190
+ value_replacement = "<request-time>" ,
191
+ reference_replacement = False ,
192
+ ),
193
+ KeyValueBasedTransformer (
194
+ lambda k , v : str (v ) if k == "requestTimeEpoch" else None ,
195
+ "<request-time-epoch>" ,
196
+ replace_reference = False ,
197
+ ),
D420
td>
198
+ TransformerUtility .key_value ("time" ),
199
+ KeyValueBasedTransformer (
200
+ lambda k , v : str (v ) if k == "timeEpoch" else None ,
201
+ "<time-epoch>" ,
202
+ replace_reference = False ,
203
+ ),
204
+ TransformerUtility .jsonpath ("$..multiValueHeaders.Host[*]" , "host" ),
205
+ TransformerUtility .jsonpath (
206
+ "$..multiValueHeaders.X-Forwarded-For[*]" , "x-forwarded-for"
207
+ ),
208
+ TransformerUtility .jsonpath (
209
+ "$..multiValueHeaders.X-Forwarded-Port[*]" , "x-forwarded-port"
210
+ ),
211
+ TransformerUtility .jsonpath (
212
+ "$..multiValueHeaders.X-Forwarded-Proto[*]" , "x-forwarded-proto"
213
+ ),
214
+ TransformerUtility .jsonpath (
215
+ "$..multiValueHeaders.X-Amzn-Trace-Id[*]" , "x-amzn-trace-id"
216
+ ),
217
+ TransformerUtility .jsonpath ("$..multiValueHeaders.authorization[*]" , "authorization" ),
218
+ TransformerUtility .jsonpath ("$..multiValueHeaders.User-Agent[*]" , "user-agent" ),
219
+ TransformerUtility .regex (r"python-requests/\d+\.\d+(\.\d+)?" , "python-requests/x.x.x" ),
220
+ ]
221
+
164
222
@staticmethod
165
223
def cloudformation_api ():
166
224
"""
0 commit comments