Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Add implementation structs to oscalkit (#23)
Browse files Browse the repository at this point in the history
* Add implementation struct

* Fix package name

* remove paranthesis
  • Loading branch information
minhaj10p authored and anweiss committed Dec 19, 2018
1 parent 25e3d97 commit 8ce8313
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion generator/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func TestSubControlsMapping(t *testing.T) {
},
}

c := (CreateCatalogsFromProfile(&profile))
c := CreateCatalogsFromProfile(&profile)
if c[0].Groups[0].Controls[1].Subcontrols[0].Id != "ac-2.1" {
t.Errorf("does not contain ac-2.1 in subcontrols")
}
Expand Down
90 changes: 90 additions & 0 deletions types/oscal/implementation/implementation.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package implementation

type ComponentDefinition struct {
ID string `xml:"id,attr,omitempty" json:"id"`
Name string `xml:"name,attr,omitempty" json:"name,omitempty"`
ComponentType string `xml:"component-type,attr,omitempty" json:"componentType,omitempty"`
Version string `xml:"version,attr,omitempty" json:"version,omitempty"`
ComponentConfigurations []*ComponentConfiguration `xml:"component-configurations,attr,omitempty" json:"componentConfigurations,omitempty"`
ImplementsProfiles []*ImplementsProfile `xml:"implements-profile,attr,omitempty" json:"implementsProfiles,omitempty"`
ControlImplementations []*ControlImplementation `xml:"control-implementations,attr,omitempty" json:"controlImplementations,omitempty"`
Relationships []*Relationship `xml:"relationships,attr,omitempty" json:"relationships,omitempty"`
}
type Mechanism struct {
ID string `xml:"id,attr,omitempty" json:"id"`
Type string `xml:"type,attr,omitempty" json:"type"`
Data string `xml:"data,attr,omitempty" json:"data"`
}

type Label struct {
AdminSetting string `xml:"admin-setting,attr,omitempty" json:"adminSetting"`
}

type ConfigurableValue struct {
ValueID string `xml:"value-id,attr,omitempty" json:"valueId"`
Value int `xml:"value,attr,omitempty" json:"value"`
}

type ComponentConfiguration struct {
ID string `xml:"id,attr,omitempty" json:"id"`
Labels Label `xml:"labels,attr,omitempty" json:"labels"`
Name string `xml:"name,attr,omitempty" json:"name"`
Description string `xml:"description,attr,omitempty" json:"description"`
ProvisioningMechanisms []Mechanism `xml:"provision-mechanisms,attr,omitempty" json:"provisioningMechanisms"`
ValidationMechanisms []Mechanism `xml:"validation-mechanisms,attr,omitempty" json:"validationMechanisms"`
ConfigurableValues []ConfigurableValue `xml:"configurable-values,attr,omitempty" json:"configurableValues"`
}

type Parameter struct {
ParameterID string `xml:"parameter-id,attr,omitempty" json:"parameterId"`
ValueID string `xml:"value-id,attr,omitempty" json:"valueId"`
Value string `xml:"value,attr,omitempty" json:"value"`
Guidance string `xml:"guidance,attr,omitempty" json:"guidance"`
}

type ImplementsProfile struct {
ProfileID string `xml:"profile-id,attr,omitempty" json:"profileId"`
ControlConfigurations []ControlConfiguration `xml:"control-configurations,attr,omitempty" json:"controlConfigurations"`
}

type ControlConfiguration struct {
ConfigurationIDRef string `xml:"configuration-id-ref,attr,omitempty" json:"configurationIdRef"`
Parameters []Parameter `xml:"parameters,attr,omitempty" json:"parameters"`
}

type ControlId struct {
CatalogIDRef string `xml:"control-id-ref,attr,omitempty" json:"catalogIdRef,omitempty"`
ControlID string `xml:"control-id,attr,omitempty" json:"controlId,omitempty"`
ItemID string `xml:"item-id,attr,omitempty" json:"itemId,omitempty"`
}

type Relationship struct {
IDRef string `xml:"id-ref,attr,omitempty" json:"idRef"`
Type string `xml:"type,attr,omitempty" json:"type"`
Cardinality string `xml:"cadinality,attr,omitempty" json:"cardinality"`
}

type ValidationMechanism struct {
ValidationMechanismRefIds []string `xml:"validation-mechanism-ref-ids,attr,omitempty" json:"validationMechanismRefIds"`
ValidatedControls []ControlId `xml:"validated-controls,attr,omitempty" json:"validatedControls"`
}

type ControlImplementation struct {
ID string `xml:"id,attr,omitempty" json:"id"`
ControlIds []ControlId `xml:"control-ids,attr,omitempty" json:"controlIds"`
SatisfactionRequirements string `xml:"satisfaction-requirements,attr,omitempty" json:"satisfactionRequirements"`
Guidance string `xml:"guidance,attr,omitempty" json:"guidance"`
ControlConfigurations []ControlConfiguration `xml:"control-configurations,attr,omitempty" json:"controlConfigurations"`
ValidationMechanisms []ValidationMechanism `xml:"validation-mechanisms,attr,omitempty" json:"validationMechanisms"`
Parameters []Parameter `xml:"parameters,attr,omitempty" json:"parameters"`
}

type Implementation struct {
ComponentDefinitions []ComponentDefinition `xml:"component-definitions,attr,omitempty" json:"componentDefinitions"`
Capabilities Capabilities `xml:"capabilities,attr,omitempty" json:"capabilities,omitempty"`
ComponentSpecifications ComponentSpecifications `xml:"component-specificiations,attr,omitempty" json:"component-specifications,omitempty"`
}

type Capabilities struct{}

type ComponentSpecifications struct{}

0 comments on commit 8ce8313

Please sign in to comment.