Pass multipart/form-data through API Gateway in Lambda Proxy integration - aws-lambda

I am trying to upload multiple files through the API Gateway in a lambda proxy integration using multipart/form-data. I added the multipart/form-data as one of the supported media types in the API Gateway settings. The issue that I am having is that the API Gateway is encoding it in Base64 when it passes it to the lambda proxy. Is there a way to disable this encoding and forward the data as it is to the lambda proxy?

Related

Why spring cloud gateway always returns response in JSON format if no Accept Header is specified in the HTTP request?

We have migrated our in house gateway to spring cloud gateway for routing the requests to respective down-stream micro-services. Whenever a call is made without Accept header, the existing service was returning the response in the XML format(this is the behaviour of the downstream micro-services if we don't pass any Accept headers) - However, when the same call is made without Accept header to spring cloud gateway, the response is returned in JSON format.
How to configure spring cloud gateway to not take the application/json as the Accept header if not passed by the client?
spring-cloud-gateway-starter-version: 3.0.0

how to configure aws ec2 instance in api gateway for reverse proxy

I deployed Swagger APIs in an ec2 instance working with port number. Then, I want to integrate with API gateway for reverse proxy and cors policy. How can I do that? Can any one help on this?
i am able to combine all swagger apis in api gateway.Import the swagger json file in apigateway and add the integration methods according to the requirement either lambda or html or aws services and deploy the api.

Is there anyway we can use Spring Cloud Functions + AWS Lambda adapter to process http file uploads?

I am new to AWS and FAAS. My work place is interested in processing HTTP file upload with AWS Lambda and Spring Boot. A quick research led me to Spring Cloud Functions + AWS Lambda adapter; however, documentation doesn't cover anything related to HTTP file uploads, so I wonder if it is possible to do that with Spring Cloud Function or I have to fallback to AWS Lambda Spring Boot integration (https://github.com/awslabs/aws-serverless-java-container)?
Thanks in advance for your kind enlightenment!
AWS lambda can be triggered in many ways like API gateway, S3Event, SNS notification and SQS. API gateway integrates lambda with HTTP end points. API gateway is not designed to handle file uploads. API gateway converts binary data to base64 encoded text. Handling binary data as text consumes a lot of memory and processing gets tricky as well.
Also API gateway has a 10MB limit on payload size. The best approach to upload files is using S3. Even better approach would be to use a lambda function to generate a pre-signed S3 url to upload files.
Spring cloud function when integrated with an API gateway is intended to expose a single HTTP endpoint. However AWS Lambda spring boot integration by awslabs can expose multiple end points. Choose the approach that best works you.
Hope that helps.

Spring boot Oauth2 SSO with Zuul proxy and multiple clients (native, mobile, web)

I'm currently working on a project that uses Zuul to proxy requests to both API endpoints as well as client resources. There is an angular app that is being served from the same endpoint as the Zuul proxy as outlined in this guide. I have the need for additional clients, specifically a desktop application.
I'm not sure I understand how Zuul proxy handles requests and I think there are several paths to get to where I want to go, I'm just not sure what the correct one is.
Here is what I have surmised thus far:
Option 1: Extract the Zuul proxy and SSO capabilities to it's own server. Then create a new UI server which is behind the gateway server. Follow this up with creating a new client application server which handles the authentication of the desktop client.
Option 2: Extract the Zuul proxy and SSO capabilities to it's own server. Serve the current angular app from its own server NOT behind the proxy and change the authorization flow to something different (implicit). Alter Zuul proxy and SSO configuration to ignore requests that already have a bearer token in the header.
If I go with option 2 then I don't understand how to register with the Zuul gateway client that I already am providing the authorization header with my requests so all it should be doing then is proxying my requests to the correct microservices.
Final Questions:
Which option is the most optimal one?
If an access token is already acquired (directly from the auth server using implicit flow) then how does Zuul need to be configured to not try and acquire the access token using the jsessionid?

Use KONG as API Gateway to GraphQL/REST services

I'm trying to understand if it's possible to use KONG as API Gateway to microservices implementing REST and/or GraphQL interfaces
As API Gateway will expose a GraphQL API and will request to our microservices currently implemented in REST/GraphQL and grpc coming soon.
It can route the Graphql as any other HTTP request but it doesn't parse graphql to route each bit to a a specific service
Kong can front any RESTful API and through a transformation plugin you should be able to deal with GraphQL API as well.

Resources