Skip to content

Commit 24a96ae

Browse files
committed
Enforce safe IDs in capabilities schema
1 parent 0d24669 commit 24a96ae

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/specifications/capabilities.xsd

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,22 @@
3636
</xs:attribute>
3737
</xs:complexType>
3838

39+
<xs:simpleType name="safe-id">
40+
<xs:restriction base="xs:string">
41+
<xs:pattern value="[a-zA-Z0-9 ._+\-]+"/>
42+
</xs:restriction>
43+
</xs:simpleType>
44+
3945
<xs:complexType name="capability" abstract="true">
4046
<xs:annotation>
4147
<xs:documentation>
4248
A capability tells the desktop environment what an application can do and in which fashion this can be represented to the user.
4349
</xs:documentation>
4450
</xs:annotation>
45-
<xs:attribute name="id" type="xs:string" use="required">
51+
<xs:attribute name="id" type="caps:safe-id" use="required">
4652
<xs:annotation>
4753
<xs:documentation>
48-
An ID that differentiates this capability from other capabilities of the same type within the feed. May only contain alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+).
54+
An ID that differentiates this capability from other capabilities of the same type within the feed.
4955
Also serves as a programmatic identifier within the desktop environment. In case of conflicts, the first capability listed with a specific ID will take precedence.
5056
</xs:documentation>
5157
</xs:annotation>
@@ -135,10 +141,10 @@
135141
</xs:annotation>
136142
</xs:element>
137143
</xs:choice>
138-
<xs:attribute name="name" type="xs:string" use="required">
144+
<xs:attribute name="name" type="caps:safe-id" use="required">
139145
<xs:annotation>
140146
<xs:documentation>
141-
The name of the verb. May only contain alphanumeric characters, spaces ( ), dots (.), underscores (_), hyphens (-) and plus signs (+).
147+
The name of the verb.
142148
Use canonical names to get automatic localization; specify &lt;description&gt; otherwise.
143149
</xs:documentation>
144150
</xs:annotation>

0 commit comments

Comments
 (0)