npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-avp

v0.1.3

Published

Serverless Framework plugin for dealing with Amazon Verified Permissions

Downloads

7

Readme

Serverless AVP Plugin

The Serverless AVP Plugin is a tool designed to integrate AWS Verified Permissions (AVP) with the Serverless Framework. It provides commands to manage policy stores and policies, enabling developers to leverage the power of AVP within their Serverless applications.

Please note that this plugin is currently in an early stage of development and is intended for learning purposes and quick deployments, not for production use. I am actively working on improving and expanding its functionalities.

Installation

To install the Serverless AVP Plugin, you can use npm:

npm install serverless-avp

Then, in your serverless.yml file, add the plugin:

plugins:
  - serverless-avp

Configuration

The Serverless AVP Plugin uses the custom section of the serverless.yml file for configuration. Here's an example:

custom:
  avp:
    validationMode: STRICT
    schemaPath: ./schema.json
    policyPath: ./policy.txt
    policyStoreId: your-policy-store-id

Usage

The Serverless AVP Plugin provides several commands for managing your policy store and policies.

First usage

For a first usage we need to create a policy stores, which acts as a container for a policies. The custom avp configuration should looks like that:

custom:
  avp:
    validationMode: STRICT

Then use below instruction to create a policy store.

Policy Store

To create a policy store:

sls createPolicyStore

After creating a policy store, copy the generated policy store ID and add it to the policyStoreId field in the custom.avp section of your serverless.yml file. Right now AVP does not support naming of the policy stores, so it's autogenerated. Soon it should be fixed.

After it, your custom avp configuration should look like:

custom:
  avp:
    validationMode: STRICT
    policyStoreId: your-policy-store-id

To delete a policy store:

sls deletePolicyStore

Make sure that policyStoreId is within the custom avp configuration.

Schema

To add a schema to your policy store:

sls putSchema

Make sure that your configuration looks like this:

custom:
  avp:
    validationMode: STRICT
    schemaPath: ./schema.json
    policyStoreId: your-policy-store-id

The schema needs to be provided in json format.

Policy

To create a static policy:

sls createStaticPolicy

Make sure that the policy is within the .txt extension written in Cedar. The command will parse it to string to send to AVP.

custom:
  avp:
    validationMode: STRICT
    schemaPath: ./schema.json
    policyPath: ./policy.txt
    policyStoreId: your-policy-store-id

Next steps

  • Implement commands to create (multiple policies) update, and delete policies.
  • Implement CLI to use some prepared examples to be immediately used and deployed to AWS to play around with them.
  • Add support for policy templates.
  • Implement a command to list all policies in the policy store.
  • Implement a command to get a schema.
  • Add tests.
  • Implement a command to make an authorization request against the policy store.
  • Make possibility to pass arguments via CLI.
  • ...