{"id":18482614,"url":"https://github.com/kdcio/api-gw-req","last_synced_at":"2025-08-24T05:06:04.344Z","repository":{"id":39375628,"uuid":"262245942","full_name":"kdcio/api-gw-req","owner":"kdcio","description":"Parse API Gateway event inside lambda","archived":false,"fork":false,"pushed_at":"2025-05-08T03:21:40.000Z","size":1219,"stargazers_count":2,"open_issues_count":10,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-08T18:37:53.330Z","etag":null,"topics":["api-gateway","aws","kdc","kdcio","lambda","parse"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kdcio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"ianpoogi5","tidelift":null,"community_bridge":null,"liberapay":"ianpogi5","issuehunt":"ianpogi5","otechie":null,"custom":null}},"created_at":"2020-05-08T06:34:27.000Z","updated_at":"2023-03-01T13:44:25.000Z","dependencies_parsed_at":"2025-05-27T01:34:33.190Z","dependency_job_id":"56aec43c-1b38-4ace-9457-0e83499870be","html_url":"https://github.com/kdcio/api-gw-req","commit_stats":null,"previous_names":["kdcsoftware/api-gw-req"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/kdcio/api-gw-req","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Fapi-gw-req","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Fapi-gw-req/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Fapi-gw-req/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Fapi-gw-req/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdcio","download_url":"https://codeload.github.com/kdcio/api-gw-req/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Fapi-gw-req/sbom","scorecard":{"id":553054,"data":{"date":"2025-08-11","repo":{"name":"github.com/kdcio/api-gw-req","commit":"5da07c19d7e6b5823d21a84a8d9e1c83f255fdde"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":3,"reason":"Found 4/13 approved changesets -- score normalized to 3","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":"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":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npmpublish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/npmpublish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/onmerge.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/onmerge.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/onmerge.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/onmerge.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/onmerge.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/onmerge.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/onmerge.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/kdcio/api-gw-req/onmerge.yml/master?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   2 out of   2 npmCommand 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":"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/npmpublish.yml:1","Warn: no topLevel permission defined: .github/workflows/onmerge.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":"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 'master'"],"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 23 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":0,"reason":"29 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"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-20T11:28:30.408Z","repository_id":39375628,"created_at":"2025-08-20T11:28:30.408Z","updated_at":"2025-08-20T11:28:30.408Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271795266,"owners_count":24822682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api-gateway","aws","kdc","kdcio","lambda","parse"],"created_at":"2024-11-06T12:29:21.058Z","updated_at":"2025-08-24T05:06:04.303Z","avatar_url":"https://github.com/kdcio.png","language":"TypeScript","funding_links":["https://ko-fi.com/ianpoogi5","https://liberapay.com/ianpogi5","https://issuehunt.io/r/ianpogi5"],"categories":[],"sub_categories":[],"readme":"# API Gateway Request Parser\n\nThis module will parse the event object (that came from API Gateway) in lambda and create a new object with all unnecessary fields stripped out.\n\n[![ver](https://img.shields.io/npm/v/@kdcio/api-gw-req)](https://www.npmjs.com/package/@kdcio/api-gw-req) [![size](https://badgen.net/bundlephobia/minzip/@kdcio/api-gw-req)](https://bundlephobia.com/result?p=@kdcio/api-gw-req) [![build](https://img.shields.io/github/workflow/status/kdcio/api-gw-req/build)](https://github.com/kdcio/api-gw-req/actions?query=workflow%3Abuild) [![Known Vulnerabilities](https://snyk.io/test/github/kdcio/api-gw-req/badge.svg?targetFile=package.json)](https://snyk.io/test/github/kdcio/api-gw-req?targetFile=package.json) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=kdcio_api-gw-req\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=kdcio_api-gw-req) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=kdcio_api-gw-req\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=kdcio_api-gw-req) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=kdcio_api-gw-req\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=kdcio_api-gw-req) [![license](https://img.shields.io/github/license/kdcio/api-gw-req)](https://github.com/kdcio/api-gw-req/blob/master/LICENSE)\n\n## Install\n\n```bash\nnpm i @kdcio/api-gw-req\n```\n\n## Usage\n\n```js\nimport parser from '@kdcio/api-gw-req';\n\nexport const hello = async (event) =\u003e {\n  const request = parser(event);\n  console.log(request);\n};\n```\n\nSample `event` object:\n\n```json\n{\n  \"body\": null,\n  \"headers\": {\n    \"Host\": \"localhost:8101\",\n    \"Connection\": \"keep-alive\",\n    \"Origin\": \"http://localhost:8100\",\n    \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36\",\n    \"content-type\": \"application/json\",\n    \"Accept\": \"*/*\",\n    \"Sec-Fetch-Site\": \"same-site\",\n    \"Sec-Fetch-Mode\": \"cors\",\n    \"Referrer\": \"http://localhost:8100/\",\n    \"Accept-Encoding\": \"gzip, deflate, br\",\n    \"Accept-Language\": \"en-US,en;q=0.9,th;q=0.8\"\n  },\n  \"httpMethod\": \"GET\",\n  \"multiValueHeaders\": {\n    \"Host\": [\"localhost:8101\"],\n    \"Connection\": [\"keep-alive\"],\n    \"Origin\": [\"http://localhost:8100\"],\n    \"User-Agent\": [\n      \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36\"\n    ],\n    \"content-type\": [\"application/json\"],\n    \"Accept\": [\"*/*\"],\n    \"Sec-Fetch-Site\": [\"same-site\"],\n    \"Sec-Fetch-Mode\": [\"cors\"],\n    \"Referrer\": [\"http://localhost:8100/\"],\n    \"Accept-Encoding\": [\"gzip, deflate, br\"],\n    \"Accept-Language\": [\"en-US,en;q=0.9,th;q=0.8\"]\n  },\n  \"multiValueQueryStringParameters\": null,\n  \"path\": \"/users/me\",\n  \"pathParameters\": { \"proxy\": \"me\" },\n  \"queryStringParameters\": null,\n  \"requestContext\": {\n    \"accountId\": \"offlineContext_accountId\",\n    \"apiId\": \"offlineContext_apiId\",\n    \"httpMethod\": \"GET\",\n    \"identity\": {\n      \"accountId\": \"offlineContext_accountId\",\n      \"apiKey\": \"offlineContext_apiKey\",\n      \"caller\": \"offlineContext_caller\",\n      \"cognitoAuthenticationProvider\": \"offlineContext_cognitoAuthenticationProvider\",\n      \"cognitoAuthenticationType\": \"offlineContext_cognitoAuthenticationType\",\n      \"cognitoIdentityId\": \"offlineContext_cognitoIdentityId\",\n      \"cognitoIdentityPoolId\": \"offlineContext_cognitoIdentityPoolId\",\n      \"sourceIp\": \"127.0.0.1\",\n      \"user\": \"offlineContext_user\",\n      \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36\",\n      \"userArn\": \"offlineContext_userArn\"\n    },\n    \"protocol\": \"HTTP/1.1\",\n    \"requestId\": \"offlineContext_requestId_ck38asmqx000d26necwg8eki4\",\n    \"requestTimeEpoch\": 1574315489802,\n    \"resourceId\": \"offlineContext_resourceId\",\n    \"resourcePath\": \"/users/{proxy*}\",\n    \"stage\": \"local\"\n  },\n  \"resource\": \"/users/{proxy*}\",\n  \"stageVariables\": null,\n  \"isOffline\": true\n}\n```\n\nParsed object of the above event:\n\n```json\n{\n  \"path\": \"/users/me\",\n  \"method\": \"GET\",\n  \"query\": {},\n  \"headers\": {\n    \"host\": \"localhost:8101\",\n    \"connection\": \"keep-alive\",\n    \"origin\": \"http://localhost:8100\",\n    \"user-agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36\",\n    \"content-type\": \"application/json\",\n    \"accept\": \"*/*\",\n    \"sec-fetch-site\": \"same-site\",\n    \"sec-fetch-mode\": \"cors\",\n    \"referrer\": \"http://localhost:8100/\",\n    \"accept-encoding\": \"gzip, deflate, br\",\n    \"accept-language\": \"en-US,en;q=0.9,th;q=0.8\"\n  },\n  \"ip\": \"127.0.0.1\",\n  \"userAgent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36\",\n  \"params\": { \"proxy\": \"me\" },\n  \"body\": {},\n  \"authorizer\": {},\n  \"stage\": \"local\"\n}\n```\n\n## Parsed Object\n\n| Field Name | Type   | Description                                     |\n| ---------- | ------ | ----------------------------------------------- |\n| path       | string | Path of the query                               |\n| query      | object | Query string object                             |\n| headers    | object | HTTP headers                                    |\n| ip         | string | IP Address of the client                        |\n| userAgent  | string | User Agent of the http client                   |\n| params     | object | Path parameters if defined in API Gateway       |\n| body       | object | Body parsed as json or as urlencoded form data. |\n| authorizer | object | Authorizer object                               |\n| stage      | string | Deployment stage                                |\n\n## See also\n\n[@kdcio/api-gw-resp](https://github.com/kdcio/api-gw-resp)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdcio%2Fapi-gw-req","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdcio%2Fapi-gw-req","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdcio%2Fapi-gw-req/lists"}