Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.
/ asset-s3 Public archive

AWS S3 backend for the travetto asset module

Notifications You must be signed in to change notification settings

travetto/asset-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

travetto: Asset-S3

This provides an s3 implementation of the AssetSource that which is a backend for the Asset module.

The primary utilization of this module, is to configure the AssetSource injectable, and provide whatever configuration you would like to use.

class AppConfig {
  @InjectableFactory()
  static getConf(): AssetS3Config {
    return new AssetS3Config();
  }
  @InjectableFactory()
  static getSource(cfg: AssetS3Config): AssetSource {
    return new AssetS3Source(cfg);
  }
}

As seen, there is a default configuration that you can easily use, with some sensible defaults.

The default configuration class looks like:

@Config('asset.s3')
export class AssetS3Config {
  region = 'us-east-1';
  base = '';

  accessKeyId = '';
  secretAccessKey = '';

  bucket = '';

  config: aws.S3.ClientConfiguration;
  ...
}

NOTE Do not commit your accessKeyId or secretAccessKey values to your source repository, especially if it is public facing. Not only is it a security risk, but Amazon will scan public repos, looking for keys, and if found will react swiftly.

Additionally, you can see that the class is registered with the @Config decorator, and so these values can be overridden using the standardConfiguration resolution paths.

About

AWS S3 backend for the travetto asset module

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published