{"id":18482615,"url":"https://github.com/kdcio/aws-policy","last_synced_at":"2026-05-09T16:19:21.366Z","repository":{"id":49951878,"uuid":"264875107","full_name":"kdcio/aws-policy","owner":"kdcio","description":"This package will generate AWS auth policy for API Gateway lambda authorizer.","archived":false,"fork":false,"pushed_at":"2025-05-13T08:22:53.000Z","size":1237,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-13T09:32:00.082Z","etag":null,"topics":["api","api-gateway","authentication","authorizer","aws","hacktoberfest","lambda","policy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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-18T08:23:04.000Z","updated_at":"2021-06-07T01:57:40.000Z","dependencies_parsed_at":"2025-05-13T09:27:04.776Z","dependency_job_id":"304f4d5b-c815-48f0-be25-a5051b782788","html_url":"https://github.com/kdcio/aws-policy","commit_stats":null,"previous_names":["kdcsoftware/aws-policy"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Faws-policy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Faws-policy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Faws-policy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdcio%2Faws-policy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdcio","download_url":"https://codeload.github.com/kdcio/aws-policy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253917103,"owners_count":21983994,"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","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","api-gateway","authentication","authorizer","aws","hacktoberfest","lambda","policy"],"created_at":"2024-11-06T12:29:21.285Z","updated_at":"2025-10-20T00:33:25.171Z","avatar_url":"https://github.com/kdcio.png","language":"JavaScript","funding_links":["https://ko-fi.com/ianpoogi5","https://liberapay.com/ianpogi5","https://issuehunt.io/r/ianpogi5"],"categories":[],"sub_categories":[],"readme":"# AWS Policy Generator\n\nThis package will generate AWS auth policy for [API Gateway lambda authorizer](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-use-lambda-authorizer.html).\n\n[![ver](https://img.shields.io/npm/v/@kdcio/aws-policy)](https://www.npmjs.com/package/@kdcio/aws-policy) [![size](https://badgen.net/bundlephobia/minzip/@kdcio/aws-policy)](https://bundlephobia.com/result?p=@kdcio/aws-policy) [![build](https://img.shields.io/github/workflow/status/kdcio/aws-policy/build)](https://github.com/kdcio/aws-policy/actions?query=workflow%3Abuild) [![Known Vulnerabilities](https://snyk.io/test/github/kdcio/aws-policy/badge.svg?targetFile=package.json)](https://snyk.io/test/github/kdcio/aws-policy?targetFile=package.json) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=kdcio_aws-policy\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=kdcio_aws-policy) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=kdcio_aws-policy\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=kdcio_aws-policy) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=kdcio_aws-policy\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=kdcio_aws-policy) [![license](https://img.shields.io/github/license/kdcio/aws-policy)](https://github.com/kdcio/aws-policy/blob/master/LICENSE)\n\n## Install\n\n```terminal\nnpm i @kdcio/aws-policy\n```\n\n## Usage\n\n```javascript\nimport generatePolicy from '@kdcio/aws-policy';\n\nexport const handler = (event) =\u003e {\n  const user = {\n    name: 'Ian',\n    username: 'ian',\n    role: 'admin',\n  };\n  const resources = [\n    'GET/users',\n    'POST/users',\n    'GET/users/*',\n    'PUT/users/*',\n    'DELETE/users/*',\n  ];\n\n  return generatePolicy({\n    context: { ...user },\n    principalId: user.username,\n    effect: 'Allow',\n    methodArn: event.methodArn,\n    resources,\n  });\n};\n```\n\n## Further Reading\n\n[Output from an Amazon API Gateway Lambda authorizer](https://docs.aws.amazon.com/en_pv/apigateway/latest/developerguide/api-gateway-lambda-authorizer-output.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdcio%2Faws-policy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdcio%2Faws-policy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdcio%2Faws-policy/lists"}