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

Expose changes made to create a comon data type implementation that can be shared across projects #341

Closed
wants to merge 6 commits into from
148 changes: 148 additions & 0 deletions schema/json/metaschema-datatypes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"$schema" : "http://json-schema.org/draft-07/schema#",
"$id" : "http://csrc.nist.gov/ns/oscal/1.0/metaschema-datatypes-schema.json",
"$comment" : "OSCAL Unified Model of Models",
"type" : "object",
"definitions" : {
"Base64Datatype": {
"description": "Binary data encoded using the Base 64 encoding algorithm as defined by RFC4648.",
"type": "string",
"pattern": "^[0-9A-Za-z+/]+={0,2}$",
"contentEncoding": "base64"
},
"BooleanDatatype": {
"description": "A binary value that is either: true or false.",
"type": "boolean"
},
"DateDatatype": {
"description": "A string representing a 24-hour period with an optional timezone.",
"type": "string",
"pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))(Z|[+-][0-9]{2}:[0-9]{2})?$"
},
"DateWithTimezoneDatatype": {
"description": "A string representing a 24-hour period with a required timezone.",
"type": "string",
"pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))(Z|[+-][0-9]{2}:[0-9]{2})$"
},
"DateTimeDatatype": {
"description": "A string representing a point in time with an optional timezone.",
"type": "string",
"pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]*[1-9])?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))?$"
},
"DateTimeWithTimezoneDatatype": {
"description": "A string representing a point in time with a required timezone.",
"type": "string",
"format": "date-time",
"pattern": "^(((2000|2400|2800|(19|2[0-9](0[48]|[2468][048]|[13579][26])))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\\.[0-9]*[1-9])?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|\\+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))$"
},
"DayTimeDurationDatatype": {
"description": "An amount of time quantified in days, hours, minutes, and seconds.",
"type": "string",
"format": "duration",
"pattern": "^-?P([0-9]+D(T(([0-9]+H([0-9]+M)?(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+M(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+|[0-9]+(\\.[0-9]+)?)S))?)|T(([0-9]+H([0-9]+M)?(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+M(([0-9]+|[0-9]+(\\.[0-9]+)?)S)?)|([0-9]+|[0-9]+(\\.[0-9]+)?)S)$"
},
"DecimalDatatype": {
"description": "A real number expressed using a whole and optional fractional part separated by a period.",
"type": "number",
"pattern": "^(\\+|-)?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)$"
},
"EmailAddressDatatype": {
"description": "An email address string formatted according to RFC 6531.",
"allOf": [
{"$ref": "#/definitions/StringDatatype"},
{
"type": "string",
"format": "email",
"pattern": "^.+@.+$"
}
]
},
"HostnameDatatype": {
"description": "An internationalized Internet host name string formatted according to section 2.3.2.3 of RFC5890.",
"allOf": [
{"$ref": "#/definitions/StringDatatype"},
{
"type": "string",
"format": "idn-hostname"
}
]
},
"IntegerDatatype": {
"description": "A whole number value.",
"type": "integer"
},
"IPV4AddressDatatype": {
"description": "An Internet Protocol version 4 address represented using dotted-quad syntax as defined in section 3.2 of RFC2673.",
"type": "string",
"format": "ipv4",
"pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$"
},
"IPV6AddressDatatype": {
"description": "An Internet Protocol version 6 address represented using the syntax defined in section 2.2 of RFC3513.",
"type": "string",
"format": "ipv6",
"pattern": "^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|[fF][eE]80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::([fF]{4}(:0{1,4}){0,1}:){0,1}((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]).){3,3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))$"
},
"MarkupLineDatatype": {
"description": "",
"type": "string",
"pattern": "^[^\n]+$"
},
"MarkupMultilineDatatype": {
"description": "",
"type": "string"
},
"NonNegativeIntegerDatatype": {
"description": "An integer value that is equal to or greater than 0.",
"allOf": [
{"$ref": "#/definitions/IntegerDatatype"},
{
"type": "number",
"minimum": 0
}
]
},
"PositiveIntegerDatatype": {
"description": "An integer value that is greater than 0.",
"allOf": [
{"$ref": "#/definitions/IntegerDatatype"},
{
"type": "number",
"minimum": 1
}
]
},
"StringDatatype": {
"description": "A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+",
"type": "string",
"pattern": "^\\S(.*\\S)?$"
},
"TokenDatatype": {
"description": "A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName.",
"type": "string",
"pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$"
},
"URIDatatype": {
"description": "A universal resource identifier (URI) formatted according to RFC3986.",
"type": "string",
"format": "uri",
"pattern": "^[a-zA-Z][a-zA-Z0-9+\\-.]+:.+$"
},
"URIReferenceDatatype": {
"description": "A URI Reference, either a URI or a relative-reference, formatted according to section 4.1 of RFC3986.",
"type": "string",
"format": "uri-reference"
},
"UUIDDatatype": {
"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}$"
},
"YearMonthDurationDatatype": {
"description": "An amount of time quantified in years and months based on ISO-8601 durations (see also RFC3339 appendix A).",
"type": "string",
"format": "duration",
"pattern": "^-?P([0-9]+Y([0-9]+M)?)|[0-9]+M$"
}
}
}
Loading