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

bragg-s3

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bragg-s3

bragg middleware for s3 triggers

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bragg-s3 Build Status

bragg middleware to process s3 triggers

Install

$ npm install bragg-s3

Routing

The routing is decided based on the event type

Event nameMethod
ObjectCreated:*post
ObjectCreated:Putpost
ObjectCreated:Postpost
ObjectCreated:Copypost
ObjectCreated:CompleteMultipartUploadpost
ObjectRemoved:*delete
ObjectRemoved:Deletedelete
ObjectRemoved:DeleteMarkerCreateddelete
ObjectRestore:Postpost
ObjectRestore:Completedpost
ReducedRedundancyLostObjectpost

Usage

const app = require('bragg')();
const router = require('bragg-router')();
const s3 = require('bragg-s3');

// Listen for events in the `TopicName` topic
router.post('s3:triggerName', ctx => {
    ctx.body = ctx.request.body; // [{bucket: 'someBucket', key: 'foo.jpg', eventName: 'ObjectCreated:Put'}]
});

app.use(s3());
app.use(router.routes());

exports.handler = app.listen();

The s3: prefix is added before the name of the S3 trigger. The bucket, key and eventName are provided in the body of the request object. Routing is decided by the configurationId provided in the request. This can be a UUID when the trigger is created using AWS CloudFormation.

API

braggS3()

Add the bragg S3 middleware to the middleware pipeline.

License

MIT © Simon

FAQs

Package last updated on 06 Mar 2019

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