def test_pjwt_with_kid(): pj = PopJWT("https://server.example.com", "https://client.example.org", sub='12345678') pjwt = pj.pack_kid('some-key-id') s = pjwt.to_json() assert s de_pjwt = PJWT().from_json(s) assert _eq(de_pjwt.keys(), ['iss', 'aud', 'exp', 'cnf', 'sub', 'iat']) assert list(de_pjwt['cnf'].keys()) == ['kid'] assert de_pjwt['cnf']['kid'] == 'some-key-id'
def test_pjwt_with_kid(): pj = PopJWT("https://server.example.com", "https://client.example.org", sub="12345678") pjwt = pj.pack_kid("some-key-id") s = pjwt.to_json() assert s de_pjwt = PJWT().from_json(s) assert _eq(de_pjwt.keys(), ["iss", "aud", "exp", "cnf", "sub", "iat"]) assert list(de_pjwt["cnf"].keys()) == ["kid"] assert de_pjwt["cnf"]["kid"] == "some-key-id"