Skip to content

Commit

Permalink
B028 Error code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gagandeepp committed Oct 5, 2024
1 parent b0b386f commit 953ffc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jwt/api_jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def decode_complete(
"and will be removed in pyjwt version 3. "
f"Unsupported kwargs: {tuple(kwargs.keys())}",
RemovedInPyjwt3Warning,
stacklevel=2,
)
if options is None:
options = {}
Expand Down Expand Up @@ -231,6 +232,7 @@ def decode(
"and will be removed in pyjwt version 3. "
f"Unsupported kwargs: {tuple(kwargs.keys())}",
RemovedInPyjwt3Warning,
stacklevel=2,
)
decoded = self.decode_complete(
jwt, key, algorithms, options, detached_payload=detached_payload
Expand Down
3 changes: 3 additions & 0 deletions jwt/api_jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def decode_complete(
"and will be removed in pyjwt version 3. "
f"Unsupported kwargs: {tuple(kwargs.keys())}",
RemovedInPyjwt3Warning,
stacklevel=2,
)
options = dict(options or {}) # shallow-copy or initialize an empty dict
options.setdefault("verify_signature", True)
Expand All @@ -135,6 +136,7 @@ def decode_complete(
"The equivalent is setting `verify_signature` to False in the `options` dictionary. "
"This invocation has a mismatch between the kwarg and the option entry.",
category=DeprecationWarning,
stacklevel=2,
)

if not options["verify_signature"]:
Expand Down Expand Up @@ -202,6 +204,7 @@ def decode(
"and will be removed in pyjwt version 3. "
f"Unsupported kwargs: {tuple(kwargs.keys())}",
RemovedInPyjwt3Warning,
stacklevel=2,
)
decoded = self.decode_complete(
jwt,
Expand Down

0 comments on commit 953ffc1

Please sign in to comment.