Skip to content

Commit

Permalink
[schemas] restrict all possible values for extension point attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
enen92 committed Aug 8, 2018
1 parent 542f6c4 commit a5d6270
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion addons/kodi.binary.instance.game/controller.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="kodi\.game\.controller"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
7 changes: 6 additions & 1 deletion addons/kodi.resource/images.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="extension">
<xs:complexType>
<xs:attribute name="point" type="xs:string" use="required"/>
<xs:attribute name="point" type="simpleIdentifier" use="required"/>
<xs:attribute name="compile" type="xs:boolean"/>
<xs:attribute name="type" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="kodi\.resource\.images"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
2 changes: 1 addition & 1 deletion addons/kodi.resource/language.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="kodi\.resource\.language"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
2 changes: 1 addition & 1 deletion addons/kodi.resource/uisounds.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="kodi\.resource\.uisounds"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
4 changes: 2 additions & 2 deletions addons/xbmc.addon/metadata.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="(kodi|xbmc)\.addon\.metadata"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="translatedString">
Expand All @@ -53,7 +53,7 @@
</xs:simpleType>
<xs:simpleType name="langIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]{2}(_[A-Z]{2}(@\S+)?)?"/>
<xs:pattern value="[a-z]{2,3}(_[A-Z]{2}(@\S+)?)?"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="assetsList">
Expand Down
2 changes: 1 addition & 1 deletion addons/xbmc.addon/repository.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</xs:complexType>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.addon\.repository"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
2 changes: 1 addition & 1 deletion addons/xbmc.gui/skin.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.gui\.skin"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
6 changes: 3 additions & 3 deletions addons/xbmc.metadata/scraper.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="extension">
<xs:complexType>
<xs:attribute name="point" type="xs:string" use="required"/>
<xs:attribute name="id" type="simpleIdentifier"/>
<xs:attribute name="point" type="simpleIdentifier" use="required"/>
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="library" type="xs:string" use="required"/>
<xs:attribute name="language" type="xs:string"/>
Expand All @@ -14,7 +14,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.metadata\.scraper\.(albums|artists|library|movies|musicvideos|tvshows)"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
6 changes: 3 additions & 3 deletions addons/xbmc.python/contextitem.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
</xs:complexType>
<xs:simpleType name="pointIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="kodi.context.item"/>
<xs:pattern value="kodi\.context\.item"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="menuIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="kodi.core.main|kodi.core.manage"/>
<xs:pattern value="kodi\.core\.(manage|main)"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
</xs:schema>
2 changes: 1 addition & 1 deletion addons/xbmc.python/pluginsource.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.python\.pluginsource"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="providesType">
Expand Down
2 changes: 1 addition & 1 deletion addons/xbmc.python/script.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.(python\.(library|lyrics|module|script|weather)|ui\.screensaver|subtitle\.module)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="providesList">
Expand Down
2 changes: 1 addition & 1 deletion addons/xbmc.python/service.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.service"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
2 changes: 1 addition & 1 deletion addons/xbmc.webinterface/webinterface.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</xs:element>
<xs:simpleType name="simpleIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[^.]+"/>
<xs:pattern value="xbmc\.webinterface"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="webinterfaceType">
Expand Down

0 comments on commit a5d6270

Please sign in to comment.