def idpXrds(request): """ Respond to requests for the IDP's XRDS document, which is used in IDP-driven identifier selection. """ return util.renderXRDS(request, [OPENID_IDP_2_0_TYPE], [getViewURL(request, endpoint)])
def idpXrds(request): """ Respond to requests for the IDP's XRDS document, which is used in IDP-driven identifier selection. """ return util.renderXRDS( request, [OPENID_IDP_2_0_TYPE], [getViewURL(request, endpoint)])
def rpXRDS(request): """ Return a relying party verification XRDS document """ return util.renderXRDS( request, [RP_RETURN_TO_URL_TYPE], [util.getViewURL(request, finishOpenID)])
def test_genericRender(self): """Render an XRDS document with a single type URI and a single endpoint URL Parse it to see that it matches.""" request = dummyRequest() type_uris = ["A_TYPE"] endpoint_url = "A_URL" response = util.renderXRDS(request, type_uris, [endpoint_url]) requested_url = "http://requested.invalid/" (endpoint,) = applyFilter(requested_url, response.content) self.failUnlessEqual(YADIS_CONTENT_TYPE, response["Content-Type"]) self.failUnlessEqual(type_uris, endpoint.type_uris) self.failUnlessEqual(endpoint_url, endpoint.uri)
def test_genericRender(self): """Render an XRDS document with a single type URI and a single endpoint URL Parse it to see that it matches.""" request = dummyRequest() type_uris = ['A_TYPE'] endpoint_url = 'A_URL' response = util.renderXRDS(request, type_uris, [endpoint_url]) requested_url = 'http://requested.invalid/' (endpoint,) = applyFilter(requested_url, response.content) self.failUnlessEqual(YADIS_CONTENT_TYPE, response['Content-Type']) self.failUnlessEqual(type_uris, endpoint.type_uris) self.failUnlessEqual(endpoint_url, endpoint.uri)
def test_genericRender(self): """ Render XRDS document with a single type URI and a single endpoint URL Parse it to see that it matches. """ request = dummyRequest() type_uris = ['A_TYPE'] endpoint_url = 'A_URL' response = util.renderXRDS(request, type_uris, [endpoint_url]) requested_url = 'http://requested.invalid/' (endpoint,) = applyFilter(requested_url, response.content) self.assertEqual(YADIS_CONTENT_TYPE, response['Content-Type']) self.assertEqual(type_uris, endpoint.type_uris) self.assertEqual(endpoint_url, endpoint.uri)