Merge lp:~canonical-isd-hackers/canonical-identity-provider/web_api-root into lp:~canonical-isd-hackers/canonical-identity-provider/web_api
- web_api-root
- Merge into web_api
Proposed by
David Owen
Status: | Work in progress |
---|---|
Proposed branch: | lp:~canonical-isd-hackers/canonical-identity-provider/web_api-root |
Merge into: | lp:~canonical-isd-hackers/canonical-identity-provider/web_api |
Diff against target: |
1513 lines (+1448/-3) 5 files modified
identityprovider/urls.py (+3/-0) identityprovider/webservice/urls.py (+13/-0) identityprovider/webservice/views.py (+49/-0) identityprovider/webservice/wadl.py (+1374/-0) identityprovider/wsgi.py (+9/-3) |
To merge this branch: | bzr merge lp:~canonical-isd-hackers/canonical-identity-provider/web_api-root |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Canonical ISD hackers | Pending | ||
Review via email: mp+48200@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'identityprovider/urls.py' |
2 | --- identityprovider/urls.py 2010-10-21 21:39:03 +0000 |
3 | +++ identityprovider/urls.py 2011-02-01 17:26:35 +0000 |
4 | @@ -125,6 +125,9 @@ |
5 | (r'^%(optional_token)s\+deactivate$' % repls, 'account_deactivate'), |
6 | ) |
7 | |
8 | +urlpatterns += patterns('', |
9 | + (r'^api/1.0/', include('identityprovider.webservice.urls'))) |
10 | + |
11 | # Keep this at the end, so no important URL will be overridden |
12 | if settings.BRAND.lower() == 'ubuntu': |
13 | urlpatterns += patterns('identityprovider.views.ui', |
14 | |
15 | === added file 'identityprovider/webservice/urls.py' |
16 | --- identityprovider/webservice/urls.py 1970-01-01 00:00:00 +0000 |
17 | +++ identityprovider/webservice/urls.py 2011-02-01 17:26:35 +0000 |
18 | @@ -0,0 +1,13 @@ |
19 | +# Copyright 2010 Canonical Ltd. This software is licensed under the |
20 | +# GNU Affero General Public License version 3 (see the file LICENSE). |
21 | + |
22 | +from django.conf.urls.defaults import * |
23 | +from django.conf import settings |
24 | + |
25 | +from piston.resource import Resource |
26 | + |
27 | +from . import views |
28 | + |
29 | + |
30 | +urlpatterns = patterns('identityprovider.webservice.views', |
31 | + (r'^$', views.root)) |
32 | |
33 | === added file 'identityprovider/webservice/views.py' |
34 | --- identityprovider/webservice/views.py 1970-01-01 00:00:00 +0000 |
35 | +++ identityprovider/webservice/views.py 2011-02-01 17:26:35 +0000 |
36 | @@ -0,0 +1,49 @@ |
37 | +from urlparse import urljoin |
38 | + |
39 | +from django.conf import settings |
40 | +from django.contrib.auth.decorators import login_required |
41 | +from django.core.urlresolvers import reverse |
42 | +from django.http import HttpResponse, HttpResponseRedirect |
43 | +from django.shortcuts import render_to_response, get_object_or_404 |
44 | +from django.template import RequestContext |
45 | +from django.utils.translation import ugettext as _ |
46 | + |
47 | +from piston.handler import BaseHandler |
48 | + |
49 | +import simplejson as json |
50 | + |
51 | +from identityprovider.auth import basic_authenticate, oauth_authenticate |
52 | +from identityprovider.models.captcha import Captcha |
53 | + |
54 | + |
55 | +def is_wadl_request(request): |
56 | + wadl_accept = set(['application/vnd.sun.wadl+xml', 'application/vd.sun.wadl+xml']) |
57 | + accept = set([s.strip() for s in request.META['HTTP_ACCEPT'].split(',')]) |
58 | + return not accept.isdisjoint(wadl_accept) |
59 | + |
60 | + |
61 | +def api_reverse(request, target, fragment=None): |
62 | + url = urljoin(settings.SSO_ROOT_URL, reverse(target)) |
63 | + if fragment is not None: |
64 | + url = urljoin(url, fragment) |
65 | + return url |
66 | + |
67 | + |
68 | +class JsonResponse(HttpResponse): |
69 | + def __init__(self, data, *args, **kwargs): |
70 | + super(JsonResponse, self).__init__(json.dumps(data), *args, **kwargs) |
71 | + self['Content-Type'] = 'application/json' |
72 | + |
73 | + |
74 | +def root(request): |
75 | + if is_wadl_request(request): |
76 | + from wadl import wadl |
77 | + return HttpResponse(wadl.replace('@@SERVICE_ROOT@@', api_reverse(request, root)), mimetype='application/vnd.sun.wadl+xml') |
78 | + |
79 | + return JsonResponse({ |
80 | + "registrations_collection_link": "http://openid.launchpad.dev/api/1.0/registration", |
81 | + "captchas_collection_link": "http://openid.launchpad.dev/api/1.0/captchas", |
82 | + "validations_collection_link": "http://openid.launchpad.dev/api/1.0/validation", |
83 | + "authentications_collection_link": "http://openid.launchpad.dev/api/1.0/authentications", |
84 | + "resource_type_link": api_reverse(request, root, fragment="#service-root"), |
85 | + "accounts_collection_link": "http://openid.launchpad.dev/api/1.0/accounts"}) |
86 | |
87 | === added file 'identityprovider/webservice/wadl.py' |
88 | --- identityprovider/webservice/wadl.py 1970-01-01 00:00:00 +0000 |
89 | +++ identityprovider/webservice/wadl.py 2011-02-01 17:26:35 +0000 |
90 | @@ -0,0 +1,1374 @@ |
91 | +wadl = r'''<?xml version="1.0"?> |
92 | +<!DOCTYPE application [ |
93 | + <!ENTITY nbsp "\ "> |
94 | +]> |
95 | +<wadl:application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
96 | + xmlns="http://research.sun.com/wadl/2006/10" |
97 | + xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
98 | + xmlns:wadl="http://research.sun.com/wadl/2006/10" |
99 | + xsi:schemaLocation="http://research.sun.com/wadl/2006/10/wadl.xsd"> |
100 | + <!-- Copyright 2010 Canonical Ltd. This software is licensed under the |
101 | + GNU Affero General Public License version 3 (see the file LICENSE). --> |
102 | + |
103 | + <!--There is one "service root" resource, located (as you'd expect) |
104 | + at the service root. This very document is the WADL |
105 | + representation of the "service root" resource.--> |
106 | + <wadl:resources base="@@SERVICE_ROOT@@/"> |
107 | + <wadl:resource path="" type="#service-root"/> |
108 | + </wadl:resources> |
109 | + |
110 | + <!--A "service root" resource responds to GET.--> |
111 | + <wadl:resource_type id="service-root"> |
112 | + <wadl:doc>The root of the web service.</wadl:doc> |
113 | + <wadl:method name="GET" id="service-root-get"> |
114 | + <wadl:response> |
115 | + <wadl:representation href="#service-root-json"/> |
116 | + <wadl:representation mediaType="application/vnd.sun.wadl+xml" id="service-root-wadl"/> |
117 | + </wadl:response> |
118 | + </wadl:method> |
119 | + </wadl:resource_type> |
120 | + |
121 | + <!--The JSON representation of a "service root" resource contains a |
122 | + number of links to collection-type resources.--> |
123 | + <wadl:representation mediaType="application/json" id="service-root-json"> |
124 | + |
125 | + <wadl:param style="plain" |
126 | + path="$['registrations_collection_link']" |
127 | + name="registrations_collection_link"> |
128 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#registrations"/> |
129 | + </wadl:param> |
130 | + |
131 | + |
132 | + <wadl:param style="plain" |
133 | + path="$['authentications_collection_link']" |
134 | + name="authentications_collection_link"> |
135 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#authentications"/> |
136 | + </wadl:param> |
137 | + |
138 | + |
139 | + <wadl:param style="plain" |
140 | + path="$['captchas_collection_link']" |
141 | + name="captchas_collection_link"> |
142 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#captchas"/> |
143 | + </wadl:param> |
144 | + |
145 | + |
146 | + <wadl:param style="plain" |
147 | + path="$['accounts_collection_link']" |
148 | + name="accounts_collection_link"> |
149 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#accounts"/> |
150 | + </wadl:param> |
151 | + |
152 | + |
153 | + <wadl:param style="plain" |
154 | + path="$['validations_collection_link']" |
155 | + name="validations_collection_link"> |
156 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#accounts"/> |
157 | + </wadl:param> |
158 | + |
159 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
160 | + <wadl:doc>The link to the WADL description of this resource.</wadl:doc> |
161 | + <wadl:link/> |
162 | + </wadl:param> |
163 | + </wadl:representation> |
164 | + |
165 | + <!--In addition to the service root, this document describes all the |
166 | + types of resources you might encounter as you browse this web |
167 | + service.--> |
168 | + |
169 | + <!--Begin resource_type definitions for collection resources.--> |
170 | + |
171 | + <wadl:resource_type id="accounts"> |
172 | + |
173 | + <wadl:method name="GET" id="accounts-get"> |
174 | + <wadl:response> |
175 | + <wadl:representation |
176 | + href="@@SERVICE_ROOT@@/#account-page"/> |
177 | + <wadl:representation |
178 | + mediaType="application/vnd.sun.wadl+xml" |
179 | + id="accounts-wadl"/> |
180 | + </wadl:response> |
181 | + </wadl:method> |
182 | + |
183 | + <wadl:method id="accounts-me" name="GET"> |
184 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
185 | +Get details for the currently authenticated user. |
186 | +</wadl:doc> |
187 | + <wadl:request> |
188 | + |
189 | + <wadl:param style="query" name="ws.op" |
190 | + required="true" fixed="me"> |
191 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
192 | + </wadl:param> |
193 | + |
194 | + </wadl:request> |
195 | + |
196 | + </wadl:method> |
197 | + <wadl:method id="accounts-team_memberships" name="GET"> |
198 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
199 | +Query account for team memberships |
200 | +</wadl:doc> |
201 | + <wadl:request> |
202 | + |
203 | + <wadl:param style="query" name="ws.op" |
204 | + required="true" |
205 | + fixed="team_memberships"> |
206 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
207 | + </wadl:param> |
208 | + <wadl:param style="query" required="true" |
209 | + name="team_names"> |
210 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
211 | +List of team names to check |
212 | +</wadl:doc> |
213 | + |
214 | + </wadl:param> |
215 | + |
216 | + </wadl:request> |
217 | + |
218 | + </wadl:method> |
219 | + <wadl:method id="accounts-validate_email" name="GET"> |
220 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
221 | +Validate email by sending token user received in email |
222 | +</wadl:doc> |
223 | + <wadl:request> |
224 | + |
225 | + <wadl:param style="query" name="ws.op" |
226 | + required="true" |
227 | + fixed="validate_email"> |
228 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
229 | + </wadl:param> |
230 | + <wadl:param style="query" required="true" |
231 | + name="email_token"> |
232 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
233 | +Email validation token. |
234 | +</wadl:doc> |
235 | + |
236 | + </wadl:param> |
237 | + |
238 | + </wadl:request> |
239 | + |
240 | + </wadl:method> |
241 | + </wadl:resource_type> |
242 | + |
243 | + |
244 | + |
245 | + <wadl:resource_type id="authentications"> |
246 | + |
247 | + <wadl:method name="GET" id="authentications-get"> |
248 | + <wadl:response> |
249 | + <wadl:representation |
250 | + href="@@SERVICE_ROOT@@/#authentication-page"/> |
251 | + <wadl:representation |
252 | + mediaType="application/vnd.sun.wadl+xml" |
253 | + id="authentications-wadl"/> |
254 | + </wadl:response> |
255 | + </wadl:method> |
256 | + |
257 | + <wadl:method id="authentications-me" name="GET"> |
258 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
259 | +Get details for the currently authenticated user. |
260 | +</wadl:doc> |
261 | + <wadl:request> |
262 | + |
263 | + <wadl:param style="query" name="ws.op" |
264 | + required="true" fixed="me"> |
265 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
266 | + </wadl:param> |
267 | + |
268 | + </wadl:request> |
269 | + |
270 | + </wadl:method> |
271 | + <wadl:method id="authentications-authenticate" |
272 | + name="GET"> |
273 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
274 | +Obtain OAuth token for logged in user |
275 | +</wadl:doc> |
276 | + <wadl:request> |
277 | + |
278 | + <wadl:param style="query" name="ws.op" |
279 | + required="true" fixed="authenticate"> |
280 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
281 | + </wadl:param> |
282 | + <wadl:param style="query" required="true" |
283 | + name="token_name"> |
284 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
285 | +Token name. |
286 | +</wadl:doc> |
287 | + |
288 | + </wadl:param> |
289 | + |
290 | + </wadl:request> |
291 | + |
292 | + </wadl:method> |
293 | + <wadl:method id="authentications-team_memberships" |
294 | + name="GET"> |
295 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
296 | +Query user for team memberships |
297 | +</wadl:doc> |
298 | + <wadl:request> |
299 | + |
300 | + <wadl:param style="query" name="ws.op" |
301 | + required="true" |
302 | + fixed="team_memberships"> |
303 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
304 | + </wadl:param> |
305 | + <wadl:param style="query" required="true" |
306 | + name="team_names"> |
307 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
308 | +List of team names to check |
309 | +</wadl:doc> |
310 | + |
311 | + </wadl:param> |
312 | + <wadl:param style="query" required="true" |
313 | + name="openid_identifier"> |
314 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
315 | +OpenID Identifier used for asking forteam memberships on behalf of other user. |
316 | +</wadl:doc> |
317 | + |
318 | + </wadl:param> |
319 | + |
320 | + </wadl:request> |
321 | + |
322 | + </wadl:method> |
323 | + <wadl:method id="authentications-validate_token" |
324 | + name="GET"> |
325 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
326 | +<p>Check that a token is valid.</p> |
327 | +<p>If valid, this method return the token and consumer secrets</p> |
328 | + |
329 | +</wadl:doc> |
330 | + <wadl:request> |
331 | + |
332 | + <wadl:param style="query" name="ws.op" |
333 | + required="true" |
334 | + fixed="validate_token"> |
335 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
336 | + </wadl:param> |
337 | + <wadl:param style="query" required="true" |
338 | + name="token"> |
339 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
340 | +The token you want to validate |
341 | +</wadl:doc> |
342 | + |
343 | + </wadl:param> |
344 | + <wadl:param style="query" required="true" |
345 | + name="consumer_key"> |
346 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
347 | +The consumer key (openid identifier) |
348 | +</wadl:doc> |
349 | + |
350 | + </wadl:param> |
351 | + |
352 | + </wadl:request> |
353 | + |
354 | + </wadl:method> |
355 | + <wadl:method id="authentications-account_by_openid" |
356 | + name="GET"> |
357 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
358 | +Retrieve account information based on OpenID identifier |
359 | +</wadl:doc> |
360 | + <wadl:request> |
361 | + |
362 | + <wadl:param style="query" name="ws.op" |
363 | + required="true" |
364 | + fixed="account_by_openid"> |
365 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
366 | + </wadl:param> |
367 | + <wadl:param style="query" required="true" |
368 | + name="openid"> |
369 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
370 | +OpenID Identifier of the account |
371 | +</wadl:doc> |
372 | + |
373 | + </wadl:param> |
374 | + |
375 | + </wadl:request> |
376 | + |
377 | + </wadl:method> |
378 | + <wadl:method id="authentications-validate_email" |
379 | + name="GET"> |
380 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
381 | +Validate email by sending token user received in email |
382 | +</wadl:doc> |
383 | + <wadl:request> |
384 | + |
385 | + <wadl:param style="query" name="ws.op" |
386 | + required="true" |
387 | + fixed="validate_email"> |
388 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
389 | + </wadl:param> |
390 | + <wadl:param style="query" required="true" |
391 | + name="email_token"> |
392 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
393 | +Email validation token. |
394 | +</wadl:doc> |
395 | + |
396 | + </wadl:param> |
397 | + |
398 | + </wadl:request> |
399 | + |
400 | + </wadl:method> |
401 | + <wadl:method id="authentications-account_by_email" |
402 | + name="GET"> |
403 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
404 | +Retrieve account information based on email address |
405 | +</wadl:doc> |
406 | + <wadl:request> |
407 | + |
408 | + <wadl:param style="query" name="ws.op" |
409 | + required="true" |
410 | + fixed="account_by_email"> |
411 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
412 | + </wadl:param> |
413 | + <wadl:param style="query" required="true" |
414 | + name="email"> |
415 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
416 | +Email address of the account |
417 | +</wadl:doc> |
418 | + |
419 | + </wadl:param> |
420 | + |
421 | + </wadl:request> |
422 | + |
423 | + </wadl:method> |
424 | + <wadl:method id="authentications-list_tokens" |
425 | + name="GET"> |
426 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
427 | +Get the currently valid tokens for a given user |
428 | +</wadl:doc> |
429 | + <wadl:request> |
430 | + |
431 | + <wadl:param style="query" name="ws.op" |
432 | + required="true" fixed="list_tokens"> |
433 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
434 | + </wadl:param> |
435 | + <wadl:param style="query" required="true" |
436 | + name="consumer_key"> |
437 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
438 | +User's OpenID identifier |
439 | +</wadl:doc> |
440 | + |
441 | + </wadl:param> |
442 | + |
443 | + </wadl:request> |
444 | + |
445 | + </wadl:method> |
446 | + <wadl:method id="authentications-invalidate_token" |
447 | + name="POST"> |
448 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
449 | +Make the given token invalid |
450 | +</wadl:doc> |
451 | + <wadl:request> |
452 | + <wadl:representation |
453 | + mediaType="application/x-www-form-urlencoded"> |
454 | + <wadl:param style="query" name="ws.op" |
455 | + required="true" |
456 | + fixed="invalidate_token"> |
457 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
458 | + </wadl:param> |
459 | + <wadl:param style="query" required="true" |
460 | + name="token"> |
461 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
462 | +The token you want to invalidate |
463 | +</wadl:doc> |
464 | + |
465 | + </wadl:param> |
466 | + <wadl:param style="query" required="true" |
467 | + name="consumer_key"> |
468 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
469 | +The consumer key (openid identifier) |
470 | +</wadl:doc> |
471 | + |
472 | + </wadl:param> |
473 | + </wadl:representation> |
474 | + </wadl:request> |
475 | + |
476 | + </wadl:method> |
477 | + </wadl:resource_type> |
478 | + |
479 | + |
480 | + |
481 | + <wadl:resource_type id="captchas"> |
482 | + |
483 | + <wadl:method name="GET" id="captchas-get"> |
484 | + <wadl:response> |
485 | + <wadl:representation |
486 | + href="@@SERVICE_ROOT@@/#captcha-page"/> |
487 | + <wadl:representation |
488 | + mediaType="application/vnd.sun.wadl+xml" |
489 | + id="captchas-wadl"/> |
490 | + </wadl:response> |
491 | + </wadl:method> |
492 | + |
493 | + <wadl:method id="captchas-new" name="POST"> |
494 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
495 | +Generate a new captcha |
496 | +</wadl:doc> |
497 | + <wadl:request> |
498 | + <wadl:representation |
499 | + mediaType="application/x-www-form-urlencoded"> |
500 | + <wadl:param style="query" name="ws.op" |
501 | + required="true" fixed="new"> |
502 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
503 | + </wadl:param> |
504 | + </wadl:representation> |
505 | + </wadl:request> |
506 | + |
507 | + </wadl:method> |
508 | + </wadl:resource_type> |
509 | + |
510 | + |
511 | + |
512 | + <wadl:resource_type id="registrations"> |
513 | + |
514 | + <wadl:method name="GET" id="registrations-get"> |
515 | + <wadl:response> |
516 | + <wadl:representation |
517 | + href="@@SERVICE_ROOT@@/#registration-page"/> |
518 | + <wadl:representation |
519 | + mediaType="application/vnd.sun.wadl+xml" |
520 | + id="registrations-wadl"/> |
521 | + </wadl:response> |
522 | + </wadl:method> |
523 | + |
524 | + <wadl:method id="registrations-me" name="GET"> |
525 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
526 | +Get details for the currently authenticated user. |
527 | +</wadl:doc> |
528 | + <wadl:request> |
529 | + |
530 | + <wadl:param style="query" name="ws.op" |
531 | + required="true" fixed="me"> |
532 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
533 | + </wadl:param> |
534 | + |
535 | + </wadl:request> |
536 | + |
537 | + </wadl:method> |
538 | + <wadl:method id="registrations-team_memberships" |
539 | + name="GET"> |
540 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
541 | +Query account for team memberships |
542 | +</wadl:doc> |
543 | + <wadl:request> |
544 | + |
545 | + <wadl:param style="query" name="ws.op" |
546 | + required="true" |
547 | + fixed="team_memberships"> |
548 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
549 | + </wadl:param> |
550 | + <wadl:param style="query" required="true" |
551 | + name="team_names"> |
552 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
553 | +List of team names to check |
554 | +</wadl:doc> |
555 | + |
556 | + </wadl:param> |
557 | + |
558 | + </wadl:request> |
559 | + |
560 | + </wadl:method> |
561 | + <wadl:method id="registrations-validate_email" |
562 | + name="GET"> |
563 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
564 | +Validate email by sending token user received in email |
565 | +</wadl:doc> |
566 | + <wadl:request> |
567 | + |
568 | + <wadl:param style="query" name="ws.op" |
569 | + required="true" |
570 | + fixed="validate_email"> |
571 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
572 | + </wadl:param> |
573 | + <wadl:param style="query" required="true" |
574 | + name="email_token"> |
575 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
576 | +Email validation token. |
577 | +</wadl:doc> |
578 | + |
579 | + </wadl:param> |
580 | + |
581 | + </wadl:request> |
582 | + |
583 | + </wadl:method> |
584 | + <wadl:method id="registrations-request_password_reset_token" |
585 | + name="POST"> |
586 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
587 | +Request password reset code to be sent to the email |
588 | +</wadl:doc> |
589 | + <wadl:request> |
590 | + <wadl:representation |
591 | + mediaType="application/x-www-form-urlencoded"> |
592 | + <wadl:param style="query" name="ws.op" |
593 | + required="true" |
594 | + fixed="request_password_reset_token"> |
595 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
596 | + </wadl:param> |
597 | + <wadl:param style="query" required="true" |
598 | + name="email"> |
599 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
600 | +Email address. |
601 | +</wadl:doc> |
602 | + |
603 | + </wadl:param> |
604 | + </wadl:representation> |
605 | + </wadl:request> |
606 | + |
607 | + </wadl:method> |
608 | + <wadl:method id="registrations-set_new_password" |
609 | + name="POST"> |
610 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
611 | +Set new password for given user |
612 | +</wadl:doc> |
613 | + <wadl:request> |
614 | + <wadl:representation |
615 | + mediaType="application/x-www-form-urlencoded"> |
616 | + <wadl:param style="query" name="ws.op" |
617 | + required="true" |
618 | + fixed="set_new_password"> |
619 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
620 | + </wadl:param> |
621 | + <wadl:param style="query" required="true" |
622 | + name="new_password"> |
623 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
624 | +New password |
625 | +</wadl:doc> |
626 | + |
627 | + </wadl:param> |
628 | + <wadl:param style="query" required="true" |
629 | + name="token"> |
630 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
631 | +Password reset token. |
632 | +</wadl:doc> |
633 | + |
634 | + </wadl:param> |
635 | + <wadl:param style="query" required="true" |
636 | + name="email"> |
637 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
638 | +Email address. |
639 | +</wadl:doc> |
640 | + |
641 | + </wadl:param> |
642 | + </wadl:representation> |
643 | + </wadl:request> |
644 | + |
645 | + </wadl:method> |
646 | + <wadl:method id="registrations-register" name="POST"> |
647 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
648 | +Generate a new captcha |
649 | +</wadl:doc> |
650 | + <wadl:request> |
651 | + <wadl:representation |
652 | + mediaType="application/x-www-form-urlencoded"> |
653 | + <wadl:param style="query" name="ws.op" |
654 | + required="true" fixed="register"> |
655 | + <wadl:doc>The name of the operation being invoked.</wadl:doc> |
656 | + </wadl:param> |
657 | + <wadl:param style="query" required="true" |
658 | + name="captcha_solution"> |
659 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
660 | +Solution for the generated captcha. |
661 | +</wadl:doc> |
662 | + |
663 | + </wadl:param> |
664 | + <wadl:param style="query" required="true" |
665 | + name="password"> |
666 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
667 | +Password should be at least 8 characters long and contain at least one uppercase letter and a number. |
668 | +</wadl:doc> |
669 | + |
670 | + </wadl:param> |
671 | + <wadl:param style="query" required="true" |
672 | + name="captcha_id"> |
673 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
674 | +ID for the generated captcha |
675 | +</wadl:doc> |
676 | + |
677 | + </wadl:param> |
678 | + <wadl:param style="query" required="true" |
679 | + name="email"> |
680 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
681 | +Email address. |
682 | +</wadl:doc> |
683 | + |
684 | + </wadl:param> |
685 | + </wadl:representation> |
686 | + </wadl:request> |
687 | + |
688 | + </wadl:method> |
689 | + </wadl:resource_type> |
690 | + |
691 | + |
692 | + <!--End resource_type definitions for collection resources.--> |
693 | + |
694 | + <!--Begin representation and resource_type definitions for entry |
695 | + resources and the collections that contain them. --> |
696 | + |
697 | + <wadl:resource_type id="account"> |
698 | + |
699 | + <wadl:method name="GET" id="account-get"> |
700 | + <wadl:response> |
701 | + <wadl:representation |
702 | + href="@@SERVICE_ROOT@@/#account-full"/> |
703 | + <wadl:representation |
704 | + mediaType="application/xhtml+xml" id="account-xhtml"/> |
705 | + <wadl:representation |
706 | + mediaType="application/vnd.sun.wadl+xml" |
707 | + id="account-wadl"/> |
708 | + </wadl:response> |
709 | + </wadl:method> |
710 | + |
711 | + <wadl:method name="PUT" id="account-put"> |
712 | + <wadl:request> |
713 | + <wadl:representation |
714 | + href="@@SERVICE_ROOT@@/#account-full"/> |
715 | + </wadl:request> |
716 | + </wadl:method> |
717 | + |
718 | + <wadl:method name="PATCH" id="account-patch"> |
719 | + <wadl:request> |
720 | + <wadl:representation |
721 | + href="@@SERVICE_ROOT@@/#account-diff"/> |
722 | + </wadl:request> |
723 | + </wadl:method> |
724 | + |
725 | + |
726 | + |
727 | + </wadl:resource_type> |
728 | + |
729 | + |
730 | + <wadl:representation mediaType="application/json" |
731 | + id="account-full"> |
732 | + <wadl:param style="plain" name="self_link" path="$['self_link']"> |
733 | + <wadl:doc>The canonical link to this resource.</wadl:doc> |
734 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#account"/> |
735 | + </wadl:param> |
736 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
737 | + <wadl:doc> |
738 | + The link to the WADL description of this resource. |
739 | + </wadl:doc> |
740 | + <wadl:link/> |
741 | + </wadl:param> |
742 | + <wadl:param style="plain" name="http_etag" path="$['http_etag']"> |
743 | + <wadl:doc> |
744 | + The value of the HTTP ETag for this resource. |
745 | + </wadl:doc> |
746 | + </wadl:param> |
747 | + <wadl:param style="plain" required="true" |
748 | + path="$['preferred_email']" |
749 | + name="preferred_email"> |
750 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
751 | +Primary email address |
752 | +</wadl:doc> |
753 | + |
754 | + </wadl:param> |
755 | + <wadl:param style="plain" required="true" |
756 | + path="$['unverified_emails']" |
757 | + name="unverified_emails"> |
758 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
759 | +List of unverified emails |
760 | +</wadl:doc> |
761 | + |
762 | + </wadl:param> |
763 | + <wadl:param style="plain" required="true" |
764 | + path="$['id']" name="id"> |
765 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
766 | +Account ID |
767 | +</wadl:doc> |
768 | + |
769 | + </wadl:param> |
770 | + <wadl:param style="plain" required="true" |
771 | + path="$['verified_emails']" |
772 | + name="verified_emails"> |
773 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
774 | +List of verified emails |
775 | +</wadl:doc> |
776 | + |
777 | + </wadl:param> |
778 | + </wadl:representation> |
779 | + |
780 | + <wadl:representation mediaType="application/json" |
781 | + id="account-diff"> |
782 | + <wadl:param style="plain" required="false" |
783 | + path="$['preferred_email']" |
784 | + name="preferred_email"> |
785 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
786 | +Primary email address |
787 | +</wadl:doc> |
788 | + |
789 | + </wadl:param> |
790 | + <wadl:param style="plain" required="false" |
791 | + path="$['unverified_emails']" |
792 | + name="unverified_emails"> |
793 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
794 | +List of unverified emails |
795 | +</wadl:doc> |
796 | + |
797 | + </wadl:param> |
798 | + <wadl:param style="plain" required="false" |
799 | + path="$['id']" name="id"> |
800 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
801 | +Account ID |
802 | +</wadl:doc> |
803 | + |
804 | + </wadl:param> |
805 | + <wadl:param style="plain" required="false" |
806 | + path="$['verified_emails']" |
807 | + name="verified_emails"> |
808 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
809 | +List of verified emails |
810 | +</wadl:doc> |
811 | + |
812 | + </wadl:param> |
813 | + </wadl:representation> |
814 | + |
815 | + <!--Collection page for this type of entry--> |
816 | + <wadl:resource_type id="account-page-resource"> |
817 | + <wadl:method name="GET" id="account-page-resource-get"> |
818 | + <wadl:response> |
819 | + <wadl:representation href="#account-page"/> |
820 | + </wadl:response> |
821 | + </wadl:method> |
822 | + </wadl:resource_type> |
823 | + |
824 | + <wadl:representation mediaType="application/json" |
825 | + id="account-page"> |
826 | + |
827 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
828 | + <wadl:link/> |
829 | + </wadl:param> |
830 | + |
831 | + <wadl:param style="plain" name="total_size" path="$['total_size']" required="true"/> |
832 | + |
833 | + <wadl:param style="plain" name="start" path="$['start']" required="true"/> |
834 | + |
835 | + <wadl:param style="plain" name="next_collection_link" path="$['next_collection_link']"> |
836 | + <wadl:link resource_type="#account-page-resource"/> |
837 | + </wadl:param> |
838 | + |
839 | + <wadl:param style="plain" name="prev_collection_link" path="$['prev_collection_link']"> |
840 | + <wadl:link resource_type="#account-page-resource"/> |
841 | + </wadl:param> |
842 | + |
843 | + <wadl:param style="plain" name="entries" path="$['entries']" required="true"/> |
844 | + |
845 | + <wadl:param style="plain" name="entry_links" path="$['entries'][*]['self_link']"> |
846 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#account"/> |
847 | + </wadl:param> |
848 | + </wadl:representation> |
849 | + |
850 | + |
851 | + |
852 | + <wadl:resource_type id="authentication"> |
853 | + |
854 | + <wadl:method name="GET" id="authentication-get"> |
855 | + <wadl:response> |
856 | + <wadl:representation |
857 | + href="@@SERVICE_ROOT@@/#authentication-full"/> |
858 | + <wadl:representation |
859 | + mediaType="application/xhtml+xml" |
860 | + id="authentication-xhtml"/> |
861 | + <wadl:representation |
862 | + mediaType="application/vnd.sun.wadl+xml" |
863 | + id="authentication-wadl"/> |
864 | + </wadl:response> |
865 | + </wadl:method> |
866 | + |
867 | + <wadl:method name="PUT" id="authentication-put"> |
868 | + <wadl:request> |
869 | + <wadl:representation |
870 | + href="@@SERVICE_ROOT@@/#authentication-full"/> |
871 | + </wadl:request> |
872 | + </wadl:method> |
873 | + |
874 | + <wadl:method name="PATCH" id="authentication-patch"> |
875 | + <wadl:request> |
876 | + <wadl:representation |
877 | + href="@@SERVICE_ROOT@@/#authentication-diff"/> |
878 | + </wadl:request> |
879 | + </wadl:method> |
880 | + |
881 | + |
882 | + |
883 | + </wadl:resource_type> |
884 | + |
885 | + |
886 | + <wadl:representation mediaType="application/json" |
887 | + id="authentication-full"> |
888 | + <wadl:param style="plain" name="self_link" path="$['self_link']"> |
889 | + <wadl:doc>The canonical link to this resource.</wadl:doc> |
890 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#authentication"/> |
891 | + </wadl:param> |
892 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
893 | + <wadl:doc> |
894 | + The link to the WADL description of this resource. |
895 | + </wadl:doc> |
896 | + <wadl:link/> |
897 | + </wadl:param> |
898 | + <wadl:param style="plain" name="http_etag" path="$['http_etag']"> |
899 | + <wadl:doc> |
900 | + The value of the HTTP ETag for this resource. |
901 | + </wadl:doc> |
902 | + </wadl:param> |
903 | + <wadl:param style="plain" required="true" |
904 | + path="$['preferred_email']" |
905 | + name="preferred_email"> |
906 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
907 | +Primary email address |
908 | +</wadl:doc> |
909 | + |
910 | + </wadl:param> |
911 | + <wadl:param style="plain" required="true" |
912 | + path="$['unverified_emails']" |
913 | + name="unverified_emails"> |
914 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
915 | +List of unverified emails |
916 | +</wadl:doc> |
917 | + |
918 | + </wadl:param> |
919 | + <wadl:param style="plain" required="true" |
920 | + path="$['id']" name="id"> |
921 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
922 | +Account ID |
923 | +</wadl:doc> |
924 | + |
925 | + </wadl:param> |
926 | + <wadl:param style="plain" required="true" |
927 | + path="$['verified_emails']" |
928 | + name="verified_emails"> |
929 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
930 | +List of verified emails |
931 | +</wadl:doc> |
932 | + |
933 | + </wadl:param> |
934 | + </wadl:representation> |
935 | + |
936 | + <wadl:representation mediaType="application/json" |
937 | + id="authentication-diff"> |
938 | + <wadl:param style="plain" required="false" |
939 | + path="$['preferred_email']" |
940 | + name="preferred_email"> |
941 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
942 | +Primary email address |
943 | +</wadl:doc> |
944 | + |
945 | + </wadl:param> |
946 | + <wadl:param style="plain" required="false" |
947 | + path="$['unverified_emails']" |
948 | + name="unverified_emails"> |
949 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
950 | +List of unverified emails |
951 | +</wadl:doc> |
952 | + |
953 | + </wadl:param> |
954 | + <wadl:param style="plain" required="false" |
955 | + path="$['id']" name="id"> |
956 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
957 | +Account ID |
958 | +</wadl:doc> |
959 | + |
960 | + </wadl:param> |
961 | + <wadl:param style="plain" required="false" |
962 | + path="$['verified_emails']" |
963 | + name="verified_emails"> |
964 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
965 | +List of verified emails |
966 | +</wadl:doc> |
967 | + |
968 | + </wadl:param> |
969 | + </wadl:representation> |
970 | + |
971 | + <!--Collection page for this type of entry--> |
972 | + <wadl:resource_type id="authentication-page-resource"> |
973 | + <wadl:method name="GET" |
974 | + id="authentication-page-resource-get"> |
975 | + <wadl:response> |
976 | + <wadl:representation href="#authentication-page"/> |
977 | + </wadl:response> |
978 | + </wadl:method> |
979 | + </wadl:resource_type> |
980 | + |
981 | + <wadl:representation mediaType="application/json" |
982 | + id="authentication-page"> |
983 | + |
984 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
985 | + <wadl:link/> |
986 | + </wadl:param> |
987 | + |
988 | + <wadl:param style="plain" name="total_size" path="$['total_size']" required="true"/> |
989 | + |
990 | + <wadl:param style="plain" name="start" path="$['start']" required="true"/> |
991 | + |
992 | + <wadl:param style="plain" name="next_collection_link" path="$['next_collection_link']"> |
993 | + <wadl:link resource_type="#authentication-page-resource"/> |
994 | + </wadl:param> |
995 | + |
996 | + <wadl:param style="plain" name="prev_collection_link" path="$['prev_collection_link']"> |
997 | + <wadl:link resource_type="#authentication-page-resource"/> |
998 | + </wadl:param> |
999 | + |
1000 | + <wadl:param style="plain" name="entries" path="$['entries']" required="true"/> |
1001 | + |
1002 | + <wadl:param style="plain" name="entry_links" path="$['entries'][*]['self_link']"> |
1003 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#authentication"/> |
1004 | + </wadl:param> |
1005 | + </wadl:representation> |
1006 | + |
1007 | + |
1008 | + |
1009 | + <wadl:resource_type id="captcha"> |
1010 | + |
1011 | + <wadl:method name="GET" id="captcha-get"> |
1012 | + <wadl:response> |
1013 | + <wadl:representation |
1014 | + href="@@SERVICE_ROOT@@/#captcha-full"/> |
1015 | + <wadl:representation |
1016 | + mediaType="application/xhtml+xml" id="captcha-xhtml"/> |
1017 | + <wadl:representation |
1018 | + mediaType="application/vnd.sun.wadl+xml" |
1019 | + id="captcha-wadl"/> |
1020 | + </wadl:response> |
1021 | + </wadl:method> |
1022 | + |
1023 | + <wadl:method name="PUT" id="captcha-put"> |
1024 | + <wadl:request> |
1025 | + <wadl:representation |
1026 | + href="@@SERVICE_ROOT@@/#captcha-full"/> |
1027 | + </wadl:request> |
1028 | + </wadl:method> |
1029 | + |
1030 | + <wadl:method name="PATCH" id="captcha-patch"> |
1031 | + <wadl:request> |
1032 | + <wadl:representation |
1033 | + href="@@SERVICE_ROOT@@/#captcha-diff"/> |
1034 | + </wadl:request> |
1035 | + </wadl:method> |
1036 | + |
1037 | + |
1038 | + |
1039 | + </wadl:resource_type> |
1040 | + |
1041 | + |
1042 | + <wadl:representation mediaType="application/json" |
1043 | + id="captcha-full"> |
1044 | + <wadl:param style="plain" name="self_link" path="$['self_link']"> |
1045 | + <wadl:doc>The canonical link to this resource.</wadl:doc> |
1046 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#captcha"/> |
1047 | + </wadl:param> |
1048 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
1049 | + <wadl:doc> |
1050 | + The link to the WADL description of this resource. |
1051 | + </wadl:doc> |
1052 | + <wadl:link/> |
1053 | + </wadl:param> |
1054 | + <wadl:param style="plain" name="http_etag" path="$['http_etag']"> |
1055 | + <wadl:doc> |
1056 | + The value of the HTTP ETag for this resource. |
1057 | + </wadl:doc> |
1058 | + </wadl:param> |
1059 | + <wadl:param style="plain" required="true" |
1060 | + path="$['content']" name="content"> |
1061 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1062 | +Captcha content |
1063 | +</wadl:doc> |
1064 | + |
1065 | + </wadl:param> |
1066 | + <wadl:param style="plain" required="true" |
1067 | + path="$['id']" name="id"> |
1068 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1069 | +Captcha ID |
1070 | +</wadl:doc> |
1071 | + |
1072 | + </wadl:param> |
1073 | + </wadl:representation> |
1074 | + |
1075 | + <wadl:representation mediaType="application/json" |
1076 | + id="captcha-diff"> |
1077 | + <wadl:param style="plain" required="false" |
1078 | + path="$['content']" name="content"> |
1079 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1080 | +Captcha content |
1081 | +</wadl:doc> |
1082 | + |
1083 | + </wadl:param> |
1084 | + <wadl:param style="plain" required="false" |
1085 | + path="$['id']" name="id"> |
1086 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1087 | +Captcha ID |
1088 | +</wadl:doc> |
1089 | + |
1090 | + </wadl:param> |
1091 | + </wadl:representation> |
1092 | + |
1093 | + <!--Collection page for this type of entry--> |
1094 | + <wadl:resource_type id="captcha-page-resource"> |
1095 | + <wadl:method name="GET" id="captcha-page-resource-get"> |
1096 | + <wadl:response> |
1097 | + <wadl:representation href="#captcha-page"/> |
1098 | + </wadl:response> |
1099 | + </wadl:method> |
1100 | + </wadl:resource_type> |
1101 | + |
1102 | + <wadl:representation mediaType="application/json" |
1103 | + id="captcha-page"> |
1104 | + |
1105 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
1106 | + <wadl:link/> |
1107 | + </wadl:param> |
1108 | + |
1109 | + <wadl:param style="plain" name="total_size" path="$['total_size']" required="true"/> |
1110 | + |
1111 | + <wadl:param style="plain" name="start" path="$['start']" required="true"/> |
1112 | + |
1113 | + <wadl:param style="plain" name="next_collection_link" path="$['next_collection_link']"> |
1114 | + <wadl:link resource_type="#captcha-page-resource"/> |
1115 | + </wadl:param> |
1116 | + |
1117 | + <wadl:param style="plain" name="prev_collection_link" path="$['prev_collection_link']"> |
1118 | + <wadl:link resource_type="#captcha-page-resource"/> |
1119 | + </wadl:param> |
1120 | + |
1121 | + <wadl:param style="plain" name="entries" path="$['entries']" required="true"/> |
1122 | + |
1123 | + <wadl:param style="plain" name="entry_links" path="$['entries'][*]['self_link']"> |
1124 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#captcha"/> |
1125 | + </wadl:param> |
1126 | + </wadl:representation> |
1127 | + |
1128 | + |
1129 | + |
1130 | + <wadl:resource_type id="registration"> |
1131 | + |
1132 | + <wadl:method name="GET" id="registration-get"> |
1133 | + <wadl:response> |
1134 | + <wadl:representation |
1135 | + href="@@SERVICE_ROOT@@/#registration-full"/> |
1136 | + <wadl:representation |
1137 | + mediaType="application/xhtml+xml" |
1138 | + id="registration-xhtml"/> |
1139 | + <wadl:representation |
1140 | + mediaType="application/vnd.sun.wadl+xml" |
1141 | + id="registration-wadl"/> |
1142 | + </wadl:response> |
1143 | + </wadl:method> |
1144 | + |
1145 | + <wadl:method name="PUT" id="registration-put"> |
1146 | + <wadl:request> |
1147 | + <wadl:representation |
1148 | + href="@@SERVICE_ROOT@@/#registration-full"/> |
1149 | + </wadl:request> |
1150 | + </wadl:method> |
1151 | + |
1152 | + <wadl:method name="PATCH" id="registration-patch"> |
1153 | + <wadl:request> |
1154 | + <wadl:representation |
1155 | + href="@@SERVICE_ROOT@@/#registration-diff"/> |
1156 | + </wadl:request> |
1157 | + </wadl:method> |
1158 | + |
1159 | + |
1160 | + |
1161 | + </wadl:resource_type> |
1162 | + |
1163 | + |
1164 | + <wadl:representation mediaType="application/json" |
1165 | + id="registration-full"> |
1166 | + <wadl:param style="plain" name="self_link" path="$['self_link']"> |
1167 | + <wadl:doc>The canonical link to this resource.</wadl:doc> |
1168 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#registration"/> |
1169 | + </wadl:param> |
1170 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
1171 | + <wadl:doc> |
1172 | + The link to the WADL description of this resource. |
1173 | + </wadl:doc> |
1174 | + <wadl:link/> |
1175 | + </wadl:param> |
1176 | + <wadl:param style="plain" name="http_etag" path="$['http_etag']"> |
1177 | + <wadl:doc> |
1178 | + The value of the HTTP ETag for this resource. |
1179 | + </wadl:doc> |
1180 | + </wadl:param> |
1181 | + <wadl:param style="plain" required="true" |
1182 | + path="$['preferred_email']" |
1183 | + name="preferred_email"> |
1184 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1185 | +Primary email address |
1186 | +</wadl:doc> |
1187 | + |
1188 | + </wadl:param> |
1189 | + <wadl:param style="plain" required="true" |
1190 | + path="$['unverified_emails']" |
1191 | + name="unverified_emails"> |
1192 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1193 | +List of unverified emails |
1194 | +</wadl:doc> |
1195 | + |
1196 | + </wadl:param> |
1197 | + <wadl:param style="plain" required="true" |
1198 | + path="$['id']" name="id"> |
1199 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1200 | +Account ID |
1201 | +</wadl:doc> |
1202 | + |
1203 | + </wadl:param> |
1204 | + <wadl:param style="plain" required="true" |
1205 | + path="$['verified_emails']" |
1206 | + name="verified_emails"> |
1207 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1208 | +List of verified emails |
1209 | +</wadl:doc> |
1210 | + |
1211 | + </wadl:param> |
1212 | + </wadl:representation> |
1213 | + |
1214 | + <wadl:representation mediaType="application/json" |
1215 | + id="registration-diff"> |
1216 | + <wadl:param style="plain" required="false" |
1217 | + path="$['preferred_email']" |
1218 | + name="preferred_email"> |
1219 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1220 | +Primary email address |
1221 | +</wadl:doc> |
1222 | + |
1223 | + </wadl:param> |
1224 | + <wadl:param style="plain" required="false" |
1225 | + path="$['unverified_emails']" |
1226 | + name="unverified_emails"> |
1227 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1228 | +List of unverified emails |
1229 | +</wadl:doc> |
1230 | + |
1231 | + </wadl:param> |
1232 | + <wadl:param style="plain" required="false" |
1233 | + path="$['id']" name="id"> |
1234 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1235 | +Account ID |
1236 | +</wadl:doc> |
1237 | + |
1238 | + </wadl:param> |
1239 | + <wadl:param style="plain" required="false" |
1240 | + path="$['verified_emails']" |
1241 | + name="verified_emails"> |
1242 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1243 | +List of verified emails |
1244 | +</wadl:doc> |
1245 | + |
1246 | + </wadl:param> |
1247 | + </wadl:representation> |
1248 | + |
1249 | + <!--Collection page for this type of entry--> |
1250 | + <wadl:resource_type id="registration-page-resource"> |
1251 | + <wadl:method name="GET" |
1252 | + id="registration-page-resource-get"> |
1253 | + <wadl:response> |
1254 | + <wadl:representation href="#registration-page"/> |
1255 | + </wadl:response> |
1256 | + </wadl:method> |
1257 | + </wadl:resource_type> |
1258 | + |
1259 | + <wadl:representation mediaType="application/json" |
1260 | + id="registration-page"> |
1261 | + |
1262 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
1263 | + <wadl:link/> |
1264 | + </wadl:param> |
1265 | + |
1266 | + <wadl:param style="plain" name="total_size" path="$['total_size']" required="true"/> |
1267 | + |
1268 | + <wadl:param style="plain" name="start" path="$['start']" required="true"/> |
1269 | + |
1270 | + <wadl:param style="plain" name="next_collection_link" path="$['next_collection_link']"> |
1271 | + <wadl:link resource_type="#registration-page-resource"/> |
1272 | + </wadl:param> |
1273 | + |
1274 | + <wadl:param style="plain" name="prev_collection_link" path="$['prev_collection_link']"> |
1275 | + <wadl:link resource_type="#registration-page-resource"/> |
1276 | + </wadl:param> |
1277 | + |
1278 | + <wadl:param style="plain" name="entries" path="$['entries']" required="true"/> |
1279 | + |
1280 | + <wadl:param style="plain" name="entry_links" path="$['entries'][*]['self_link']"> |
1281 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#registration"/> |
1282 | + </wadl:param> |
1283 | + </wadl:representation> |
1284 | + |
1285 | + |
1286 | + |
1287 | + <wadl:resource_type id="validation"> |
1288 | + |
1289 | + <wadl:method name="GET" id="validation-get"> |
1290 | + <wadl:response> |
1291 | + <wadl:representation |
1292 | + href="@@SERVICE_ROOT@@/#validation-full"/> |
1293 | + <wadl:representation |
1294 | + mediaType="application/xhtml+xml" id="validation-xhtml"/> |
1295 | + <wadl:representation |
1296 | + mediaType="application/vnd.sun.wadl+xml" |
1297 | + id="validation-wadl"/> |
1298 | + </wadl:response> |
1299 | + </wadl:method> |
1300 | + |
1301 | + <wadl:method name="PUT" id="validation-put"> |
1302 | + <wadl:request> |
1303 | + <wadl:representation |
1304 | + href="@@SERVICE_ROOT@@/#validation-full"/> |
1305 | + </wadl:request> |
1306 | + </wadl:method> |
1307 | + |
1308 | + <wadl:method name="PATCH" id="validation-patch"> |
1309 | + <wadl:request> |
1310 | + <wadl:representation |
1311 | + href="@@SERVICE_ROOT@@/#validation-diff"/> |
1312 | + </wadl:request> |
1313 | + </wadl:method> |
1314 | + |
1315 | + |
1316 | + |
1317 | + </wadl:resource_type> |
1318 | + |
1319 | + |
1320 | + <wadl:representation mediaType="application/json" |
1321 | + id="validation-full"> |
1322 | + <wadl:param style="plain" name="self_link" path="$['self_link']"> |
1323 | + <wadl:doc>The canonical link to this resource.</wadl:doc> |
1324 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#validation"/> |
1325 | + </wadl:param> |
1326 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
1327 | + <wadl:doc> |
1328 | + The link to the WADL description of this resource. |
1329 | + </wadl:doc> |
1330 | + <wadl:link/> |
1331 | + </wadl:param> |
1332 | + <wadl:param style="plain" name="http_etag" path="$['http_etag']"> |
1333 | + <wadl:doc> |
1334 | + The value of the HTTP ETag for this resource. |
1335 | + </wadl:doc> |
1336 | + </wadl:param> |
1337 | + <wadl:param style="plain" required="true" |
1338 | + path="$['preferred_email']" |
1339 | + name="preferred_email"> |
1340 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1341 | +Primary email address |
1342 | +</wadl:doc> |
1343 | + |
1344 | + </wadl:param> |
1345 | + <wadl:param style="plain" required="true" |
1346 | + path="$['unverified_emails']" |
1347 | + name="unverified_emails"> |
1348 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1349 | +List of unverified emails |
1350 | +</wadl:doc> |
1351 | + |
1352 | + </wadl:param> |
1353 | + <wadl:param style="plain" required="true" |
1354 | + path="$['id']" name="id"> |
1355 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1356 | +Account ID |
1357 | +</wadl:doc> |
1358 | + |
1359 | + </wadl:param> |
1360 | + <wadl:param style="plain" required="true" |
1361 | + path="$['verified_emails']" |
1362 | + name="verified_emails"> |
1363 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1364 | +List of verified emails |
1365 | +</wadl:doc> |
1366 | + |
1367 | + </wadl:param> |
1368 | + </wadl:representation> |
1369 | + |
1370 | + <wadl:representation mediaType="application/json" |
1371 | + id="validation-diff"> |
1372 | + <wadl:param style="plain" required="false" |
1373 | + path="$['preferred_email']" |
1374 | + name="preferred_email"> |
1375 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1376 | +Primary email address |
1377 | +</wadl:doc> |
1378 | + |
1379 | + </wadl:param> |
1380 | + <wadl:param style="plain" required="false" |
1381 | + path="$['unverified_emails']" |
1382 | + name="unverified_emails"> |
1383 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1384 | +List of unverified emails |
1385 | +</wadl:doc> |
1386 | + |
1387 | + </wadl:param> |
1388 | + <wadl:param style="plain" required="false" |
1389 | + path="$['id']" name="id"> |
1390 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1391 | +Account ID |
1392 | +</wadl:doc> |
1393 | + |
1394 | + </wadl:param> |
1395 | + <wadl:param style="plain" required="false" |
1396 | + path="$['verified_emails']" |
1397 | + name="verified_emails"> |
1398 | + <wadl:doc xmlns="http://www.w3.org/1999/xhtml"> |
1399 | +List of verified emails |
1400 | +</wadl:doc> |
1401 | + |
1402 | + </wadl:param> |
1403 | + </wadl:representation> |
1404 | + |
1405 | + <!--Collection page for this type of entry--> |
1406 | + <wadl:resource_type id="validation-page-resource"> |
1407 | + <wadl:method name="GET" |
1408 | + id="validation-page-resource-get"> |
1409 | + <wadl:response> |
1410 | + <wadl:representation href="#validation-page"/> |
1411 | + </wadl:response> |
1412 | + </wadl:method> |
1413 | + </wadl:resource_type> |
1414 | + |
1415 | + <wadl:representation mediaType="application/json" |
1416 | + id="validation-page"> |
1417 | + |
1418 | + <wadl:param style="plain" name="resource_type_link" path="$['resource_type_link']"> |
1419 | + <wadl:link/> |
1420 | + </wadl:param> |
1421 | + |
1422 | + <wadl:param style="plain" name="total_size" path="$['total_size']" required="true"/> |
1423 | + |
1424 | + <wadl:param style="plain" name="start" path="$['start']" required="true"/> |
1425 | + |
1426 | + <wadl:param style="plain" name="next_collection_link" path="$['next_collection_link']"> |
1427 | + <wadl:link resource_type="#validation-page-resource"/> |
1428 | + </wadl:param> |
1429 | + |
1430 | + <wadl:param style="plain" name="prev_collection_link" path="$['prev_collection_link']"> |
1431 | + <wadl:link resource_type="#validation-page-resource"/> |
1432 | + </wadl:param> |
1433 | + |
1434 | + <wadl:param style="plain" name="entries" path="$['entries']" required="true"/> |
1435 | + |
1436 | + <wadl:param style="plain" name="entry_links" path="$['entries'][*]['self_link']"> |
1437 | + <wadl:link resource_type="@@SERVICE_ROOT@@/#validation"/> |
1438 | + </wadl:param> |
1439 | + </wadl:representation> |
1440 | + |
1441 | + |
1442 | + <!--End representation and resource_type definitions for entry |
1443 | + resources. --> |
1444 | + |
1445 | + <!--Finally, describe the 'hosted binary file' type.--> |
1446 | + <wadl:resource_type id="HostedFile"> |
1447 | + <wadl:method name="GET" id="HostedFile-get"> |
1448 | + <wadl:response> |
1449 | + <wadl:representation status="303"> |
1450 | + <wadl:param style="header" name="Location"/> |
1451 | + </wadl:representation> |
1452 | + </wadl:response> |
1453 | + </wadl:method> |
1454 | + <wadl:method name="PUT" id="HostedFile-put"/> |
1455 | + <wadl:method name="DELETE" id="HostedFile-delete"/> |
1456 | + </wadl:resource_type> |
1457 | + |
1458 | + <!--Define a data type for binary data.--> |
1459 | + <xsd:simpleType name="binary"> |
1460 | + <xsd:list itemType="byte"/> |
1461 | + </xsd:simpleType> |
1462 | + |
1463 | +</wadl:application> |
1464 | +''' |
1465 | |
1466 | === modified file 'identityprovider/wsgi.py' |
1467 | --- identityprovider/wsgi.py 2010-12-22 15:23:55 +0000 |
1468 | +++ identityprovider/wsgi.py 2011-02-01 17:26:35 +0000 |
1469 | @@ -1,6 +1,7 @@ |
1470 | # Copyright 2010 Canonical Ltd. This software is licensed under the |
1471 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1472 | import logging |
1473 | +import re |
1474 | import traceback |
1475 | |
1476 | from django.core.handlers.wsgi import WSGIHandler |
1477 | @@ -25,14 +26,15 @@ |
1478 | :param default_application: application to use if none of urls are |
1479 | matching |
1480 | """ |
1481 | - self.mapping = mapping |
1482 | + self.mapping = [(re.compile(pattern), app) |
1483 | + for (pattern, app) in mapping] |
1484 | self.default_application = default_application |
1485 | |
1486 | |
1487 | def __call__(self, environ, start_response): |
1488 | path_info = environ.get('PATH_INFO', '/') |
1489 | for app_url, app in self.mapping: |
1490 | - if path_info.startswith(app_url): |
1491 | + if app_url.search(path_info) is not None: |
1492 | return app(environ, start_response) |
1493 | return self.default_application(environ, start_response) |
1494 | |
1495 | @@ -59,6 +61,7 @@ |
1496 | |
1497 | |
1498 | def make_app(): |
1499 | + |
1500 | api_re_prefix = r"/api/[\d.]+/" |
1501 | |
1502 | django = WSGIHandler() |
1503 | @@ -85,6 +88,9 @@ |
1504 | |
1505 | api = OopsTracebackReporter(oauth) |
1506 | |
1507 | - dispatch = WSGIDispatch([('/api/1.0', api)], django) |
1508 | + dispatch = WSGIDispatch( |
1509 | + [(r'^/api/1.0/?$', django), |
1510 | + (r'^/api/1.0', api)], |
1511 | + django) |
1512 | |
1513 | return dispatch |