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

Function get_unverified_header

jose/jwt.py:187–204  ·  view source on GitHub ↗

Returns the decoded headers without verification of any kind. Args: token (str): A signed JWT to decode the headers from. Returns: dict: The dict representation of the token headers. Raises: JWTError: If there is an exception decoding the token.

(token)

Source from the content-addressed store, hash-verified

185
186
187def get_unverified_header(token):
188 """Returns the decoded headers without verification of any kind.
189
190 Args:
191 token (str): A signed JWT to decode the headers from.
192
193 Returns:
194 dict: The dict representation of the token headers.
195
196 Raises:
197 JWTError: If there is an exception decoding the token.
198 """
199 try:
200 headers = jws.get_unverified_headers(token)
201 except Exception:
202 raise JWTError("Error decoding token headers.")
203
204 return headers
205
206
207def get_unverified_headers(token):

Callers 1

get_unverified_headersFunction · 0.70

Calls 1

JWTErrorClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…