Skip to content

Commit

Permalink
Replace define-assembly for include-all with assembly ref (#1144)
Browse files Browse the repository at this point in the history
* Replace `define-assembly` for `include-all` with `assembly ref`
* Apply suggestions from code review
* Moved include-all to oscal_control-common_metaschema.xml to allow for proper importing.

Resolves #1137

Co-authored-by: David Waltermire <[email protected]>
  • Loading branch information
guyzyl and david-waltermire committed Feb 26, 2022
1 parent 18fa9a3 commit 0f453ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 20 deletions.
15 changes: 3 additions & 12 deletions src/metaschema/oscal_assessment-common_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,7 @@
<group-as name="links" in-json="ARRAY"/>
</assembly>
<choice>
<define-assembly name="include-all" min-occurs="1">
<formal-name>All</formal-name>
<description>A key word to indicate all.</description>
</define-assembly>
<assembly ref="include-all" min-occurs="1"/>
<assembly ref="select-control-by-id" min-occurs="1" max-occurs="unbounded">
<use-name>include-control</use-name>
<group-as name="include-controls" in-json="ARRAY"/>
Expand Down Expand Up @@ -443,10 +440,7 @@
<group-as name="links" in-json="ARRAY"/>
</assembly>
<choice>
<define-assembly name="include-all" min-occurs="1">
<formal-name>All</formal-name>
<description>A key word to indicate all.</description>
</define-assembly>
<assembly ref="include-all" min-occurs="1"/>
<assembly ref="select-objective-by-id" min-occurs="1" max-occurs="unbounded">
<use-name>include-objective</use-name>
<group-as name="include-objectives" in-json="ARRAY"/>
Expand Down Expand Up @@ -560,10 +554,7 @@
<group-as name="links" in-json="ARRAY"/>
</assembly>
<choice>
<define-assembly name="include-all" min-occurs="1">
<formal-name>All</formal-name>
<description>A key word to indicate all.</description>
</define-assembly>
<assembly ref="include-all" min-occurs="1"/>
<assembly ref="select-subject-by-id" min-occurs="1" max-occurs="unbounded">
<use-name>include-subject</use-name>
<group-as name="include-subjects" in-json="ARRAY"/>
Expand Down
10 changes: 10 additions & 0 deletions src/metaschema/oscal_control-common_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,19 @@
<p>A set of parameter value choices, that may be picked from to set the parameter value.</p>
</remarks>
</define-assembly>
<!-- ############################## -->
<!-- # Control-related constructs # -->
<!-- ############################## -->
<define-flag name="control-id" as-type="token">
<formal-name>Control Identifier Reference</formal-name>
<!-- Identifier Reference -->
<description>A <a href="/concepts/identifier-use/#human-oriented">human-oriented</a> identifier reference to a control with a corresponding <code>id</code> value. When referencing an externally defined <code>control</code>, the <code>Control Identifier Reference</code> must be used in the context of the external / imported OSCAL instance (e.g., uri-reference).</description>
</define-flag>
<define-assembly name="include-all">
<formal-name>Include All</formal-name>
<description>Include all controls from the imported catalog or profile resources.</description>
<remarks>
<p>This element provides an alternative to calling controls individually from a catalog.</p>
</remarks>
</define-assembly>
</METASCHEMA>
8 changes: 0 additions & 8 deletions src/metaschema/oscal_profile_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,6 @@
<p>If this directive is not provided, then no controls are to be inserted; i.e., all controls are included explicitly.</p>
</remarks>
</define-assembly>

<define-assembly name="include-all">
<formal-name>Insert All</formal-name>
<description>Insert all controls from the imported catalog or profile resources identified in the <code>import</code> directive.</description>
<remarks>
<p>This element provides an alternative to calling controls individually from a catalog.</p>
</remarks>
</define-assembly>
<define-assembly name="select-control-by-id" scope="local">
<formal-name>Call</formal-name>
<description>Call a control by its ID</description>
Expand Down

0 comments on commit 0f453ed

Please sign in to comment.