You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. Do you have any plans on supporting lambda integration? I would like to use the User Pool as my authentication of the API and I need to specify the integration type as lambda to use the User Pool claims.
Here is my partial serverless.yml definition.
functions:
# Test API
test:
handler: handler.main
events:
- http:
path: / # this matches the base path
method: ANY
integration: lambda
authorizer:
arn: ${self:custom.userPoolARN}
claims:
- custom:organization
- cognito:groups
- http:
path: /{any+} # this matches any path, the token 'any' doesn't mean anything special
method: ANY
integration: lambda
authorizer:
arn: ${self:custom.userPoolARN}
claims:
- custom:organization
- cognito:groups
Here is my handler file.
'use strict';
import serverless from 'serverless-http';
import express from 'express';
const app = express()
app.get('/', function (req, res) {
res.send('Hello World!')
})
module.exports.main = serverless(app);
When I try to deploy it using the above configuration, the following output is return on the API Gateway.
{"statusCode":404,"headers":{"x-powered-by":"Express","content-security-policy":"default-src 'self'","x-content-type-options":"nosniff","content-type":"text/html; charset=utf-8","content-length":155},"body":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot GET [object%20Object]</pre>\n</body>\n</html>\n"}
The text was updated successfully, but these errors were encountered:
I would be open to PRs that help support this (provided they don't create a lot of complexity/maintainability issues), but I can't see myself having time to work on it, sorry!
Just FYI I've been poking around and the Lambda integration style is substantially different from Lambda-Proxy. To be honest, I'm not even sure what you would expect/want the behaviour to be.
To anyone interested in working on this, I think you'd need to take the path argument (which is an object rather than a string when using Lambda integration) and then back-fill in the values in to the requestPath.
Just to be clear: I don't intend to work on this, since I have no use case for non-proxy itegrations, but if someone does come to use it, I hope this information saves you some time.
Hi. Do you have any plans on supporting lambda integration? I would like to use the User Pool as my authentication of the API and I need to specify the integration type as
lambda
to use the User Pool claims.Here is my partial
serverless.yml
definition.Here is my handler file.
When I try to deploy it using the above configuration, the following output is return on the API Gateway.
The text was updated successfully, but these errors were encountered: