Giter Club home page Giter Club logo

aws-s3-access-control's Introduction

ipm package: aws-s3-access-control

Overview

Provide role-based authorization for AWS S3. This package helps user to get contents of a file on S3 using the filename. It assumes the user enters the corresponding {fileName, url} tuple in the collection.

This is an ipm package, which contains one or more reusable assets within the ipm Community. The 'package.json' in this repo is a ipm spec's package.json, here, which is a superset of npm's package.json spec, here.

Browse ipm Packages

Setup

- Out of the Box

This package contains an example S3 Object to fetch, and can be run upon a fresh install. Run AWSS3ExampleFetchAsset

- Integration with Developer's S3 Buckets

  1. Create account: https://aws.amazon.com/documentation/s3/
  2. Upload objects to provide access control upon
  3. Place URLs in aws_s3_resources collection
  4. Can fetch file contents via the FetchS3Object code service

Usage

The AWSS3Lib provides user with a method to get contents of file using the filename. It does so under the assumption that the file name exists in the collection with a valid Url.

To test call AWSS3ExampleFetchAsset with relevant parameters as an Authenticated User.

Assets

Code Services

  • AWSS3ExampleFetchAsset - Fetch the contents of an access-controlled AWSS3 Resource.

Note: Make sure to initialize ClearBlade Object, before calling the Library methods. i.e. ClearBlade.init({request:req});

Code Libraries

  • AWSS3Lib - This library provides a method to get file contents from AWSS3 using a filename. It internally uses a collection to get s3 url for corresponding filename. Note: User needs to add a new file entry in the collections before trying to access it.

Collections

  • s3_resources - Stores key/value pairs of filenames and their respective URLs in AWSS3

API

Typedefs

AWSS3 : Object

AWS S3 is a file Manager Service Software

callback : function

This callback is displayed as part of sgEmail.

AWSS3 : Object

AWS S3 is a file Manager Service Software

Kind: global typedef

Param Type
collectionName string

Example

var s3 = AWSS3(collectionName);

AWSS3.GetFile : Object

Kind: static typedef of AWSS3

Param Type
fileName string
callback callback

Example

var s3 = AWSS3(collectionName);
ClearBlade.init({request:req});
s3.GetFile(fileName, function(err, resp){
    if(err ){
      resp.error("Failed to GET File from AWSS3: " + JSON.stringify(err));
    }
    resp.success(data);          
}

callback : function

This callback is displayed as part of sgEmail.

Kind: global typedef

Param Type
err Object
resp Object

aws-s3-access-control's People

Contributors

rreinold avatar

Watchers

 avatar

Forkers

clearblade

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.