|
28 | 28 | public class ApiGatewayRequestIdentity { |
29 | 29 |
|
30 | 30 | /** |
31 | | - * Creates an ApiGatewayRequestIdentity instance with default values. |
| 31 | + * Creates an ApiGatewayRequestIdentity instance with default values based on a typical API Gateway request. |
32 | 32 | * |
33 | 33 | * @return A pre-configured ApiGatewayRequestIdentity instance |
34 | 34 | */ |
35 | 35 | public static ApiGatewayRequestIdentity getApiGatewayRequestIdentity() { |
36 | 36 | ApiGatewayRequestIdentity identity = new ApiGatewayRequestIdentity(); |
37 | | - // Set default values for all fields |
38 | | - identity.setApiKey(""); |
39 | | - identity.setApiKeyId(""); |
40 | | - identity.setUserArn(""); |
41 | | - identity.setCognitoAuthenticationType(""); |
42 | | - identity.setCaller(""); |
43 | | - identity.setUserAgent(""); |
44 | | - identity.setUser(""); |
45 | | - identity.setCognitoIdentityPoolId(""); |
46 | | - identity.setCognitoIdentityId(""); |
47 | | - identity.setCognitoAuthenticationProvider(""); |
48 | | - identity.setSourceIp("127.0.0.1"); // Reasonable default |
49 | | - identity.setAccountId(""); |
50 | | - identity.setAccessKey(""); |
| 37 | + // Set default values based on example API Gateway request |
| 38 | + identity.setApiKey(null); |
| 39 | + identity.setApiKeyId(null); |
| 40 | + identity.setUserArn(null); |
| 41 | + identity.setCognitoAuthenticationType(null); |
| 42 | + identity.setCaller(null); |
| 43 | + identity.setUserAgent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"); |
| 44 | + identity.setUser(null); |
| 45 | + identity.setCognitoIdentityPoolId(null); |
| 46 | + identity.setCognitoIdentityId(null); |
| 47 | + identity.setCognitoAuthenticationProvider(null); |
| 48 | + identity.setSourceIp("127.0.0.1"); |
| 49 | + identity.setAccountId(null); |
| 50 | + identity.setAccessKey(null); |
51 | 51 | return identity; |
52 | 52 | } |
53 | 53 |
|
|
0 commit comments