コード例 #1
0
 def test_from_json(self):
     dic = {'uid': 'uid', 'salt': 'salt', 'authn_time': 1000, 'valid_until': 1500}
     ae = AuthnEvent.from_json(json.dumps(dic))
     assert ae.uid == 'uid'
     assert ae.salt == 'salt'
     assert ae.authn_time == 1000
     assert ae.valid_until == 1500
コード例 #2
0
    def test_sub_to_authn_event(self):
        ae = AuthnEvent("sub", "salt", time_stamp=time.time())
        sid = self.sdb.create_authz_session(ae, AREQ)
        sub = self.sdb.do_sub(sid, "client_salt")

        # given the sub find out whether the authn event is still valid
        sids = self.sdb.get_sids_by_sub(sub)
        ae = self.sdb[sids[0]]["authn_event"]
        assert AuthnEvent.from_json(ae).valid()
コード例 #3
0
    def test_sub_to_authn_event(self):
        ae = AuthnEvent("sub", "salt", time_stamp=time.time())
        sid = self.sdb.create_authz_session(ae, AREQ)
        sub = self.sdb.do_sub(sid, "client_salt")

        # given the sub find out whether the authn event is still valid
        sids = self.sdb.get_sids_by_sub(sub)
        ae = self.sdb[sids[0]]["authn_event"]
        assert AuthnEvent.from_json(ae).valid()
コード例 #4
0
ファイル: test_sdb.py プロジェクト: timothy-spencer/pyoidc
 def test_from_json(self):
     dic = {
         "uid": "uid",
         "salt": "salt",
         "authn_time": 1000,
         "valid_until": 1500
     }
     ae = AuthnEvent.from_json(json.dumps(dic))
     assert ae.uid == "uid"
     assert ae.salt == "salt"
     assert ae.authn_time == 1000
     assert ae.valid_until == 1500