Skip to content

Commit 8776f24

Browse files
committed
merged
2 parents 8ffe9cf + 6ffa587 commit 8776f24

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_06_jws.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,3 +807,14 @@ def test_mismatch_alg_and_key():
807807
_jws = JWS(payload, alg='ES256')
808808
with pytest.raises(NoSuitableSigningKeys):
809809
_jws.sign_compact(keys)
810+
811+
812+
def test_extra_headers_3():
813+
pkey = import_private_rsa_key_from_file(full_path("./size2048.key"))
814+
payload = "Please take a moment to register today"
815+
keys = [RSAKey(priv_key=pkey)]
816+
_jws = JWS(payload, alg='RS256')
817+
_jws.set_header_claim('foo', 'bar')
818+
sjwt = _jws.sign_compact(keys, abc=123)
819+
_jwt = factory(sjwt)
820+
assert set(_jwt.jwt.headers.keys()) == {'alg', 'foo', 'abc'}

0 commit comments

Comments
 (0)