
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
github.com/gaw508/lambda-proxy-http-adapter
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
High CVE
Wrap your API Gateway Proxy Lambda handlers in a go net/http handler. Useful to make the Lambda Proxy handlers compatible with the huge amount of tooling that already exists for net/http.
This adapter will work for many use cases, but was built specifically with https://github.com/steinfletcher/apitest in mind. This adapter allows you to write apitests for your AWS API Gateway Proxy Lambda applications.
package main
import (
"github.com/aws/aws-lambda-go/events"
"github.com/gaw508/lambda-proxy-http-adapter"
)
func main() {
httpHandler := lambda_proxy_http_adapter.GetHttpHandler(apiGatewayProxyHandler, "/", nil)
...
}
func apiGatewayProxyHandler(r events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
...
}
When using API Gateway, path routing is done on behalf of the application inside the API Gateway. Because of this, if your application uses path params, you need to pass the resource path pattern. This is so the adapter is able to parse the URL in the request, and is able to provide path params to your proxy handler.
package main
import (
"github.com/aws/aws-lambda-go/events"
"github.com/gaw508/lambda-proxy-http-adapter"
)
func main() {
httpHandler := lambda_proxy_http_adapter.GetHttpHandler(apiGatewayProxyHandler, "/users/{userId}", nil)
...
}
func apiGatewayProxyHandler(r events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
...
}
API Gateway Proxy handlers allows you to use stage variables. If you use these in your handler, you have to pass them
into the adapter as a map[string]string
.
package main
import (
"github.com/aws/aws-lambda-go/events"
"github.com/gaw508/lambda-proxy-http-adapter"
)
func main() {
httpHandler := lambda_proxy_http_adapter.GetHttpHandler(apiGatewayProxyHandler, "/", map[string]string{"var1": "var1value"})
...
}
func apiGatewayProxyHandler(r events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
...
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.