From 08bc901b9a222d3c589ee4acb22d8486ca77e172 Mon Sep 17 00:00:00 2001 From: Gene Wood Date: Mon, 19 Aug 2019 10:36:03 -0700 Subject: [PATCH] Clarify sign docstring to allow for dict payload Since a `payload` of a Mapping type is converted to a string in `_encode_payload`, this commit updates the docstring for `sign` to reflect that --- jose/jws.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jose/jws.py b/jose/jws.py index 9d2fc0de..293b32ae 100644 --- a/jose/jws.py +++ b/jose/jws.py @@ -20,7 +20,7 @@ def sign(payload, key, headers=None, algorithm=ALGORITHMS.HS256): """Signs a claims set and returns a JWS string. Args: - payload (str): A string to sign + payload (str or dict): A string to sign key (str or dict): The key to use for signing the claim set. Can be individual JWK or JWK set. headers (dict, optional): A set of headers that will be added to