MCPcopy Create free account
hub / github.com/mpdavis/python-jose / test_add_headers

Method test_add_headers

tests/test_jws.py:128–139  ·  view source on GitHub ↗
(self, payload)

Source from the content-addressed store, hash-verified

126 jws.sign(payload, "secret", algorithm="SOMETHING")
127
128 def test_add_headers(self, payload):
129 additional_headers = {"test": "header"}
130
131 expected_headers = {
132 "test": "header",
133 "alg": "HS256",
134 "typ": "JWT",
135 }
136
137 token = jws.sign(payload, "secret", headers=additional_headers)
138 header, payload, signing_input, signature = jws._load(token)
139 assert expected_headers == header
140
141
142rsa_private_key = """-----BEGIN RSA PRIVATE KEY-----

Callers

nothing calls this directly

Calls 1

signMethod · 0.45

Tested by

no test coverage detected