mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:15:25 +00:00
feat(validateMissingS3Options): condition optimisation
This commit is contained in:
parent
e35c6049bb
commit
328013667b
@ -236,19 +236,23 @@ func validateMissingS3Options(options *types.Options) []string {
|
|||||||
missing = append(missing, "AWS_TEMPLATE_BUCKET")
|
missing = append(missing, "AWS_TEMPLATE_BUCKET")
|
||||||
}
|
}
|
||||||
if options.AwsProfile == "" {
|
if options.AwsProfile == "" {
|
||||||
|
var missingCreds []string
|
||||||
if options.AwsAccessKey == "" {
|
if options.AwsAccessKey == "" {
|
||||||
missing = append(missing, "AWS_ACCESS_KEY")
|
missingCreds = append(missingCreds, "AWS_ACCESS_KEY")
|
||||||
}
|
}
|
||||||
if options.AwsSecretKey == "" {
|
if options.AwsSecretKey == "" {
|
||||||
missing = append(missing, "AWS_SECRET_KEY")
|
missingCreds = append(missingCreds, "AWS_SECRET_KEY")
|
||||||
}
|
}
|
||||||
if options.AwsRegion == "" {
|
if options.AwsRegion == "" {
|
||||||
missing = append(missing, "AWS_REGION")
|
missingCreds = append(missingCreds, "AWS_REGION")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (options.AwsAccessKey == "" || options.AwsSecretKey == "" || options.AwsRegion == "") && options.AwsProfile == "" {
|
missing = append(missing, missingCreds...)
|
||||||
|
|
||||||
|
if len(missingCreds) > 0 {
|
||||||
missing = append(missing, "AWS_PROFILE")
|
missing = append(missing, "AWS_PROFILE")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return missing
|
return missing
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user