Skip to content

Commit 7ff8122

Browse files
authored
Merge pull request #103 from imsteev/update_function_param_comments
update comments for key argument
2 parents 6b3d557 + 0955621 commit 7ff8122

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

jose/jws.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def sign(payload, key, headers=None, algorithm=ALGORITHMS.HS256):
1818
1919
Args:
2020
payload (str): A string to sign
21-
key (str): The key to use for signing the claim set
21+
key (str or dict): The key to use for signing the claim set. Can be
22+
individual JWK or JWK set.
2223
headers (dict, optional): A set of headers that will be added to
2324
the default headers. Any headers that are added as additional
2425
headers will override the default headers.
@@ -53,7 +54,8 @@ def verify(token, key, algorithms, verify=True):
5354
5455
Args:
5556
token (str): A signed JWS to be verified.
56-
key (str): A key to attempt to verify the payload with.
57+
key (str or dict): A key to attempt to verify the payload with. Can be
58+
individual JWK or JWK set.
5759
algorithms (str or list): Valid algorithms that should be used to verify the JWS.
5860
5961
Returns:

jose/jwt.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def encode(claims, key, algorithm=ALGORITHMS.HS256, headers=None, access_token=N
2525
2626
Args:
2727
claims (dict): A claims set to sign
28-
key (str): The key to use for signing the claim set
28+
key (str or dict): The key to use for signing the claim set. Can be
29+
individual JWK or JWK set.
2930
algorithm (str, optional): The algorithm to use for signing the
3031
the claims. Defaults to HS256.
3132
headers (dict, optional): A set of headers that will be added to
@@ -67,7 +68,8 @@ def decode(token, key, algorithms=None, options=None, audience=None,
6768
6869
Args:
6970
token (str): A signed JWS to be verified.
70-
key (str): A key to attempt to verify the payload with.
71+
key (str or dict): A key to attempt to verify the payload with. Can be
72+
individual JWK or JWK set.
7173
algorithms (str or list): Valid algorithms that should be used to verify the JWS.
7274
audience (str): The intended audience of the token. If the "aud" claim is
7375
included in the claim set, then the audience must be included and must equal

0 commit comments

Comments
 (0)