Skip to content

Commit

Permalink
Add forgotten check
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevhen Zavhorodnii committed Jun 7, 2024
1 parent fe30b98 commit b7492b2
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions pkg/types/trust_boundary.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,6 @@ type TrustBoundary struct {
TrustBoundariesNested []string `json:"trust_boundaries_nested,omitempty" yaml:"trust_boundaries_nested,omitempty"`
}

func (what TrustBoundary) RecursivelyAllTechnicalAssetIDsInside(model *Model) []string {
result := make([]string, 0)
what.addAssetIDsRecursively(model, &result)
return result
}

func (what TrustBoundary) IsTaggedWithAny(tags ...string) bool {
return containsCaseInsensitiveAny(what.Tags, tags...)
}

func (what TrustBoundary) AllParentTrustBoundaryIDs(model *Model) []string {
result := make([]string, 0)
what.addTrustBoundaryIDsRecursively(model, &result)
return result
}

func (what TrustBoundary) addAssetIDsRecursively(model *Model, result *[]string) {
*result = append(*result, what.TechnicalAssetsInside...)
for _, nestedBoundaryID := range what.TrustBoundariesNested {
model.TrustBoundaries[nestedBoundaryID].addAssetIDsRecursively(model, result)
}
}

func (what TrustBoundary) addTrustBoundaryIDsRecursively(model *Model, result *[]string) {
*result = append(*result, what.Id)
parent := model.FindParentTrustBoundary(&what)
if parent != nil {
parent.addTrustBoundaryIDsRecursively(model, result)
}
}

0 comments on commit b7492b2

Please sign in to comment.