Regex functors, added regex options feature to schema.
[shibboleth/sp.git] / schemas / shibboleth-2.0-afp-mf-basic.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <schema targetNamespace="urn:mace:shibboleth:2.0:afp:mf:basic" xmlns="http://www.w3.org/2001/XMLSchema"
4     xmlns:basic="urn:mace:shibboleth:2.0:afp:mf:basic" xmlns:afp="urn:mace:shibboleth:2.0:afp">
5
6     <import namespace="urn:mace:shibboleth:2.0:afp" schemaLocation="classpath:/schema/shibboleth-2.0-afp.xsd" />
7
8     <!-- Blanket Match Function -->
9     <complexType name="ANY">
10         <annotation>
11             <documentation>A match function that evaluates to true.</documentation>
12         </annotation>
13         <complexContent>
14             <extension base="afp:MatchFunctorType" />
15         </complexContent>
16     </complexType>
17
18     <!--  Boolean Match Functions -->
19     <complexType name="AND">
20         <annotation>
21             <documentation>
22                 A match function that performs a logical AND on the results of all contained matching functions.
23             </documentation>
24         </annotation>
25         <complexContent>
26             <extension base="afp:MatchFunctorType">
27                 <choice minOccurs="2" maxOccurs="unbounded">
28                     <element name="Rule" type="afp:MatchFunctorType">
29                         <annotation>
30                             <documentation>
31                                 The set of match function rules to be ANDed.
32                             </documentation>
33                         </annotation>
34                     </element>
35                     <element name="RuleReference" type="afp:ReferenceType">
36                         <annotation>
37                             <documentation>
38                                 The set of match function rules to be ANDed.
39                             </documentation>
40                         </annotation>
41                     </element>
42                 </choice>
43             </extension>
44         </complexContent>
45     </complexType>
46
47     <complexType name="OR">
48         <annotation>
49             <documentation>
50                 A match function that performs a logical OR on the results of all contained matching functions.
51             </documentation>
52         </annotation>
53         <complexContent>
54             <extension base="afp:MatchFunctorType">
55                 <choice minOccurs="2" maxOccurs="unbounded">
56                     <element name="Rule" type="afp:MatchFunctorType">
57                         <annotation>
58                             <documentation>
59                                 The set of match function rules to be ANDed.
60                             </documentation>
61                         </annotation>
62                     </element>
63                     <element name="RuleReference" type="afp:ReferenceType">
64                         <annotation>
65                             <documentation>
66                                 The set of match function rules to be ANDed.
67                             </documentation>
68                         </annotation>
69                     </element>
70                 </choice>
71             </extension>
72         </complexContent>
73     </complexType>
74
75     <complexType name="NOT">
76         <annotation>
77             <documentation>
78                 A match function that performs a logical NOT on the resultof the contained matching function.
79             </documentation>
80         </annotation>
81         <complexContent>
82             <extension base="afp:MatchFunctorType">
83                 <choice>
84                     <element name="Rule" type="afp:MatchFunctorType">
85                         <annotation>
86                             <documentation>
87                                 The set of match function rules to be ANDed.
88                             </documentation>
89                         </annotation>
90                     </element>
91                     <element name="RuleReference" type="afp:ReferenceType">
92                         <annotation>
93                             <documentation>
94                                 The set of match function rules to be ANDed.
95                             </documentation>
96                         </annotation>
97                     </element>
98                 </choice>
99             </extension>
100         </complexContent>
101     </complexType>
102
103     <!--  Literal String Match Functions -->
104     <complexType name="AttributeRequesterString">
105         <annotation>
106             <documentation>
107                 A match function that matches the attribute request against the specified value.
108             </documentation>
109         </annotation>
110         <complexContent>
111             <extension base="basic:StringMatchType" />
112         </complexContent>
113     </complexType>
114
115     <complexType name="AttributeIssuerString">
116         <annotation>
117             <documentation>
118                 A match function that matches the attribute issuer against the specified value.
119             </documentation>
120         </annotation>
121         <complexContent>
122             <extension base="basic:StringMatchType" />
123         </complexContent>
124     </complexType>
125
126     <complexType name="PrincipalNameString">
127         <annotation>
128             <documentation>A match function that matches the principal name against the specified value.</documentation>
129         </annotation>
130         <complexContent>
131             <extension base="basic:StringMatchType" />
132         </complexContent>
133     </complexType>
134
135     <complexType name="AuthenticationMethodString">
136         <annotation>
137             <documentation>
138                 A match function that matches the authentication method against the specified value.
139             </documentation>
140         </annotation>
141         <complexContent>
142             <extension base="basic:StringMatchType" />
143         </complexContent>
144     </complexType>
145
146     <complexType name="AttributeValueString">
147         <annotation>
148             <documentation>
149                 A match function that matches the value of an attribute against the specified value. This match
150                 evaluates to true if the attribute contains the specified value.
151             </documentation>
152         </annotation>
153         <complexContent>
154             <extension base="basic:AttributeTargetedStringMatchType" />
155         </complexContent>
156     </complexType>
157
158     <complexType name="AttributeScopeString">
159         <annotation>
160             <documentation>
161                 A match function that matches the attribute scope against the specified value.
162             </documentation>
163         </annotation>
164         <complexContent>
165             <extension base="basic:AttributeTargetedStringMatchType" />
166         </complexContent>
167     </complexType>
168
169     <complexType name="AttributeTargetedStringMatchType" abstract="true">
170         <complexContent>
171             <extension base="basic:StringMatchType">
172                 <attribute name="attributeID" type="string">
173                     <annotation>
174                         <documentation>
175                             The ID of the attribute whose value should be matched. If no attribute ID is specified the
176                             ID of the containing attribute rule is assumed.
177                         </documentation>
178                     </annotation>
179                 </attribute>
180             </extension>
181         </complexContent>
182     </complexType>
183
184     <complexType name="StringMatchType" abstract="true">
185         <complexContent>
186             <extension base="afp:MatchFunctorType">
187                 <attribute name="value" type="string" use="required">
188                     <annotation>
189                         <documentation>The string value to match.</documentation>
190                     </annotation>
191                 </attribute>
192                 <attribute name="ignoreCase" type="boolean" default="false">
193                     <annotation>
194                         <documentation>
195                             A boolean flag indicating whether case should be ignored when evaluating the match.
196                         </documentation>
197                     </annotation>
198                 </attribute>
199             </extension>
200         </complexContent>
201     </complexType>
202
203     <!--  Regular Expression Match Functions -->
204     <complexType name="AttributeRequesterRegex">
205         <annotation>
206             <documentation>
207                 A match function that matches the attribute requester against the specified regular expression.
208             </documentation>
209         </annotation>
210         <complexContent>
211             <extension base="basic:RegexMatchType" />
212         </complexContent>
213     </complexType>
214
215     <complexType name="AttributeIssuerRegex">
216         <annotation>
217             <documentation>
218                 A match function that matches the attribute issuer against the specified regular expression.
219             </documentation>
220         </annotation>
221         <complexContent>
222             <extension base="basic:RegexMatchType" />
223         </complexContent>
224     </complexType>
225
226     <complexType name="PrincipalNameRegex">
227         <annotation>
228             <documentation>
229                 A match function that matches the principal name against the specified regular expression.
230             </documentation>
231         </annotation>
232         <complexContent>
233             <extension base="basic:RegexMatchType" />
234         </complexContent>
235     </complexType>
236
237     <complexType name="AuthenticationMethodRegex">
238         <annotation>
239             <documentation>
240                 A match function that matches the authentication method against the specified regular expression.
241             </documentation>
242         </annotation>
243         <complexContent>
244             <extension base="basic:RegexMatchType" />
245         </complexContent>
246     </complexType>
247
248     <complexType name="AttributeValueRegex">
249         <annotation>
250             <documentation>
251                 A match function that matches an attribute value against the specified regular expression. This function
252                 evaluates to true if any value matches the given expression
253             </documentation>
254         </annotation>
255         <complexContent>
256             <extension base="basic:AttributeTargetedRegexMatchType" />
257         </complexContent>
258     </complexType>
259
260     <complexType name="AttributeScopeRegex">
261         <annotation>
262             <documentation>
263                 A match function that matches the attribute scope against the specified regular expression.
264             </documentation>
265         </annotation>
266         <complexContent>
267             <extension base="basic:AttributeTargetedRegexMatchType" />
268         </complexContent>
269     </complexType>
270
271     <complexType name="AttributeTargetedRegexMatchType">
272         <complexContent>
273             <extension base="basic:RegexMatchType">
274                 <attribute name="attributeID" type="string">
275                     <annotation>
276                         <documentation>
277                             The ID of the attribute whose value should be matched. If no attribute ID is specified the
278                             ID of the containing attribute rule is assumed.
279                         </documentation>
280                     </annotation>
281                 </attribute>
282             </extension>
283         </complexContent>
284     </complexType>
285
286     <complexType name="RegexMatchType" abstract="true">
287         <complexContent>
288             <extension base="afp:MatchFunctorType">
289                 <attribute name="regex" type="string" use="required">
290                     <annotation>
291                         <documentation>The regular expression values are matched against.</documentation>
292                     </annotation>
293                 </attribute>
294                 <attribute name="options" type="string">
295                     <annotation>
296                         <documentation>The regular expression options to apply.</documentation>
297                     </annotation>
298                 </attribute>
299             </extension>
300         </complexContent>
301     </complexType>
302
303     <!-- Misc. Functions -->
304     <complexType name="Script">
305         <annotation>
306             <documentation>
307                 A match function that evaluates a script to determine if some criteria is met. The script MUST return a
308                 boolean.
309             </documentation>
310         </annotation>
311         <complexContent>
312             <extension base="afp:MatchFunctorType">
313                 <choice>
314                     <element name="Script" type="string" minOccurs="0">
315                         <annotation>
316                             <documentation>The script to evaluate to construct the attribute.</documentation>
317                         </annotation>
318                     </element>
319                     <element name="ScriptFile" type="string" minOccurs="0">
320                         <annotation>
321                             <documentation>
322                                 The filesystem path to the script to evaluate to construct the attribute.
323                             </documentation>
324                         </annotation>
325                     </element>
326                 </choice>
327                 <attribute name="language" type="string" default="javascript">
328                     <annotation>
329                         <documentation>
330                             The JSR-233 name for the scripting language that will be used. By default "javascript" is
331                             supported.
332                         </documentation>
333                     </annotation>
334                 </attribute>
335             </extension>
336         </complexContent>
337     </complexType>
338
339     <complexType name="NumberOfAttributeValues">
340         <annotation>
341             <documentation>
342                 A match function that evaluates to true if the given attribute has as a number of values that falls
343                 between the minimum and maximum. This method may be used as a sanity check to ensure that an unexpected
344                 number of values did not come from the attribute resolver and be released.
345             </documentation>
346         </annotation>
347         <complexContent>
348             <extension base="afp:MatchFunctorType">
349                 <attribute name="attributeID" type="string">
350                     <annotation>
351                         <documentation>The ID of the attribute whose value should be matched.</documentation>
352                     </annotation>
353                 </attribute>
354                 <attribute name="minimum" type="nonNegativeInteger" default="0">
355                     <annotation>
356                         <documentation>Minimum number of values an attribute may have.</documentation>
357                     </annotation>
358                 </attribute>
359                 <attribute name="maximum" type="positiveInteger" default="2147483647">
360                     <annotation>
361                         <documentation>Maximum number of values an attribute may have.</documentation>
362                     </annotation>
363                 </attribute>
364             </extension>
365         </complexContent>
366     </complexType>
367
368 </schema>