Skip to content

Commit a268d1c

Browse files
committed
with-parent-controls for import only for #1662
Add it for insert-controls, but not exclusion or merge, based upon team review and analysis of current profile resolution specification.
1 parent 45ad642 commit a268d1c

File tree

1 file changed

+94
-18
lines changed

1 file changed

+94
-18
lines changed

src/metaschema/oscal_profile_metaschema.xml

Lines changed: 94 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,28 @@
8989
</remarks>
9090
</assembly>
9191
</choice>
92-
<assembly ref="select-control-by-id" max-occurs="unbounded">
93-
<use-name>exclude-controls</use-name>
94-
<group-as name="exclude-controls" in-json="ARRAY"/>
92+
<define-assembly name="exclude-controls">
93+
<formal-name>Select Control</formal-name>
94+
<description>Select a control or controls from an imported control set.</description>
95+
<flag ref="with-child-controls"/>
96+
<model>
97+
<define-field name="with-id" as-type="token" max-occurs="unbounded">
98+
<formal-name>Match Controls by Identifier</formal-name>
99+
<description>Selecting a control by its ID given as a literal.</description>
100+
<group-as name="with-ids" in-json="ARRAY"/>
101+
</define-field>
102+
<define-assembly name="matching" max-occurs="unbounded">
103+
<formal-name>Match Controls by Pattern</formal-name>
104+
<description>Selecting a set of controls by matching their IDs with a
105+
wildcard pattern.</description>
106+
<group-as name="matching" in-json="ARRAY"/>
107+
<flag ref="pattern"/>
108+
</define-assembly>
109+
</model>
95110
<remarks>
96-
<p>Identifies which controls to exclude, or eliminate, from the set of included controls by control identifier or match pattern.</p>
111+
<p>If <code>with-child-controls</code> is <q>yes</q> on the call to a control, no sibling <code>call</code>elements need to be used to call any controls appearing within it. Since generally, this is how control enhancements are represented (as controls within controls), this provides a way to include controls with all their dependent controls (enhancements) without having to call them individually.</p>
97112
</remarks>
98-
</assembly>
113+
</define-assembly>
99114
</model>
100115
<remarks>
101116
<p>The contents of the <code>import</code> element indicate which controls from the source will be included. Controls from the source catalog or profile may be either selected, using the <code>include-all</code> or <code>include-controls</code> directives, or de-selected (using an <code>exclude-controls</code> directive).</p>
@@ -148,7 +163,8 @@
148163
<assembly ref="group" max-occurs="unbounded">
149164
<group-as name="groups" in-json="ARRAY"/>
150165
</assembly>
151-
<assembly ref="insert-controls" max-occurs="unbounded">
166+
<assembly ref="insert-controls-for-merge-custom" max-occurs="unbounded">
167+
<use-name>insert-controls</use-name>
152168
<group-as name="insert-controls" in-json="ARRAY"/>
153169
</assembly>
154170
</model>
@@ -439,23 +455,61 @@
439455
<p>If this directive is not provided, then no controls are to be inserted; i.e., all controls are included explicitly.</p>
440456
</remarks>
441457
</define-assembly>
458+
<define-assembly name="insert-controls-for-merge-custom">
459+
<formal-name>Select Controls</formal-name>
460+
<description>Specifies which controls to use in the containing context.</description>
461+
<define-flag as-type="token" name="order">
462+
<formal-name>Order</formal-name>
463+
<description>A designation of how a selection of controls in a profile is to be ordered.</description>
464+
<constraint>
465+
<allowed-values>
466+
<enum value="keep"/>
467+
<enum value="ascending"/>
468+
<enum value="descending"/>
469+
</allowed-values>
470+
</constraint>
471+
</define-flag>
472+
<model>
473+
<choice>
474+
<assembly ref="include-all" min-occurs="1"/>
475+
<assembly ref="merge-control-by-id" min-occurs="1" max-occurs="unbounded">
476+
<use-name>include-controls</use-name>
477+
<group-as name="include-controls" in-json="ARRAY"/>
478+
</assembly>
479+
</choice>
480+
<assembly ref="merge-control-by-id" max-occurs="unbounded">
481+
<use-name>exclude-controls</use-name>
482+
<group-as name="exclude-controls" in-json="ARRAY"/>
483+
<remarks>
484+
<p>Identifies which controls to exclude, or eliminate, from the set of matching includes.</p>
485+
</remarks>
486+
</assembly>
487+
</model>
488+
<remarks>
489+
<p>To be schema-valid, this element must contain either (but not both) a single <code>include-all</code> directive, or a sequence of <code>include-controls</code> directives.</p>
490+
<p>If this directive is not provided, then no controls are to be inserted; i.e., all controls are included explicitly.</p>
491+
</remarks>
492+
</define-assembly>
442493
<define-assembly name="select-control-by-id" scope="local">
443494
<formal-name>Select Control</formal-name>
444495
<description>Select a control or controls from an imported control set.</description>
445496
<flag ref="with-child-controls"/>
497+
<flag ref="with-parent-controls"/>
446498
<model>
447-
<define-field name="with-id" as-type="token" max-occurs="unbounded">
448-
<formal-name>Match Controls by Identifier</formal-name>
449-
<description>Selecting a control by its ID given as a literal.</description>
450-
<group-as name="with-ids" in-json="ARRAY"/>
451-
</define-field>
452-
<define-assembly name="matching" max-occurs="unbounded">
453-
<formal-name>Match Controls by Pattern</formal-name>
454-
<description>Selecting a set of controls by matching their IDs with a
455-
wildcard pattern.</description>
456-
<group-as name="matching" in-json="ARRAY"/>
457-
<flag ref="pattern"/>
458-
</define-assembly>
499+
<field ref="with-id"/>
500+
<assembly ref="matching"/>
501+
</model>
502+
<remarks>
503+
<p>If <code>with-child-controls</code> is <q>yes</q> on the call to a control, no sibling <code>call</code>elements need to be used to call any controls appearing within it. Since generally, this is how control enhancements are represented (as controls within controls), this provides a way to include controls with all their dependent controls (enhancements) without having to call them individually.</p>
504+
</remarks>
505+
</define-assembly>
506+
<define-assembly name="merge-control-by-id" scope="local">
507+
<formal-name>Merge Control</formal-name>
508+
<description>Merge a control or controls from an imported control set.</description>
509+
<flag ref="with-child-controls"/>
510+
<model>
511+
<field ref="with-id"/>
512+
<assembly ref="matching"/>
459513
</model>
460514
<remarks>
461515
<p>If <code>with-child-controls</code> is <q>yes</q> on the call to a control, no sibling <code>call</code>elements need to be used to call any controls appearing within it. Since generally, this is how control enhancements are represented (as controls within controls), this provides a way to include controls with all their dependent controls (enhancements) without having to call them individually.</p>
@@ -475,4 +529,26 @@
475529
<formal-name>Pattern</formal-name>
476530
<description>A <a href="https://en.wikipedia.org/wiki/Glob_(programming)">glob expression</a> matching the IDs of one or more controls to be selected.</description>
477531
</define-flag>
532+
<define-flag as-type="token" name="with-parent-controls">
533+
<formal-name>Include Parent Controls with Control</formal-name>
534+
<description>When a control is included, whether its lineage of parent (ancestor) controls are also included.</description>
535+
<constraint>
536+
<allowed-values>
537+
<enum value="yes">Include parent controls with an included control.</enum>
538+
<enum value="no">When importing a control, only include parent controls that are also explicitly called.</enum>
539+
</allowed-values>
540+
</constraint>
541+
</define-flag>
542+
<define-field name="with-id" as-type="token" max-occurs="unbounded">
543+
<formal-name>Match Controls by Identifier</formal-name>
544+
<description>Selecting a control by its ID given as a literal.</description>
545+
<group-as name="with-ids" in-json="ARRAY"/>
546+
</define-field>
547+
<define-assembly name="matching" max-occurs="unbounded">
548+
<formal-name>Match Controls by Pattern</formal-name>
549+
<description>Selecting a set of controls by matching their IDs with a
550+
wildcard pattern.</description>
551+
<group-as name="matching" in-json="ARRAY"/>
552+
<flag ref="pattern"/>
553+
</define-assembly>
478554
</METASCHEMA>

0 commit comments

Comments
 (0)