Skip to content

Commit

Permalink
Profile alter model adjustments (usnistgov#1418)
Browse files Browse the repository at this point in the history
* - Adjusted the profile metaschema to refactor the alter assemblies in a backwards-compatible way.
  - Enumerated the set of target item types for remove.
  - Fixed references to use current `by-` syntax.
- Adjusted unit tests to support better add/remove testing.
* Updated to latest metaschema development version
* added default value `ending` for `add/@position`.
  • Loading branch information
david-waltermire authored and aj-stein-nist committed Jan 10, 2023
1 parent d93ecdb commit b413079
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 119 deletions.
202 changes: 101 additions & 101 deletions src/metaschema/oscal_profile_metaschema.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="a2">
Expand All @@ -37,7 +37,7 @@
</param>
<prop name="label" value="third"/>
<part name="statement" id="a3-stmt">
<p>A3 aaaaa aaaaaaaaaa</p>
<p>A3 aaaaa <insert type="param" id-ref="a3_prm1"/> aaaaaaaaaa</p>
</part>
</control>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,35 @@
</description>
</constraint>
</set-parameter>
<alter control-id="a1">
<alter control-id="a1"><!-- OK control -->
<add position="starting" by-id="a1">
<prop name="CORE" ns="https://fedramp.gov/ns/oscal" value="core"/>
</add>
<add position="starting" by-id="a1-stmt">
<add position="starting" by-id="a1_prm1"><!-- OK parameter -->
<prop name="annotated" ns="https://fedramp.gov/ns/oscal" value="param-prop"/>
</add>
<add position="before" by-id="a1_prm1"><!-- parameter child -->
<param id="new_prm">
<prop name="annotated" ns="https://fedramp.gov/ns/oscal" value="new-param"/>
<label>A1 Parameter New</label>
</param>
</add>
<add position="starting" by-id="a1-stmt"><!-- part -->
<prop name="conformity"
ns="https://fedramp.gov/ns/oscal"
value="assessment-objective"/>
<prop name="method" class="fedramp" value="EXAMINE"/>
</add>
<add position="after" by-id="a1-stmt"><!-- part child -->
<part name="statement" id="new-part">
<p>A1 bbbbb <insert type="param" id-ref="new_prm"/> bbbbb</p>
</part>
</add>
<add position="ending" by-id="a1-stmt"><!-- part child -->
<part name="statement" id="new-part2">
<p>A1 ccc <insert type="param" id-ref="new_prm"/> ccc</p>
</part>
</add>
</alter>
</modify>
<back-matter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
</metadata>
<control id="a1">
<title>Control A1</title>
<param id="a1_prm1">
<label>A1 Parameter 1</label>
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
</metadata>
<control id="a1">
<title>Control A1</title>
<param id="a1_prm1">
<label>A1 Parameter 1</label>
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
</control>
<control id="a3">
<title>Control A3</title>
<param id="a3_prm1">
<label>A3 Parameter 1</label>
</param>
<prop name="label" value="third"/>
<part name="statement" id="a3-stmt">
<p>A3 aaaaa aaaaaaaaaa</p>
<p>A3 aaaaa <insert type="param" id-ref="a3_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
</metadata>
<control id="a1">
<title>Control A1</title>
<param id="a1_prm1">
<label>A1 Parameter 1</label>
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
</metadata>
<control id="a1">
<title>Control A1</title>
<param id="a1_prm1">
<label>A1 Parameter 1</label>
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
</metadata>
<control id="a1">
<title>Control A1</title>
<param id="a1_prm1">
<label>A1 Parameter 1</label>
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand All @@ -25,9 +28,12 @@
</control>
<control id="a1">
<title>Control A1</title>
<param id="a1_prm1">
<label>A1 Parameter 1</label>
</param>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
</part>
</control>
<control id="b1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
<title>Group A of C</title>
<control id="a1">
<title>Control A1</title>
<param id="new_prm">
<prop name="annotated" ns="https://fedramp.gov/ns/oscal" value="new-param"/>
<label>A1 Parameter New</label>
</param>
<param id="a1_prm1">
<prop name="annotated" ns="https://fedramp.gov/ns/oscal" value="param-prop"/>
<label>A1 Parameter 1</label>
<constraint>
<description>
Expand All @@ -22,13 +27,19 @@
</constraint>
</param>
<prop name="CORE" ns="https://fedramp.gov/ns/oscal" value="core"/>
<prop name="place" value="first"/>
<prop name="label" value="first"/>
<part name="statement" id="a1-stmt">
<prop name="conformity"
ns="https://fedramp.gov/ns/oscal"
value="assessment-objective"/>
<prop name="method" class="fedramp" value="EXAMINE"/>
<p>A1 aaaaa aaaaaaaaaa</p>
<p>A1 aaaaa <insert type="param" id-ref="a1_prm1"/> aaaaaaaaaa</p>
<part name="statement" id="new-part2">
<p>A1 ccc <insert type="param" id-ref="new_prm"/> ccc</p>
</part>
</part>
<part name="statement" id="new-part">
<p>A1 bbbbb <insert type="param" id-ref="new_prm"/> bbbbb</p>
</part>
</control>
<control id="a3">
Expand All @@ -41,9 +52,9 @@
</description>
</constraint>
</param>
<prop name="place" value="third"/>
<prop name="label" value="third"/>
<part name="statement" id="a3-stmt">
<p>A3 aaaaa aaaaaaaaaa</p>
<p>A3 aaaaa <insert type="param" id-ref="a3_prm1"/> aaaaaaaaaa</p>
</part>
</control>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,9 @@ intermediate:
<p><req level="must" id="req-modify-set-param-objects1">For the following objects inside the source: class, depends-on, label, usage, values, select; the object MUST be copied into the target from the source, first removing any existing objects with the same name.</req></p>
</li>
<li>
<p><req level="must" id="req-modify-set-param-objects2">For the following objects inside the source: props, <src>links</src>, <src>constraints</src>, <src>guidelines</src>; the contents of the object MUST be added to the contents of the target object of the same name. If no such object exists in the target, it is created.</req></p>
<p><req level="must" id="req-modify-set-param-objects2">For the following objects inside the source: <src>prop</src>, <src>link</src>, <src>constraint</src>, <src>guideline</src>; the contents of the object MUST be added to the contents of the target object of the same name. If no such object exists in the target, it is created.</req></p>
</li>
<li> <p><req level="must" id="req-modify-set-param-objects3">For the following objects inside the source: <src>prop</src>, <src>link</src>; the object MUST be copied into the target from the source, first removing any existing objects with the same distinctive ID. (<xref rid="id"></xref>).</req></p></li>
<li> <p><req level="must" id="req-modify-set-param-objects3">For the following objects inside the source: <src>prop</src>, <src>link</src>; the object MUST be copied into the target from the source, first removing any existing objects with the same distinctive ID. (<xref rid="id"/>).</req></p></li>
<li>
<p><req level="must" id="req-modify-param-multi">If more than one
<src>set-parameter</src> directive is given for the same parameter, all MUST BE applied, in the sequence given in the profile.</req>
Expand Down

0 comments on commit b413079

Please sign in to comment.