athens icon indicating copy to clipboard operation
athens copied to clipboard

Add support for aws credentials file

Open t-tomalak opened this issue 8 years ago • 5 comments

Is your feature request related to a problem? Please describe. Some users when running Athens with S3 storage want to use aws default configuration aka .aws/credentials. Unfortunately we can't omit validation of our storage parameters from configuration file (or could we in that case?)

Describe the solution you'd like

  1. We can drop required flag on every parameter of S3config and check config inside New method in storage/s3.
  2. We can create alternative s3 storage which will don't require any configuration(what name should it have?), also we will add seperate New method inside S3 storage for that.

Describe alternatives you've considered We could also move this credentials as we do with .netrc and .hgrc files https://github.com/gomods/athens/issues/716

Additional context https://gophers.slack.com/archives/C9LRAQN8N/p1541454892427000

t-tomalak avatar Nov 08 '18 18:11 t-tomalak

I'd like to work on this.

markopotamus avatar Dec 19 '18 22:12 markopotamus

Do you just want access to the default profile in the credentials file, or do you want to be able to specify any profile? And since we're consuming the credentials file, would you like to try to grab the region from the ~/.aws/config file?

markopotamus avatar Dec 19 '18 22:12 markopotamus

Hi @markopotamus Welcome!

What do you think of this flow:

If the proper env vars are not defined, then look for the default to start off with.

We need to think about the order of env var, profile, default (the easiest understandable format)

Until then, let us just go with the default unless you have worked with any of these and have an idea on how to proceed with it.

manugupt1 avatar Dec 20 '18 02:12 manugupt1

I'll prefer the access key id and secret access key if they're specified in the S3 config. I'll add an optional profile field to the config (it maps to the AWS_PROFILE env var). If it's left blank, I'll use the default profile. I'll need to add the profile to the storage configuration documentation too.

markopotamus avatar Dec 20 '18 16:12 markopotamus

Let us not have profile for now please. Too many options for the user, imo.

manugupt1 avatar Dec 21 '18 04:12 manugupt1