{"id":42893723,"url":"https://github.com/its-felix/aws-lambda-go-http-adapter","last_synced_at":"2026-01-30T15:02:23.756Z","repository":{"id":64299576,"uuid":"569511804","full_name":"its-felix/aws-lambda-go-http-adapter","owner":"its-felix","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-04T19:53:23.000Z","size":73,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T09:45:44.666Z","etag":null,"topics":["aws","aws-lambda","aws-lambda-golang","go","golang","http","http-server","serverless","web"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/its-felix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-23T01:49:37.000Z","updated_at":"2024-09-18T18:11:49.000Z","dependencies_parsed_at":"2024-01-27T23:20:28.659Z","dependency_job_id":"bfa737be-db66-4a67-9287-d4752502a2bd","html_url":"https://github.com/its-felix/aws-lambda-go-http-adapter","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/its-felix/aws-lambda-go-http-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/its-felix%2Faws-lambda-go-http-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/its-felix%2Faws-lambda-go-http-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/its-felix%2Faws-lambda-go-http-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/its-felix%2Faws-lambda-go-http-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/its-felix","download_url":"https://codeload.github.com/its-felix/aws-lambda-go-http-adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/its-felix%2Faws-lambda-go-http-adapter/sbom","scorecard":{"id":497280,"data":{"date":"2025-08-11","repo":{"name":"github.com/its-felix/aws-lambda-go-http-adapter","commit":"bc6743ac5cb80cc3ca6e1a9fb3ff1e7915c81d7d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Warn: no topLevel permission defined: .github/workflows/test_and_release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/codecov.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/codecov.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codecov.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/codecov.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_and_release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/test_and_release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_and_release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/test_and_release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_and_release.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/test_and_release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test_and_release.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/its-felix/aws-lambda-go-http-adapter/test_and_release.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3845 / GHSA-qx2q-88mx-vhg7","Warn: Project is vulnerable to: GO-2024-3321 / GHSA-v778-237x-gjrc","Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:46:36.553Z","repository_id":64299576,"created_at":"2025-08-19T20:46:36.553Z","updated_at":"2025-08-19T20:46:36.553Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-lambda-golang","go","golang","http","http-server","serverless","web"],"created_at":"2026-01-30T15:02:21.536Z","updated_at":"2026-01-30T15:02:23.739Z","avatar_url":"https://github.com/its-felix.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Notes\nThis project was created as an alternative to https://github.com/awslabs/aws-lambda-go-api-proxy with support for Lambda Function URL requests.\nFor most cases, I recommend using https://github.com/awslabs/aws-lambda-web-adapter instead (potentially with https://github.com/its-felix/aws-lwa-go-middleware).\n\n# aws-lambda-go-http-adapter\nSimple HTTP adapter for AWS Lambda\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/its-felix/aws-lambda-go-http-adapter.svg)](https://pkg.go.dev/github.com/its-felix/aws-lambda-go-http-adapter)\n[![Go Report](https://goreportcard.com/badge/github.com/its-felix/aws-lambda-go-http-adapter?style=flat-square)](https://goreportcard.com/report/github.com/its-felix/aws-lambda-go-http-adapter)\n\n## Builtin support for these event formats:\n- AWS Lambda Function URL (both normal and streaming)\n- API Gateway (v1)\n- API Gateway (v2)\n- Application Load Balancer\n\n## Builtin support for these HTTP frameworks:\n- `net/http`\n- [Echo](https://github.com/labstack/echo)\n- [Fiber](https://github.com/gofiber/fiber)\n\n## Usage\n### Creating the Adapter\n#### net/http\n```golang\npackage main\n\nimport (\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/adapter\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/ping\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, _ = w.Write([]byte(\"pong\"))\n\t})\n\t\n\tadapter := adapter.NewVanillaAdapter(mux)\n}\n```\n\n#### Echo\n```golang\npackage main\n\nimport (\n\t\"github.com/labstack/echo/v4\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/adapter\"\n\t\"net/http\"\n)\n\nfunc main() {\n\te := echo.New()\n\te.Add(\"GET\", \"/ping\", func(c echo.Context) error {\n\t\treturn c.String(200, \"pong\")\n\t})\n\t\n\tadapter := adapter.NewEchoAdapter(e)\n}\n```\n\n#### Fiber\n```golang\npackage main\n\nimport (\n\t\"github.com/gofiber/fiber/v2\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/adapter\"\n)\n\nfunc main() {\n\tapp := fiber.New()\n\tapp.Get(\"/ping\", func(ctx *fiber.Ctx) error {\n\t\treturn ctx.SendString(\"pong\")\n\t})\n\n\tadapter := adapter.NewFiberAdapter(app)\n}\n```\n\n### Creating the Handler\n#### API Gateway V1\n```golang\npackage main\n\nimport (\n\t\"github.com/aws/aws-lambda-go/lambda\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/handler\"\n)\n\nfunc main() {\n\tadapter := [...] // see above\n\th := handler.NewAPIGatewayV1Handler(adapter)\n\t\n\tlambda.Start(h)\n}\n```\n\n#### API Gateway V2\n```golang\npackage main\n\nimport (\n\t\"github.com/aws/aws-lambda-go/lambda\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/handler\"\n)\n\nfunc main() {\n\tadapter := [...] // see above\n\th := handler.NewAPIGatewayV2Handler(adapter)\n\t\n\tlambda.Start(h)\n}\n```\n\n#### Lambda Function URL (normal)\n```golang\npackage main\n\nimport (\n\t\"github.com/aws/aws-lambda-go/lambda\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/handler\"\n)\n\nfunc main() {\n\tadapter := [...] // see above\n\th := handler.NewFunctionURLHandler(adapter)\n\t\n\tlambda.Start(h)\n}\n```\n\n#### Lambda Function URL (streaming)\n(read the additional notes about streaming below)\n```golang\npackage main\n\nimport (\n\t\"github.com/aws/aws-lambda-go/lambda\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/handler\"\n)\n\nfunc main() {\n\tadapter := [...] // see above\n\th := handler.NewFunctionURLStreamingHandler(adapter)\n\t\n\tlambda.Start(h)\n}\n```\n\n### Accessing the source event\n#### Fiber\n```golang\npackage main\n\nimport (\n\t\"github.com/aws/aws-lambda-go/events\"\n\t\"github.com/gofiber/fiber/v2\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/adapter\"\n)\n\nfunc main() {\n\tapp := fiber.New()\n\tapp.Get(\"/ping\", func(ctx *fiber.Ctx) error {\n\t\tevent := adapter.GetSourceEventFiber(ctx)\n\t\tswitch event := event.(type) {\n\t\tcase events.APIGatewayProxyRequest:\n\t\t\t// do something\n\t\tcase events.APIGatewayV2HTTPRequest:\n\t\t\t// do something\n\t\tcase events.LambdaFunctionURLRequest:\n\t\t\t// do something\n\t\t}\n\t\t\n\t\treturn ctx.SendString(\"pong\")\n\t})\n}\n```\n\n#### Others\n```golang\npackage main\n\nimport (\n\t\"github.com/aws/aws-lambda-go/events\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/handler\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/ping\", func(w http.ResponseWriter, r *http.Request) {\n\t\tevent := handler.GetSourceEvent(r.Context())\n\t\tswitch event := event.(type) {\n\t\tcase events.APIGatewayProxyRequest:\n\t\t\t// do something\n\t\tcase events.APIGatewayV2HTTPRequest:\n\t\t\t// do something\n\t\tcase events.LambdaFunctionURLRequest:\n\t\t\t// do something\n\t\t}\n\t\t\n\t\tw.WriteHeader(http.StatusOK)\n\t\t_, _ = w.Write([]byte(\"pong\"))\n\t})\n}\n```\n\n### Handle panics\nTo handle panics, first create the handler as described above. You can then wrap the handler to handle panics like so:\n```golang\npackage main\n\nimport (\n\t\"context\"\n\t\"github.com/aws/aws-lambda-go/lambda\"\n\t\"github.com/aws/aws-lambda-go/events\"\n\t\"github.com/its-felix/aws-lambda-go-http-adapter/handler\"\n)\n\nfunc main() {\n\tadapter := [...] // see above\n\th := [...] // see above\n\th = handler.WrapWithRecover(h, func(ctx context.Context, event events.APIGatewayV2HTTPRequest, panicValue any) (events.APIGatewayV2HTTPResponse, error) {\n\t\treturn events.APIGatewayV2HTTPResponse{\n\t\t\tStatusCode:        500,\n\t\t\tHeaders:           make(map[string]string),\n\t\t\tBody:              fmt.Sprintf(\"Unexpected error: %v\", panicValue),\n\t\t}, nil\n\t})\n\t\n\tlambda.Start(h)\n}\n```\n\n## Extending for other lambda event formats:\nHave a look at the existing event handlers:\n- [API Gateway V1](./handler/apigwv1.go)\n- [API Gateway V2](./handler/apigwv2.go)\n- [Lambda Function URL](./handler/functionurl.go)\n\n## Extending for other frameworks\nHave a look at the existing adapters:\n- [net/http](./adapter/vanilla.go)\n- [Echo](./adapter/echo.go)\n- [Fiber](./adapter/fiber.go)\n\n## Build Tags\nYou can opt-in to enable partial build by using the build-tag `lambdahttpadapter.partial`.\n\nOnce this build-tag is present, the following build-tags are available:\n- `lambdahttpadapter.vanilla` (enables the vanilla adapter)\n- `lambdahttpadapter.echo` (enables the echo adapter)\n- `lambdahttpadapter.fiber` (enables the fiber adapter)\n- `lambdahttpadapter.apigwv1` (enables API Gateway V1 handler)\n- `lambdahttpadapter.apigwv2` (enables API Gateway V2 handler)\n- `lambdahttpadapter.functionurl` (enables Lambda Function URL handler)\n- `lambdahttpadapter.alb` (enables Application Load Balancer handler)\n\nAlso note that Lambda Function URL in Streaming-Mode requires the following build-tag to be set:\n- `lambda.norpc`\n\n## Note about Lambda streaming\nResponse streaming is currently not supported for the fiber adapter.\nThe code will work, but the response body will only be sent downstream as soon as the request was processed completely.\n\nThis is because there seems to be no way in `fasthttp` to provide a `io.Writer` to be populated while the request is being processed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fits-felix%2Faws-lambda-go-http-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fits-felix%2Faws-lambda-go-http-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fits-felix%2Faws-lambda-go-http-adapter/lists"}