Changeset 4126 for TI12-security/trunk/python/ndg.security.server/ndg/security/server/wsgi/openid_provider.py
- Timestamp:
- 18/08/08 09:16:40 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.server/ndg/security/server/wsgi/openid_provider.py
r4125 r4126 221 221 return response 222 222 223 tmplYadis = """\224 <?xml version="1.0" encoding="UTF-8"?>225 <xrds:XRDS226 xmlns:xrds="xri://$xrds"227 xmlns="xri://$xrd*($v*2.0)">228 <XRD>229 230 <Service priority="0">231 <Type>%(openid20type)s</Type>232 <Type>%(openid10type)s</Type>233 <URI>%(endpoint_url)s</URI>234 <LocalID>%(user_url)s</LocalID>235 </Service>236 237 </XRD>238 </xrds:XRDS>"""239 223 240 224 def do_yadis(self, environ, start_response): 241 225 """Generate Yadis document""" 242 243 username = self.path.split('/')[-1] 244 245 endpoint_url = self.urls['url_openidserver'] 246 user_url = self.urls['url_id'] + '/' + username 247 248 yadisDict = dict(openid20type=discover.OPENID_2_0_TYPE, 249 openid10type=discover.OPENID_1_0_TYPE, 250 endpoint_url=endpoint_url, 251 user_url=user_url) 252 253 response = OpenIDProviderMiddleware.tmplYadis % yadisDict 226 response = self._renderer.renderYadis(environ) 254 227 255 228 start_response('200 OK', 256 [('Content-type', 'application/xrds+xml' +self.charset),257 ('Content-length', str(len(response)))])229 [('Content-type', 'application/xrds+xml'+self.charset), 230 ('Content-length', str(len(response)))]) 258 231 return response 259 232 … … 580 553 ''' % (ident, msg)) 581 554 555 tmplYadis = """\ 556 <?xml version="1.0" encoding="UTF-8"?> 557 <xrds:XRDS 558 xmlns:xrds="xri://$xrds" 559 xmlns="xri://$xrd*($v*2.0)"> 560 <XRD> 561 562 <Service priority="0"> 563 <Type>%(openid20type)s</Type> 564 <Type>%(openid10type)s</Type> 565 <URI>%(endpoint_url)s</URI> 566 <LocalID>%(user_url)s</LocalID> 567 </Service> 568 569 </XRD> 570 </xrds:XRDS>""" 571 572 def renderYadis(self, environ): 573 """Render Yadis document""" 574 username = environ['PATH_INFO'].rstrip('/').split('/')[-1] 575 576 endpoint_url = self.urls['url_openidserver'] 577 user_url = self.urls['url_id'] + '/' + username 578 579 yadisDict = dict(openid20type=discover.OPENID_2_0_TYPE, 580 openid10type=discover.OPENID_1_0_TYPE, 581 endpoint_url=endpoint_url, 582 user_url=user_url) 583 584 return RenderingInterface.tmplYadis % yadisDict 585 582 586 583 587 def renderLogin(self, environ, success_to=None, fail_to=None):
Note: See TracChangeset
for help on using the changeset viewer.