-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructue catalog code to allow flat catalog return
- Loading branch information
Showing
12 changed files
with
489 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
lib/trento/application/integration/checks/models/flat_catalog.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Trento.Integration.Checks.Models.FlatCatalog do | ||
@moduledoc """ | ||
Flat checks catalog | ||
""" | ||
|
||
@required_fields [ | ||
:checks | ||
] | ||
|
||
use Trento.Type | ||
|
||
alias Trento.Integration.Checks.Models.FlatCheck | ||
|
||
deftype do | ||
embeds_many :checks, FlatCheck | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
lib/trento/application/integration/checks/models/flat_check.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
defmodule Trento.Integration.Checks.Models.FlatCheck do | ||
@moduledoc """ | ||
Flat catalog check | ||
""" | ||
|
||
@required_fields [ | ||
:id, | ||
:provider, | ||
:group, | ||
:name, | ||
:description, | ||
:remediation, | ||
:implementation, | ||
:labels | ||
] | ||
|
||
use Trento.Type | ||
|
||
deftype do | ||
field :id, :string | ||
field :provider, Ecto.Enum, values: [:azure, :aws, :gcp, :dev, :unknown] | ||
field :group, :string | ||
field :name, :string | ||
field :description, :string | ||
field :remediation, :string | ||
field :implementation, :string | ||
field :labels, :string | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.