parse-community / parse-server-s3-adapter

AWS S3 file storage adapter for Parse Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use AWS SDK & CLI standard configuration

acinader opened this issue · comments

Currently the adapter requires that a key and secret be provided either by an option or a env var.

The AWS SDK & CLI can be configured using a standard protocol for obtaining credentials (http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#config-settings-and-precedence).

Using the default protocol makes it easy to securely handle AWS credentials and eases configuration overhead. Most importantly, using the standard provider would allow the s3 adapter to follow the AWS recommendation (http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#use-roles-with-ec2) to use ec2 roles to provide credentials.

The adapter both requires explicitly setting credentials and uses non-standard env var names.

I'm proposing to make the AWS security credentials optional instead of required and changing the read me to indicate that the adapter will attempt to pickup credentials from the standard locations if not explicitly provided.

In the event that a connection to s3 is attempted without credentials being found, the aws-sdk will provide a sane error like:

message: 'Could not load credentials from any providers',
     code: 'CredentialsError',
     time: 2016-07-25T15:29:07.566Z,

I'm cooking up the change for this.