Example #1
0
def discover_extensions(openid_url):
    service = discover(openid_url)
    use_ax = False
    use_sreg = False
    for endpoint in service[1]:
        if not use_sreg:
            use_sreg = sreg.supportsSReg(endpoint)
        if not use_ax:
            use_ax = endpoint.usesExtension("http://openid.net/srv/ax/1.0")
        if use_ax and use_sreg: break
    return use_ax, use_sreg
Example #2
0
def discover_extensions(openid_url):
    service = discover(openid_url)
    use_ax = False
    use_sreg = False
    for endpoint in service[1]:
        if not use_sreg:
            use_sreg = sreg.supportsSReg(endpoint)
        if not use_ax:
            use_ax = endpoint.usesExtension("http://openid.net/srv/ax/1.0")
        if use_ax and use_sreg: break
    return use_ax, use_sreg
 def test_supported_1_0(self):
     endpoint = FakeEndpoint([sreg.ns_uri_1_0])
     self.failUnless(sreg.supportsSReg(endpoint))
     self.failUnlessEqual([sreg.ns_uri_1_1, sreg.ns_uri_1_0],
                          endpoint.checked_uris)
Example #4
0
 def test_supported_1_0(self):
     endpoint = FakeEndpoint([sreg.ns_uri_1_0])
     self.assertTrue(sreg.supportsSReg(endpoint))
     self.assertEqual(endpoint.checked_uris, [sreg.ns_uri_1_1, sreg.ns_uri_1_0])
Example #5
0
 def test_supported_1_0(self):
     endpoint = FakeEndpoint([sreg.ns_uri_1_0])
     self.assertTrue(sreg.supportsSReg(endpoint))
     self.assertEqual(endpoint.checked_uris,
                      [sreg.ns_uri_1_1, sreg.ns_uri_1_0])
Example #6
0
 def test_unsupported(self):
     endpoint = FakeEndpoint([])
     self.assertFalse(sreg.supportsSReg(endpoint))
     self.assertEqual([sreg.ns_uri_1_1, sreg.ns_uri_1_0], endpoint.checked_uris)
Example #7
0
 def test_unsupported(self):
     endpoint = FakeEndpoint([])
     self.assertFalse(sreg.supportsSReg(endpoint))
     self.assertEqual([sreg.ns_uri_1_1, sreg.ns_uri_1_0],
                      endpoint.checked_uris)