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