We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8ffe9cf + 6ffa587 commit 8776f24Copy full SHA for 8776f24
tests/test_06_jws.py
@@ -807,3 +807,14 @@ def test_mismatch_alg_and_key():
807
_jws = JWS(payload, alg='ES256')
808
with pytest.raises(NoSuitableSigningKeys):
809
_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