Comments (5)
@davidtheclark you definitely have access to the $context
variable since it's currently being used in the request template to pass the HTTP method back to the Lambda function. This should be possible with something like:
'application/json': "{\"headers\":\"$input.params()\",\"ip\":\"$context.identity.sourceIp\",\"method\":\"$context.httpMethod\",\"body\":$input.json('$')}"
ip
property being returned if you perform a simple CloudFormation update. It may require deleting and recreating your stack in order to see your changes until #9 lands.
from deprecated-hookshot.
@emilymdubois: I can do this with my own CloudFormation resources, but if I'm using hookshot to create the API Gateway, I'd need to sneak in and mutate the object that hookshot returned in order to change that line of code, right?
I wonder if a parameter should be added to hookshot allowing the user to specify other things that should show up in the response body JSON.
from deprecated-hookshot.
@emilymdubois do you have an example of how we could change https://github.com/mapbox/hookshot/blob/master/index.js#L175 to expose the entire context object on .passthrough()
?
This would be nice to roll up into a breaking version alongside #11
from deprecated-hookshot.
@rclark I haven't experimented with passing the entire $context
object back. I only did this with the $input
variable, and I think 18a0256 was on the right track.
from deprecated-hookshot.
I think the next thing to investigate is the API Gateway proxy integration, which is designed to be a direct passthrough from an HTTP request to a lambda function.
from deprecated-hookshot.
Related Issues (12)
- Publish! HOT 1
- Use API key instead of creating an AWS IAM user HOT 1
- .passthrough() OPTIONS integration does not work for XHR requests HOT 3
- Access-Control-Allow-Headers not getting set in OPTIONS response with CORS
- Eng standards inventory HOT 1
- Archive this repository HOT 2
- Return full message from GitHub HOT 2
- Update readme to be general
- CF template with multiple webhooks would have naming collisions HOT 1
- CORS option
- Replace AWS::ApiGateway::Deployment name on updates HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deprecated-hookshot.