예제 #1
0
 def setUpClass(self):
     # Populate OpenID config cache.
     with mock.patch('kinto.plugins.openid.utils.requests.get') as m:
         m.return_value.json.return_value = {
             'userinfo_endpoint': 'http://uinfo',
             'jwks_uri': 'https://jwks'
         }
         fetch_openid_config('https://fxa')
예제 #2
0
파일: test_openid.py 프로젝트: mksiva/kinto
 def setUpClass(self):
     # Populate OpenID config cache.
     with mock.patch("kinto.plugins.openid.utils.requests.get") as m:
         m.return_value.json.return_value = {
             "userinfo_endpoint": "http://uinfo",
             "jwks_uri": "https://jwks",
         }
         fetch_openid_config("https://fxa")
예제 #3
0
 def setUpClass(self):
     # Populate OpenID config cache.
     with mock.patch("kinto.plugins.openid.utils.requests.get") as m:
         m.return_value.json.return_value = {
             "userinfo_endpoint": "http://uinfo",
             "jwks_uri": "https://jwks",
         }
         fetch_openid_config("https://fxa")
예제 #4
0
파일: test_openid.py 프로젝트: mksiva/kinto
    def test_profile_is_exposed(self):
        key = "openid:verify:444c6694937007bbf494f155f6cb12139db4c4c6a926742f3fe0bb4b5d191aa3"
        profile = {"sub": "abcd", "email": "*****@*****.**"}
        self.app.app.registry.cache.set(key, profile, ttl=30)
        with mock.patch("kinto.plugins.openid.utils.requests.get") as m:
            m.return_value.json.return_value = {
                "userinfo_endpoint": "http://uinfo",
                "jwks_uri": "https://jwks",
            }
            fetch_openid_config("https://fxa")

        resp = self.app.get("/",
                            headers={"Authorization": "Bearer avrbnnbrbr"})
        assert "profile" in resp.json["user"]
        assert resp.json["user"]["profile"] == {
            "sub": "abcd",
            "email": "*****@*****.**"
        }
예제 #5
0
 def setUpClass(self):
     # Populate OpenID config cache.
     with mock.patch('kinto.plugins.openid.utils.requests.get') as m:
         m.return_value.json.return_value = {'userinfo_endpoint': 'http://uinfo',
                                             'jwks_uri': 'https://jwks'}
         fetch_openid_config('https://fxa')