MCPcopy Create free account
hub / github.com/aws-samples/api-gateway-auth / App

Class App

auth-functions/src/main/java/com/auth/App.java:15–32  ·  view source on GitHub ↗

Handler for requests to Lambda function.

Source from the content-addressed store, hash-verified

13 * Handler for requests to Lambda function.
14 */
15public class App implements RequestHandler<Object, APIGatewayV2HTTPResponse> {
16 private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
17
18 public APIGatewayV2HTTPResponse handleRequest(final Object input, final Context context) {
19 try {
20 HashMap<String, String> headers = new HashMap<>();
21 headers.put("Content-Type", "application/json");
22 return APIGatewayV2HTTPResponse.builder()
23 .withStatusCode(200)
24 .withHeaders(headers)
25 .withIsBase64Encoded(false)
26 .withBody(OBJECT_MAPPER.writeValueAsString(input))
27 .build();
28 } catch (JsonProcessingException e) {
29 throw new RuntimeException(e);
30 }
31 }
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected