let's try this

This commit is contained in:
brent s. 2019-12-08 05:30:06 -05:00
parent 5b93892f0a
commit 49fb2ad547
5 changed files with 153 additions and 49 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="http://schema.xml.r00t2.io/aif.xsd" <xs:schema targetNamespace="http://schema.xml.r00t2.io/linux.xsd"
xmlns="http://schema.xml.r00t2.io/aif.xsd" xmlns="http://schema.xml.r00t2.io/aif.xsd"
xmlns:aif="http://schema.xml.r00t2.io/aif.xsd" xmlns:aif="http://schema.xml.r00t2.io/aif.xsd"
xmlns:linux="http://schema.xml.r00t2.io/linux.xsd" xmlns:linux="http://schema.xml.r00t2.io/linux.xsd"
@ -93,7 +93,7 @@
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
<xs:attribute name="auto" type="aif:t_auto_ip6" <xs:attribute name="auto" type="net:t_auto_ip6"
use="optional" default="slaac"/> use="optional" default="slaac"/>
</xs:complexType> </xs:complexType>
<xs:unique name="uniq_ipv6_addr"> <xs:unique name="uniq_ipv6_addr">
@ -187,7 +187,7 @@
</xs:choice> </xs:choice>
</xs:sequence> </xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required"/> <xs:attribute name="id" type="xs:ID" use="required"/>
<xs:attribute name="device" type="aif:t_iface_name" use="required"/> <xs:attribute name="device" type="linux:t_iface_name" use="required"/>
<xs:attribute name="defroute" type="xs:boolean" use="optional" default="false"/> <xs:attribute name="defroute" type="xs:boolean" use="optional" default="false"/>
<xs:attribute name="searchDomain" type="std:t_nonempty" use="optional"/> <xs:attribute name="searchDomain" type="std:t_nonempty" use="optional"/>
</xs:complexType> </xs:complexType>
@ -195,7 +195,7 @@
<xs:simpleType name="t_iface_name"> <xs:simpleType name="t_iface_name">
<xs:union memberTypes="linux:t_iface_name"> <xs:union memberTypes="linux:t_iface_name">
<xs:simpleType> <xs:simpleType>
<xs:restriction> <xs:restriction base="xs:string">
<xs:enumeration value="auto"/> <xs:enumeration value="auto"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
@ -219,7 +219,7 @@
<xs:simpleType name="t_netproto"> <xs:simpleType name="t_netproto">
<xs:union memberTypes="net:t_netproto"> <xs:union memberTypes="net:t_netproto">
<xs:simpleType> <xs:simpleType>
<xs:restriction> <xs:restriction base="xs:string">
<xs:enumeration value="both"/> <xs:enumeration value="both"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
@ -252,10 +252,8 @@
<xs:element name="bootstrap" minOccurs="1" maxOccurs="1"> <xs:element name="bootstrap" minOccurs="1" maxOccurs="1">
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="tarball" minOccurs="1" maxOccurs="1" type="aif:t_uri"/> <xs:element name="tarball" minOccurs="1" maxOccurs="1" type="std:t_uri"/>
<xs:element name="verify" minOccurs="0" maxOccurs="1"> <xs:element name="verify" minOccurs="0" maxOccurs="1" type="std:t_verifyfile"/>

</xs:element>
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@ -332,18 +330,7 @@
</xs:element> </xs:element>
<!-- END MDADM --> <!-- END MDADM -->
<!-- BEGIN MOUNTPOINTS --> <!-- BEGIN MOUNTPOINTS -->
<xs:element name="mountPoints" minOccurs="1"> <xs:element name="mountPoints" minOccurs="1" maxOccurs="1" type="linux:t_mounts">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="mount" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="opt" minOccurs="1" maxOccurs="unbounded"
type="aif:t_cmdopts"/>
</xs:sequence>
<xs:attribute name="source" type="xs:IDREF" use="required"/>
<xs:attribute name="target" type="aif:t_filepath" use="required"/>
</xs:complexType>
<xs:unique name="uniq_mnts_src"> <xs:unique name="uniq_mnts_src">
<xs:selector xpath="aif:mount"/> <xs:selector xpath="aif:mount"/>
<xs:field xpath="@source"/> <xs:field xpath="@source"/>
@ -353,9 +340,6 @@
<xs:field xpath="@target"/> <xs:field xpath="@target"/>
</xs:unique> </xs:unique>
</xs:element> </xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- END MOUNTPOINTS --> <!-- END MOUNTPOINTS -->
</xs:all> </xs:all>
</xs:complexType> </xs:complexType>
@ -447,13 +431,13 @@
<xs:sequence> <xs:sequence>
<xs:element name="service" minOccurs="1" maxOccurs="unbounded" <xs:element name="service" minOccurs="1" maxOccurs="unbounded"
type="linux:t_service"/> type="linux:t_service"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="uniq_svc"> <xs:unique name="uniq_svc">
<xs:selector xpath="aif:service"/> <xs:selector xpath="aif:service"/>
<xs:field xpath="@name"/> <xs:field xpath="@name"/>
<xs:field xpath="@status"/> <xs:field xpath="@status"/>
</xs:unique> </xs:unique>
</xs:sequence>
</xs:complexType>
</xs:element> </xs:element>
</xs:all> </xs:all>
<xs:attribute name="timezone" type="std:t_nonempty" use="optional" default="UTC"/> <xs:attribute name="timezone" type="std:t_nonempty" use="optional" default="UTC"/>
@ -555,7 +539,6 @@
</xs:all> </xs:all>
<xs:attribute name="chrootPath" type="unix:t_filepath" use="required"/> <xs:attribute name="chrootPath" type="unix:t_filepath" use="required"/>
<xs:attribute name="reboot" type="xs:boolean" use="optional" default="false"/> <xs:attribute name="reboot" type="xs:boolean" use="optional" default="false"/>
<xs:attribute name="bootstrapTarball" type="std:t_uri" use="required"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>



View File

@ -206,22 +206,46 @@
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
<xs:attribute name="id" use="required" type="xs:ID"/> <xs:attribute name="id" use="required" type="xs:ID"/>
<xs:attribute name="name" use="required" type="aif:t_nonempty"/> <xs:attribute name="name" use="required" type="std:t_nonempty"/>
<xs:attribute name="meta" use="optional" default="1.2" <xs:attribute name="meta" use="optional" default="1.2" type="linux:t_raid_meta"/>
type="aif:t_raid_meta"/> <xs:attribute name="level" use="required" type="linux:t_raid_levels"/>
<xs:attribute name="level" use="required" type="aif:t_raid_levels"/>
<!-- KB *only*. --> <!-- KB *only*. -->
<!-- Can be pretty important! <!-- Can be pretty important!
https://www.zdnet.com/article/chunks-the-hidden-key-to-raid-performance/ --> https://www.zdnet.com/article/chunks-the-hidden-key-to-raid-performance/ -->
<xs:attribute name="chunkSize" use="optional" type="xs:positiveInteger" <xs:attribute name="chunkSize" use="optional" type="xs:positiveInteger"
default="512"/> default="512"/>
<xs:attribute name="layout" use="optional" type="aif:t_raid_layout" <xs:attribute name="layout" use="optional" type="linux:t_raid_layout"
default="none"/> default="none"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>


<xs:simpleType name="t_mountpath">
<xs:union memberTypes="unix:t_filepath">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="swap"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>

<xs:complexType name="t_mounts">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="mount" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="opt" minOccurs="1" maxOccurs="unbounded"
type="std:t_cmdopts"/>
</xs:sequence>
<xs:attribute name="source" type="xs:IDREF" use="required"/>
<xs:attribute name="target" type="linux:t_mountpath" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>

<xs:complexType name="t_nixpass"> <xs:complexType name="t_nixpass">
<xs:choice minOccurs="1" maxOccurs="1"> <xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="passwordPlain"> <xs:element name="passwordPlain">
@ -325,7 +349,7 @@
<xs:simpleType name="t_passwd_hashtypes"> <xs:simpleType name="t_passwd_hashtypes">
<xs:union memberTypes="unix:t_passwd_hashtypes"> <xs:union memberTypes="unix:t_passwd_hashtypes">
<xs:simpleType> <xs:simpleType>
<xs:restriction> <xs:restriction base="xs:string">
<!-- Unsupported in glibc. libxcrypt (https://github.com/besser82/libxcrypt/) has additional support. --> <!-- Unsupported in glibc. libxcrypt (https://github.com/besser82/libxcrypt/) has additional support. -->
<!-- bcrypt/blowfish are the same. --> <!-- bcrypt/blowfish are the same. -->
<!-- <xs:enumeration value="bcrypt"/> --> <!-- <xs:enumeration value="bcrypt"/> -->
@ -341,7 +365,7 @@
<xs:simpleType name="t_passwd_hashtypes_detect"> <xs:simpleType name="t_passwd_hashtypes_detect">
<xs:union memberTypes="linux:t_passwd_hashtypes"> <xs:union memberTypes="linux:t_passwd_hashtypes">
<xs:simpleType> <xs:simpleType>
<xs:restriction> <xs:restriction base="xs:string">
<xs:enumeration value="(detect)"/> <xs:enumeration value="(detect)"/>
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>
@ -407,7 +431,7 @@
<xs:simpleType name="t_shadowhash"> <xs:simpleType name="t_shadowhash">
<xs:union memberTypes="unix:t_shadowhash"> <xs:union memberTypes="unix:t_shadowhash">
<xs:simpleType> <xs:simpleType>
<xs:restriction> <xs:restriction base="xs:string">
<xs:pattern value="($5)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{43}"/><!-- sha256 --> <xs:pattern value="($5)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{43}"/><!-- sha256 -->
<xs:pattern value="($6)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{86}"/><!-- sha512 --> <xs:pattern value="($6)?($[a-zA-Z0-9./]{1,16})$[a-zA-Z0-9./]{86}"/><!-- sha512 -->
</xs:restriction> </xs:restriction>
@ -429,7 +453,7 @@
use="optional"/> use="optional"/>
</xs:complexType> </xs:complexType>
<xs:unique name="uniq_grp"> <xs:unique name="uniq_grp">
<xs:selector xpath="aif:xGroup"/> <xs:selector xpath="."/>
<xs:field xpath="@name"/> <xs:field xpath="@name"/>
</xs:unique> </xs:unique>
</xs:element> </xs:element>

View File

@ -2,11 +2,12 @@
<xs:schema targetNamespace="http://schema.xml.r00t2.io/net.xsd" <xs:schema targetNamespace="http://schema.xml.r00t2.io/net.xsd"
xmlns="http://schema.xml.r00t2.io/net.xsd" xmlns="http://schema.xml.r00t2.io/net.xsd"
xmlns:net="http://schema.xml.r00t2.io/net.xsd" xmlns:net="http://schema.xml.r00t2.io/net.xsd"
xmlns:std="http://schema.xml.r00t2.io/std.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" elementFormDefault="qualified"
attributeFormDefault="qualified"> attributeFormDefault="qualified">


<xs:import schemaLocation="http://schema.xml.r00t2.io/std.xsd"/> <xs:import namespace="http://schema.xml.r00t2.io/std.xsd" schemaLocation="http://schema.xml.r00t2.io/std.xsd"/>


<xs:simpleType name="t_addr_ip4"> <xs:simpleType name="t_addr_ip4">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">

View File

@ -13,6 +13,44 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>


<xs:complexType name="t_cksum">
<xs:simpleContent>
<xs:extension base="std:t_cksum_hashtypes">
<xs:attribute name="hashType" use="required" type="std:t_cksum_hashtypes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:complexType name="t_cksum_file">
<xs:simpleContent>
<xs:extension base="std:t_uri">
<xs:attribute name="hashType" use="required" type="std:t_cksum_hashtypes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="t_cksum_hashtypes">
<xs:restriction base="xs:string">
<xs:enumeration value="adler32"/>
<xs:enumeration value="crc32"/>
<xs:enumeration value="md5"/>
<xs:enumeration value="sha1"/>
<xs:enumeration value="sha224"/>
<xs:enumeration value="sha256"/>
<xs:enumeration value="sha384"/>
<xs:enumeration value="sha512"/>
<xs:enumeration value="blake2b"/>
<xs:enumeration value="blake22"/>
<xs:enumeration value="sha3_224"/>
<xs:enumeration value="sha3_256"/>
<xs:enumeration value="sha3_384"/>
<xs:enumeration value="sha3_512"/>
<xs:enumeration value="shake_128"/>
<xs:enumeration value="shake_256"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="t_cmdopts"> <xs:complexType name="t_cmdopts">
<xs:simpleContent> <xs:simpleContent>
<xs:extension base="xs:string"> <xs:extension base="xs:string">
@ -26,6 +64,29 @@
<xs:union memberTypes="xs:dateTime xs:positiveInteger"/> <xs:union memberTypes="xs:dateTime xs:positiveInteger"/>
</xs:simpleType> </xs:simpleType>


<xs:complexType name="t_gpg_keys">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="keyID" minOccurs="1" maxOccurs="unbounded" type="std:t_gpg_key_id"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="t_gpg_key_id">
<xs:restriction base="xs:string">
<xs:pattern value="(auto|default)"/><!-- Program should accept any key IDs it finds (INSECURE) -->
<xs:pattern value="(0x)?[0-9A-Fa-f]{40}"/><!-- Full key ID -->
<xs:pattern value="(0x)?[0-9A-Fa-f]{16}"/><!-- Shorthand key ID -->
<xs:pattern value="(0x)?[0-9A-Fa-f]{8}"/><!-- Legacy shorter shorthand -->
<xs:pattern value="([0-9A-Fa-f ]{4}){5} ?([0-9A-Fa-f ]{4}){4}[0-9A-Fa-f]{4}"/><!-- Fingerprint -->
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="t_gpg_sig">
<xs:restriction base="xs:string">
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="t_nonempty"> <xs:simpleType name="t_nonempty">
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">
<xs:minLength value="1"/> <xs:minLength value="1"/>
@ -39,4 +100,40 @@
</xs:restriction> </xs:restriction>
</xs:simpleType> </xs:simpleType>


<xs:complexType name="t_verifyfile">
<xs:all minOccurs="1">
<xs:element name="gpg" minOccurs="0" maxOccurs="1" type="std:t_verify_gpg">
<xs:unique name="uniq_gpg_sig">
<xs:selector xpath="std:signature"/>
<xs:field xpath="."/>
</xs:unique>
<xs:unique name="uniq_gpg_sigfile">
<xs:selector xpath="std:signatureFile"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
<xs:element name="hash" minOccurs="0" maxOccurs="1" type="std:t_verify_cksum"/>
</xs:all>
</xs:complexType>

<xs:complexType name="t_verify_cksum">
<xs:sequence>
<xs:element name="checksum" minOccurs="0" maxOccurs="unbounded" type="std:t_cksum"/>
<xs:element name="checksumFile" minOccurs="0" maxOccurs="unbounded" type="std:t_cksum_file"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="t_verify_gpg">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="signature" minOccurs="0" maxOccurs="unbounded" type="std:t_gpg_sig"/>
<xs:element name="signatureFile" minOccurs="0" maxOccurs="unbounded" type="std:t_uri"/>
<xs:element name="gpgKeyIDs" minOccurs="1" maxOccurs="1" type="std:t_gpg_keys">
<xs:unique name="uniq_key_id">
<xs:selector xpath="std:keyID"/>
<xs:field xpath="."/>
</xs:unique>
</xs:element>
</xs:choice>
</xs:complexType>

</xs:schema> </xs:schema>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<xs:schema targetNamespace="http://schema.xml.r00t2.io/sys.xsd" <xs:schema targetNamespace="http://schema.xml.r00t2.io/sys.xsd"
xmlns="http://schema.xml.r00t2.io/sys.xsd" xmlns="http://schema.xml.r00t2.io/sys.xsd"
xmlns:sys="http://schema.xml.r00t2.io/sys.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" elementFormDefault="qualified"
attributeFormDefault="qualified"> attributeFormDefault="qualified">