Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #5

Merged
merged 43 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8d9ffc9
Bump actions/checkout from 3.6.0 to 4.0.0
dependabot[bot] Sep 12, 2023
96d658b
Updated link for profile resolution
Arminta-Jenkins-NIST Sep 15, 2023
31e1664
Bump actions/checkout from 4.0.0 to 4.1.0
dependabot[bot] Sep 27, 2023
928ac27
Bump build/metaschema-xslt from `034e92b` to `bd4359a`
dependabot[bot] Sep 27, 2023
d831a3d
Fix expected content of resolving merge-keep_profile.xml
galtm Nov 20, 2022
651deef
Bug fix for selected children of unselected parent
galtm Dec 26, 2022
534b12d
Make schema paths react to directory restructuring
galtm Sep 28, 2023
1c0d6ae
Added hybrid cloud
JustKuzya Oct 12, 2023
9840b46
Integrate PR feedback and merge updated enum value.
aj-stein-nist Oct 13, 2023
dde71c3
Implementation Agnostic Testing (#1946)
nikitawootten-nist Oct 25, 2023
e309dd5
[skip ci] Add ADR-0008 for usnistgov/oscal-content#116.
aj-stein-nist Oct 12, 2023
fd2ff39
[skip ci] Add missing link to oscal-content per review feedback.
aj-stein-nist Oct 13, 2023
1d8a9a0
[skip ci] Update status, date before merge. Clarify content is still …
aj-stein-nist Nov 9, 2023
1d48aee
Bump actions/github-script from 6.4.1 to 7.0.1 (#1961)
dependabot[bot] Nov 21, 2023
70816d7
Bump actions/setup-node from 3.8.1 to 4.0.0 (#1954)
dependabot[bot] Nov 21, 2023
b13eeb2
Bump org.apache.maven.plugins:maven-dependency-plugin in /build (#1953)
dependabot[bot] Nov 21, 2023
90089bf
Bump actions/checkout from 4.1.0 to 4.1.1 (#1950)
dependabot[bot] Nov 21, 2023
b9e6a2d
Bump build/metaschema-xslt from `bd4359a` to `7d9fbfa` (#1955)
dependabot[bot] Nov 22, 2023
085af23
Add tutorials system lifecycle ADR (#1959)
nikitawootten-nist Nov 22, 2023
fe39318
Flatten codeowners (#1962)
nikitawootten-nist Nov 29, 2023
290bc84
Catalog constraints added in oscal_catalog_metaschema.xml - see issue…
iMichaela Nov 29, 2023
f72e27e
Updated version in the release a patch guidance (#1964)
iMichaela Dec 6, 2023
ee77ab6
Bump actions/setup-java from 3 to 4 (#1963)
dependabot[bot] Dec 6, 2023
c4a99cc
Remove with-parent-controls from implementation (#1843)
aj-stein-nist Dec 6, 2023
97a71c1
Update oscal metaschema source to version 1.1.2
Dec 6, 2023
45c1fc4
New XSLT emulates resolve-entities.xsl, except using 3.0 features, wi…
wendellpiez Jan 23, 2024
f69c55e
Improved initial comment on XSLT
wendellpiez Jan 30, 2024
f246530
Bump actions/setup-node from 4.0.0 to 4.0.1
dependabot[bot] Feb 5, 2024
553bbc2
Bump actions/setup-node from 4.0.1 to 4.0.2
dependabot[bot] Feb 7, 2024
1d857dd
Merge branch 'develop' into enhancement-metaschema-normalizer-fixup
iMichaela Feb 19, 2024
28f801d
skipping the linkcheck for OSCAL site on csrc due to very tardy site …
iMichaela Feb 20, 2024
ff28491
Merge branch 'develop' into enhancement-metaschema-normalizer-fixup
iMichaela Feb 20, 2024
674d65e
Updates to accommodate CI/CD
galtm Feb 22, 2024
f421eac
CI/CD-friendly URIs to new location
galtm Feb 23, 2024
fe22cb1
Mark include-controls w/ parent scenario pending
galtm Feb 23, 2024
c8b7b54
Rewrite id() usage
galtm Feb 23, 2024
f55bf8d
Merge branch 'develop' into enhancement-metaschema-normalizer-fixup
iMichaela Mar 1, 2024
f358425
Bump actions/add-to-project from 0.5.0 to 0.6.0
dependabot[bot] Feb 27, 2024
c909b22
Bump softprops/action-gh-release from 1 to 2
dependabot[bot] Mar 12, 2024
3f19e58
Merge branch 'develop' into enhancement-metaschema-normalizer-fixup
iMichaela Mar 12, 2024
8988c9b
Merging manually with no-ff Wendell's PR 1976 into develop due to con…
iMichaela Mar 12, 2024
e8c00f0
Addressing issue 1958 by updating the description of the property.
iMichaela Mar 13, 2024
366d155
Updated the PR template to point to the OSCAL website repos.
iMichaela Mar 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ By submitting a pull request, you are agreeing to provide this contribution unde
- [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
- [ ] Have you written new tests for your core changes, as applicable?
- [ ] Have you included examples of how to use your new feature(s)?
- [ ] Have you updated all [OSCAL website](https://pages.nist.gov/OSCAL) and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the docs/content directory of your branch.
- [ ] Have you updated the [OSCAL website](https://pages.nist.gov/OSCAL) and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the [OSCAL-Pages](https://github.com/usnistgov/OSCAL-Pages) and [OSCAL_Reference](https://github.com/usnistgov/OSCAL-Reference) repositories.
2 changes: 1 addition & 1 deletion .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Add issue to project
runs-on: ubuntu-20.04
steps:
- uses: actions/add-to-project@31b3f3ccdc584546fc445612dec3f38ff5edb41c
- uses: actions/add-to-project@0609a2702eefb44781da00f8e04901d6e5cd2b92
with:
project-url: https://github.com/orgs/usnistgov/projects/25
github-token: ${{ secrets.COMMIT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
submodules: recursive
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version-file: "build/.nvmrc"
cache: "npm"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
make -j2 artifacts archives RELEASE=${GITHUB_REF_NAME:1}
working-directory: build
- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.COMMIT_TOKEN }}
draft: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
distribution: "temurin"
java-version: "17"
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
with:
node-version-file: "build/.nvmrc"
cache: "npm"
Expand Down
5 changes: 4 additions & 1 deletion build/markdown-link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
},
{
"pattern": "https://linux.die.net/man/1/xmllint/"
}
},
{
"pattern": "https://csrc.nist.gov/Projects/Open-Security-Controls-Assessment-Language"
}
],
"replacementPatterns": [
{
Expand Down
78 changes: 78 additions & 0 deletions build/resolve-entities.xspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec"
stylesheet="resolve-entities3.xsl"
xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">

<x:scenario label="Everything copies:">
<x:scenario label="A bare metaschema">
<x:context>
<METASCHEMA/>
</x:context>
<x:expect label="copies" select="$x:context"/>
</x:scenario>
<x:scenario label="With random PIs">
<x:context>
<?xml-stylesheet href="some.css"?>
<METASCHEMA>
<title>A test</title>
<?random?>
</METASCHEMA>
</x:context>
<x:expect label="copies" select="$x:context"/>
</x:scenario>
<x:scenario label="A comment" pending="dev"/>
</x:scenario>

<x:scenario label="import/@href is modified:">
<x:scenario label="providing a suffix to the base name">
<x:context>
<METASCHEMA>
<import href="some.other.metaschema.xml"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some.other.metaschema_RESOLVED.xml"/>
</METASCHEMA>
</x:expect>
</x:scenario>
<x:scenario label="even when the suffix is not 'xml'">
<x:context>
<METASCHEMA>
<import href="some.other.metaschema"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some.other_RESOLVED.metaschema"/>
</METASCHEMA>
</x:expect>
</x:scenario>
<x:scenario label="or it is missing entirely">
<x:context>
<METASCHEMA>
<import href="some_metaschema"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some_metaschema_RESOLVED"/>
</METASCHEMA>
</x:expect>
</x:scenario>
<x:scenario label="providing a suffix to the base name">
<x:context>
<x:param name="splice">_NEW</x:param>
<METASCHEMA>
<import href="some.other.metaschema.xml"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some.other.metaschema_NEW.xml"/>
</METASCHEMA>
</x:expect>
</x:scenario>
</x:scenario>

</x:description>
46 changes: 46 additions & 0 deletions build/resolve-entities3.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:math="http://www.w3.org/2005/xpath-functions/math"
xpath-default-namespace="http://csrc.nist.gov/ns/oscal/metaschema/1.0"
exclude-result-prefixes="xs math"
version="3.0">

<!--
Purpose: Process XML files through a parsing/serialization that resolves internal parsed entities.

Also renames file references in METASCHEMA/import/@href
using $importHrefSuffix to suffix the base name
so for $importHrefSuffix='NEW'
import href="a_metaschema_module.xml" becomes href="a_metaschema_module_NEW.xml"

Otherwise this is an identity transform, so a diff over source and results should show only stated changes.

Parameter: $importHrefSuffix is 'RESOLVED' by default

XSpec: See the XSpec resolve-entities.xspec for functional testing, including the edge cases.

Compared to old resolve-entities.xsl: This XSLT provides the same outputs
for 'normal' inputs i.e. when import/@href ends in '.xml'.

For extraordinary inputs it does a little differently.

-->

<!-- since whitespace is retained from input, it provides indenting
- if (schema-based) strip-space is operative, switch @indent to 'yes'-->
<xsl:output omit-xml-declaration="no" indent="no" encoding="ASCII"/>

<xsl:param name="importHrefSuffix" select="'RESOLVED'"/>

<!-- copying everything through -->
<xsl:mode on-no-match="shallow-copy"/>

<xsl:template match="import/@href">
<xsl:param name="splice" select="'_' || $importHrefSuffix"/>

<xsl:variable name="basename" select="replace(.,'\.[^.]*$','')"/>
<xsl:attribute name="href" select="$basename || $splice || substring-after(.,$basename)"/>
</xsl:template>

</xsl:stylesheet>
2 changes: 1 addition & 1 deletion src/metaschema/oscal_metadata_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
<use-name>prop</use-name>
<define-flag name="name" as-type="token" required="yes">
<formal-name>Property Name</formal-name>
<description>A textual label, within a namespace, that uniquely identifies a specific attribute, characteristic, or quality of the property's containing object.</description>
<description>A textual label, within a namespace, that identifies a specific attribute, characteristic, or quality of the property's containing object.</description>
</define-flag>
<define-flag name="uuid" as-type="uuid">
<formal-name>Property Universally Unique Identifier</formal-name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
https://github.com/usnistgov/OSCAL/discussions/1114
When this is determined, tests can be added for those sections. -->

<!-- Location of sample files, relative to compiled test in xspec/ subdirectory -->
<x:variable name="ov:filedir" as="xs:string" select="resolve-uri('../../../../../../specifications/profile-resolution/profile-resolution-examples')"/>
<!-- Location of sample files, relative to this test file -->
<x:variable name="ov:filedir" as="xs:string" select="resolve-uri('../../../../specifications/profile-resolution/profile-resolution-examples',$x:xspec-uri)"/>

<x:scenario label="Import controls using ID mapping">
<x:scenario label="Basic case" pending="Mapping is not implemented yet">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
xmlns:xs="http://www.w3.org/2001/XMLSchema"
stylesheet="../../oscal-profile-resolve-select.xsl">

<!-- Location of sample files, relative to compiled test in xspec/ subdirectory -->
<x:variable name="ov:filedir" as="xs:string" select="resolve-uri('../../../../../../specifications/profile-resolution/profile-resolution-examples')"/>
<!-- Location of sample files, relative to this test file -->
<x:variable name="ov:filedir" as="xs:string" select="resolve-uri('../../../../specifications/profile-resolution/profile-resolution-examples',$x:xspec-uri)"/>

<x:scenario label="Direct import by file href">
<x:context>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/resolver-pipeline/testing/1_selected/select.xspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
stylesheet="../../oscal-profile-resolve-select.xsl"
xslt-version="3.0">

<!-- Location of sample files, relative to compiled test in xspec/ subdirectory -->
<x:variable name="ov:filedir" as="xs:string" select="resolve-uri('../../../../../../specifications/profile-resolution/profile-resolution-examples')"/>
<!-- Location of sample files, relative to this test file -->
<x:variable name="ov:filedir" as="xs:string" select="resolve-uri('../../../../specifications/profile-resolution/profile-resolution-examples',$x:xspec-uri)"/>

<x:variable name="ov:unique" as="function(*)"
select="function($seq as xs:string*) as xs:boolean {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec"
xmlns:javaUUID="java.util.UUID"
xmlns:ov="http://csrc.nist.gov/ns/oscal/xspec/variable"
xmlns:u="http://csrc.nist.gov/ns/uuid"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
Expand All @@ -8,7 +9,7 @@
<x:scenario label="Tests for u:determine-uuid template">
<x:variable name="ov:fixed" as="xs:string" select="'00000000-0000-4000-B000-000000000000'"/>
<x:variable name="ov:specified" as="xs:string" select="'f0ad1e6c-5de5-44cd-b92e-a4c507805f0f'"/>
<x:variable name="ov:service" as="xs:string" select="resolve-uri('../uuid-value.txt')"/>
<x:variable name="ov:service" as="xs:string" select="resolve-uri('uuid-value.txt',$x:xspec-uri)"/>
<x:scenario label="Valid user-provided UUID">
<x:call template="u:determine-uuid">
<x:param name="top-uuid" select="$ov:specified"/>
Expand Down Expand Up @@ -37,16 +38,22 @@
<x:expect label="UUID is neither fixed one nor specified one"
test="$x:result ne $ov:specified and $x:result ne $ov:fixed"/>
</x:scenario>
<x:scenario label="Random UUID using Java">
<x:scenario label="Random UUID using Java (Note: Not available in CI/CD)">
<x:call template="u:determine-uuid">
<x:param name="top-uuid" select="$ov:specified"/>
<x:param name="uuid-method" select="'random-java'"/>
</x:call>
<x:expect label="Nonempty string"
test="$x:result instance of xs:string and $x:result != ''"/>
<x:variable name="ov:java-fcn-available" as="xs:boolean"
select="function-available('javaUUID:randomUUID')"/>
<x:expect label="Nonempty"
test="if ($ov:java-fcn-available)
then (string($x:result) != '')
else true()"/>
<x:expect label="UUID is neither fixed one nor specified one"
test="$x:result ne $ov:specified and $x:result ne $ov:fixed"/>
</x:scenario>
test="if ($ov:java-fcn-available)
then (string($x:result) ne $ov:specified and string($x:result) ne $ov:fixed)
else true()"/>
</x:scenario>
<!-- FYI: Because the transform relies on use-when, which is evaluated at
compile time, the same test invocation cannot check both
when the XSLT and Java random number generators are available
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,8 @@
</control>
</x:expect>
</x:scenario>
<x:scenario label="include-controls with parent controls (default choice)">
<x:scenario label="include-controls with parent controls (default choice)"
pending="Needs confirmation about latest expected result">
<x:context mode="o:custom-merge" select="//o:include-controls">
<catalog uuid="xyz-tiny_catalog">
<selection>
Expand Down
4 changes: 2 additions & 2 deletions src/utils/resolver-pipeline/testing/4_modified/modify.xspec
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@

<x:scenario label="Tests for match=set-parameter template">
<x:scenario label="set-param child does not match anything">
<x:context select="//set-parameter">
<x:context select="//o:set-parameter">
<catalog id="abc">
<param id="p1">
<label>Parameter #1</label>
Expand Down Expand Up @@ -1158,7 +1158,7 @@
</x:scenario>
<x:scenario label="Edge case: Empty $modifications param">
<x:call function="oscal:patches-to-id-targeting-ancestor">
<x:param name="here" select="id('a1-stmt')">
<x:param name="here" select="//*[@id='a1-stmt']">
<catalog id="abc">
<control id="a1">
<title>Control A</title>
Expand Down