Skip to content

Commit

Permalink
fix: determine common TaskValidValues, ThreatIdValidValues
Browse files Browse the repository at this point in the history
Signed-off-by: Lou DeGenaro <[email protected]>
  • Loading branch information
degenaro committed Apr 16, 2024
1 parent 369e8ad commit 3d0bea6
Show file tree
Hide file tree
Showing 10 changed files with 1,453 additions and 478 deletions.
22 changes: 14 additions & 8 deletions release-1.1.2-schemas-fixup/oscal_assessment-plan_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2034,10 +2034,7 @@
"$ref": "#/definitions/TokenDatatype"
},
{
"enum": [
"milestone",
"action"
]
"$ref": "#/definitions/TaskValidValues"
}
]
},
Expand Down Expand Up @@ -3312,10 +3309,7 @@
"$ref": "#/definitions/URIDatatype"
},
{
"enum": [
"http://fedramp.gov",
"http://fedramp.gov/ns/oscal"
]
"$ref": "#/definitions/ThreatIdValidValues"
}
]
},
Expand Down Expand Up @@ -4036,6 +4030,18 @@
"description": "A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122.",
"type": "string",
"pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$"
},
"TaskValidValues": {
"enum": [
"milestone",
"action"
]
},
"ThreatIdValidValues": {
"enum": [
"http://fedramp.gov",
"http://fedramp.gov/ns/oscal"
]
}
},
"properties": {
Expand Down
22 changes: 14 additions & 8 deletions release-1.1.2-schemas-fixup/oscal_assessment-results_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2238,10 +2238,7 @@
"$ref": "#/definitions/TokenDatatype"
},
{
"enum": [
"milestone",
"action"
]
"$ref": "#/definitions/TaskValidValues"
}
]
},
Expand Down Expand Up @@ -3516,10 +3513,7 @@
"$ref": "#/definitions/URIDatatype"
},
{
"enum": [
"http://fedramp.gov",
"http://fedramp.gov/ns/oscal"
]
"$ref": "#/definitions/ThreatIdValidValues"
}
]
},
Expand Down Expand Up @@ -4240,6 +4234,18 @@
"description": "A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122.",
"type": "string",
"pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$"
},
"TaskValidValues": {
"enum": [
"milestone",
"action"
]
},
"ThreatIdValidValues": {
"enum": [
"http://fedramp.gov",
"http://fedramp.gov/ns/oscal"
]
}
},
"properties": {
Expand Down
22 changes: 14 additions & 8 deletions release-1.1.2-schemas-fixup/oscal_poam_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2142,10 +2142,7 @@
"$ref": "#/definitions/TokenDatatype"
},
{
"enum": [
"milestone",
"action"
]
"$ref": "#/definitions/TaskValidValues"
}
]
},
Expand Down Expand Up @@ -3420,10 +3417,7 @@
"$ref": "#/definitions/URIDatatype"
},
{
"enum": [
"http://fedramp.gov",
"http://fedramp.gov/ns/oscal"
]
"$ref": "#/definitions/ThreatIdValidValues"
}
]
},
Expand Down Expand Up @@ -4144,6 +4138,18 @@
"description": "A type 4 ('random' or 'pseudorandom') or type 5 UUID per RFC 4122.",
"type": "string",
"pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[45][0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$"
},
"TaskValidValues": {
"enum": [
"milestone",
"action"
]
},
"ThreatIdValidValues": {
"enum": [
"http://fedramp.gov",
"http://fedramp.gov/ns/oscal"
]
}
},
"properties": {
Expand Down
21 changes: 18 additions & 3 deletions scripts/oscal_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,31 @@ def write_oscal(classes, forward_refs, fstem):
# (begin) Temporary?

additions = {
'assessment_plan': ['from trestle.oscal.common import SystemComponent, RelatedObservation'],
'assessment_plan': [
'from trestle.oscal.common import RelatedObservation',
'from trestle.oscal.common import RiskStatus1',
'from trestle.oscal.common import SystemComponent',
'from trestle.oscal.common import TaskValidValues',
'from trestle.oscal.common import TokenDatatype',
],
'assessment_results': [
'from trestle.oscal.common import AssessmentAssets, Observation, RelatedObservation, SystemComponent'
'from trestle.oscal.common import AssessmentAssets',
'from trestle.oscal.common import Observation',
'from trestle.oscal.common import RelatedObservation',
'from trestle.oscal.common import RiskStatus1',
'from trestle.oscal.common import SystemComponent',
'from trestle.oscal.common import TaskValidValues',
'from trestle.oscal.common import TokenDatatype',
],
'component': [
'from trestle.oscal.common import URIReferenceDatatype',
],
'poam': [
'from trestle.oscal.common import RelatedObservation',
'from trestle.oscal.common import RelatedObservation as RelatedObservation1'
'from trestle.oscal.common import RiskStatus1',
'from trestle.oscal.common import TaskValidValues',
'from trestle.oscal.common import TokenDatatype',
'from trestle.oscal.common import RelatedObservation as RelatedObservation1',
],
'ssp': [
'from trestle.oscal.common import Status, SystemComponent',
Expand Down
Loading

0 comments on commit 3d0bea6

Please sign in to comment.