drone-plugins / drone-s3

Drone plugin for publishing artifacts to Amazon S3
http://plugins.drone.io/drone-plugins/drone-s3
Apache License 2.0
36 stars 64 forks source link

Remove skipping if access_key/secret_key are empty #12

Closed mjschultz closed 6 years ago

mjschultz commented 8 years ago

Projects should be careful about what they try to upload and use the more generic when: repo: owner/name method instead.

Closes: https://github.com/drone-plugins/drone-s3/issues/11

tboerger commented 8 years ago

IMHO there must be some validation that it's working with the IAM role OR key and secret.

mjschultz commented 8 years ago

Do you mean a parameter that explicitly says "use the IAM role"? That is you'd have to provide either (access_key+secret_key) OR (use_iam: true)?

mjschultz commented 8 years ago

I've added the logic to verify that the .drone.yml includes either the (access_key and secret_key) or a use_iam flag.

If none are specified it will print a message stating that some must be specified (will not cause a build failure).

If all are specified it treats that as ambiguous, and exits the plugin with a status of 1 (causing a build failure).

mjschultz commented 8 years ago

@tboerger @bradrydzewski any feedback/clarifications?

nlf commented 8 years ago

lgtm

i think this is a reasonable solution, i do think you should update the docs to make sure it's very clear that use_iam cannot be used with the access_key/secret_key pair though

tboerger commented 8 years ago

We should follow https://github.com/drone-plugins/drone-ecr/pull/16#issuecomment-226696026

tboerger commented 8 years ago

https://github.com/drone-plugins/drone-s3/pull/19 is also an interesting discussion.

josmo commented 8 years ago

with .5 it's moved to using the verified yml for using instance roles. #20 is pulled into the latest. Not sure if we should close this PR unless it's for .4 only?

denizs commented 6 years ago

+1

tboerger commented 6 years ago

This can be closed, the plugin already uses the default authentication (IAM) if no key and secret is defined: https://github.com/drone-plugins/drone-s3/blob/master/plugin.go#L95-L99