Example #1
0
def test_jwt_pack_unpack_sym():
    kj = KeyJar()
    kj.add_symmetric(owner='', key='client_secret', usage=['sig'])
    kj['https://fedop.example.org'] = kj['']
    srv = JWT(kj, iss=issuer, sign_alg="HS256")
    payload = {'sub': 'sub2'}
    _jwt = srv.pack(payload=payload)
    info = srv.unpack(_jwt)
    assert info
Example #2
0
 def test_add_symmetric(self):
     kj = KeyJar()
     kj.add_symmetric('', 'client_secret', ['sig'])
     assert list(kj.owners()) == ['']
     assert len(kj.get_signing_key('oct', '')) == 1