Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions pkg/merger/merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,6 @@ func MergeConfigFiles(
}
}

if extraConfig.Integrations.AWS != nil {
if config.Integrations.AWS == nil {
config.Integrations.AWS = extraConfig.Integrations.AWS
} else {
config.Integrations.AWS.Enable = extraConfig.Integrations.AWS.Enable

config.Integrations.AWS.RoleNameToAssume = extraConfig.Integrations.AWS.RoleNameToAssume
config.Integrations.AWS.PrimaryAccountID = extraConfig.Integrations.AWS.PrimaryAccountID
config.Integrations.AWS.PrimaryRegion = extraConfig.Integrations.AWS.PrimaryRegion

if extraConfig.Integrations.AWS.PrimaryRegion != "" {
config.Integrations.AWS.PrimaryRegion = extraConfig.Integrations.AWS.PrimaryRegion
}
if extraConfig.Integrations.AWS.TargetRegions != nil {
config.Integrations.AWS.TargetRegions = extraConfig.Integrations.AWS.TargetRegions
}
if extraConfig.Integrations.AWS.TargetAccounts != nil {
config.Integrations.AWS.TargetAccounts = extraConfig.Integrations.AWS.TargetAccounts
}
}
}

if len(extraConfig.IgnoreDirs) > 0 {
config.IgnoreDirs = extraConfig.IgnoreDirs
}
Expand Down
50 changes: 0 additions & 50 deletions pkg/merger/merger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,6 @@ func TestMergeConfigFiles(t *testing.T) {
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
},
AWS: &models.AWS{
Enable: true,
RoleNameToAssume: "nullify-role",
PrimaryAccountID: "123456789012",
PrimaryRegion: "ap-southeast-2",
TargetRegions: &[]string{"ap-southeast-2", "us-east-2"},
TargetAccounts: &[]string{"123456789012", "123456789013"},
},
},
},
expected: &models.Configuration{
Expand Down Expand Up @@ -148,14 +140,6 @@ func TestMergeConfigFiles(t *testing.T) {
SeverityThreshold: models.SeverityHigh,
PriorityThreshold: models.PriorityImportant,
},
AWS: &models.AWS{
Enable: true,
RoleNameToAssume: "nullify-role",
PrimaryAccountID: "123456789012",
PrimaryRegion: "ap-southeast-2",
TargetRegions: &[]string{"ap-southeast-2", "us-east-2"},
TargetAccounts: &[]string{"123456789012", "123456789013"},
},
},
},
},
Expand Down Expand Up @@ -220,14 +204,6 @@ func TestMergeConfigFiles(t *testing.T) {
Low: "low",
},
},
AWS: &models.AWS{
Enable: true,
RoleNameToAssume: "nullify-role",
PrimaryAccountID: "123456789012",
PrimaryRegion: "ap-southeast-2",
TargetRegions: &[]string{"ap-southeast-2", "us-east-2"},
TargetAccounts: &[]string{"123456789012", "123456789013"},
},
},
},
repoConfig: nil,
Expand Down Expand Up @@ -293,14 +269,6 @@ func TestMergeConfigFiles(t *testing.T) {
Low: "low",
},
},
AWS: &models.AWS{
Enable: true,
RoleNameToAssume: "nullify-role",
PrimaryAccountID: "123456789012",
PrimaryRegion: "ap-southeast-2",
TargetRegions: &[]string{"ap-southeast-2", "us-east-2"},
TargetAccounts: &[]string{"123456789012", "123456789013"},
},
},
},
},
Expand Down Expand Up @@ -454,24 +422,6 @@ func TestMergeConfigFiles(t *testing.T) {
},
},
},
{
name: "attack surface with AWS integration merge",
globalConfig: &models.Configuration{
AttackSurface: &models.AttackSurface{
Enable: true,
},
},
repoConfig: nil,
expected: &models.Configuration{
EnablePullRequestReviews: models.Bool(true),
EnableIssueDashboards: models.Bool(true),
SeverityThreshold: parser.DefaultSeverityThreshold,
PriorityThreshold: parser.DefaultPriorityThreshold,
AttackSurface: &models.AttackSurface{
Enable: true,
},
},
},
} {
t.Run(scenario.name, func(t *testing.T) {
config := MergeConfigFiles(parser.NewDefaultConfig(), scenario.globalConfig, scenario.repoConfig)
Expand Down
10 changes: 0 additions & 10 deletions pkg/models/integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package models

type Integrations struct {
Jira *Jira `yaml:"jira,omitempty"`
AWS *AWS `yaml:"aws,omitempty"`
}

type Jira struct {
Expand Down Expand Up @@ -32,12 +31,3 @@ type Assignee struct {
Name string `yaml:"name,omitempty"`
ID string `yaml:"id,omitempty"`
}

type AWS struct {
Enable bool `yaml:"enable"`
RoleNameToAssume string `yaml:"role_name_to_assume"`
PrimaryAccountID string `yaml:"primary_account_id"`
PrimaryRegion string `yaml:"primary_region"`
TargetRegions *[]string `yaml:"target_regions,omitempty"`
TargetAccounts *[]string `yaml:"target_accounts,omitempty"`
}
8 changes: 0 additions & 8 deletions tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ func TestIntegration(t *testing.T) {
PriorityThreshold: models.PriorityImportant,
OnFixTransition: "Done",
},
AWS: &models.AWS{
Enable: true,
RoleNameToAssume: "nullify-role",
PrimaryAccountID: "123456789012",
PrimaryRegion: "ap-southeast-2",
TargetRegions: &[]string{"ap-southeast-2", "us-east-2"},
TargetAccounts: &[]string{"123456789012", "123456789013"},
},
},
AttackSurface: &models.AttackSurface{
Enable: true,
Expand Down
Loading