Skip to content

Commit 205c76b

Browse files
Fernando Barbosafernandrone
authored andcommitted
Remove deprecated signed yaml verification
As of Drone 0.7 the signed yaml verification is deprecated, so we shouldn't need to check for it when using IAM roles.
1 parent 9daf886 commit 205c76b

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

main.go

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ func main() {
8686
Usage: "use path style for bucket paths",
8787
EnvVar: "PLUGIN_PATH_STYLE",
8888
},
89-
cli.BoolTFlag{
90-
Name: "yaml-verified",
91-
Usage: "Ensure the yaml was signed",
92-
EnvVar: "DRONE_YAML_VERIFIED",
93-
},
9489
cli.StringFlag{
9590
Name: "env-file",
9691
Usage: "source env file",
@@ -108,20 +103,19 @@ func run(c *cli.Context) error {
108103
}
109104

110105
plugin := Plugin{
111-
Endpoint: c.String("endpoint"),
112-
Key: c.String("access-key"),
113-
Secret: c.String("secret-key"),
114-
Bucket: c.String("bucket"),
115-
Region: c.String("region"),
116-
Access: c.String("acl"),
117-
Source: c.String("source"),
118-
Target: c.String("target"),
119-
StripPrefix: c.String("strip-prefix"),
120-
Exclude: c.StringSlice("exclude"),
121-
Encryption: c.String("encryption"),
122-
PathStyle: c.Bool("path-style"),
123-
DryRun: c.Bool("dry-run"),
124-
YamlVerified: c.BoolT("yaml-verified"),
106+
Endpoint: c.String("endpoint"),
107+
Key: c.String("access-key"),
108+
Secret: c.String("secret-key"),
109+
Bucket: c.String("bucket"),
110+
Region: c.String("region"),
111+
Access: c.String("acl"),
112+
Source: c.String("source"),
113+
Target: c.String("target"),
114+
StripPrefix: c.String("strip-prefix"),
115+
Exclude: c.StringSlice("exclude"),
116+
Encryption: c.String("encryption"),
117+
PathStyle: c.Bool("path-style"),
118+
DryRun: c.Bool("dry-run"),
125119
}
126120

127121
return plugin.Exec()

plugin.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"path/filepath"
77
"strings"
88

9-
"errors"
109
log "github.com/Sirupsen/logrus"
1110
"github.com/aws/aws-sdk-go/aws"
1211
"github.com/aws/aws-sdk-go/aws/credentials"
@@ -63,8 +62,6 @@ type Plugin struct {
6362
// Strip the prefix from the target path
6463
StripPrefix string
6564

66-
YamlVerified bool
67-
6865
// Exclude files matching this pattern.
6966
Exclude []string
7067

@@ -91,12 +88,12 @@ func (p *Plugin) Exec() error {
9188
S3ForcePathStyle: aws.Bool(p.PathStyle),
9289
}
9390

94-
//Allowing to use the instance role or provide a key and secret
9591
if p.Key != "" && p.Secret != "" {
9692
conf.Credentials = credentials.NewStaticCredentials(p.Key, p.Secret, "")
97-
} else if p.YamlVerified != true {
98-
return errors.New("Security issue: When using instance role you must have the yaml verified")
93+
} else {
94+
log.Warn("AWS Key and/or Secret not provided (falling back to ec2 instance profile)")
9995
}
96+
10097
client := s3.New(session.New(), conf)
10198

10299
// find the bucket

0 commit comments

Comments
 (0)