-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When integrating API Gateway with Lambda Using https://github.com/owasp-sbot/OSBot-AWS/blob/master/osbot_aws/helpers/Rest_API.py , the integration by default assumes the response type as application/json as per the below code
OSBot-AWS/osbot_aws/helpers/Rest_API.py
Lines 35 to 47 in bb647f7
def add_method_http(self, from_path, from_method, to_method, to_uri): | |
resource_id = self.resource_id(from_path) | |
status_code = '200' | |
response_models = {'application/json': 'Empty'} | |
response_templates = {'application/json': ''} | |
method_create = self.api_gateway.method_create (self.id() , resource_id , from_method ) | |
integration_create__http = self.api_gateway.integration_create__http (self.id() , resource_id , to_uri , from_method , to_method ) | |
method_response_create = self.api_gateway.method_response_create (self.id() , resource_id , from_method , status_code ,response_models ) | |
integration_response_create = self.api_gateway.integration_response_create(self.id() , resource_id , from_method , status_code , response_templates) | |
return { 'method_create' : method_create , | |
'integration_create__http' : integration_create__http , | |
'method_response_create' : method_response_create , | |
'integration_response_create': integration_response_create } |
This needs to be refactored so that custom types can be provided. It is useful to have custom type so that we can expose streaming api using lambda + Api Gateway. One usecase for this is to expose streaming API for screenshot lambda where we stream the screenshot png/pdf from S3 bucket
Metadata
Metadata
Assignees
Labels
No labels