Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-api-gateway-policy-generator

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-api-gateway-policy-generator

Generates an AWS policy document based on a given set of claims.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-47.37%
Maintainers
2
Weekly downloads
 
Created
Source

AWS-API-Gateway-Policy-Generator

It is a simple tool that can be used with a custom authorizer to generate policy documents. You have to feed a dictionary of policy statements keyed by unique names (called claims). When a set of claims are fed to the generator, it in turn generates a policy document by attaching policy statements linked with the claims.

The Policy statements in the policy map are standard Amazon policy documents.

Sample Policy Map


const policyMap = {
    'CreateUser': [
        {'Resource': 'test resource'},
        {'Resource': 'denied resource', 'Effect': 'deny'},
        {'Resource': 'another resource', 'Action': 'execute-api:Invoke'}
    ],
    'UpdateUser': [
        {'Resource': 'some other resource'}
    ]
};

Installation

npm install aws-api-gateway-policy-generator --save

Usage


const policyMap = {
    'CreateUser': [
        {'Resource': 'test resource'},
        {'Resource': 'denied resource', 'Effect': 'deny'},
        {'Resource': 'another resource', 'Action': 'execute-api:Invoke'}
    ],
    'UpdateUser': [
        {'Resource': 'some other resource'}
    ]
};

const generator = new PolicyGenerator(policyMap);

const claims = ['CreateUser', 'SomeOther'];
const document = generator.generatePolicyDocument(claims);

Refer the demo/ directory for a complete implementation.

Contributing

Keywords

FAQs

Package last updated on 19 Dec 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc