Skip to content

Commit

Permalink
Fix sphinx nitpicked errors
Browse files Browse the repository at this point in the history
Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed May 13, 2022
1 parent 793fb43 commit 1e5c385
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion jwcrypto/jwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class JWK(dict):
"""

def __init__(self, **kwargs):
"""Creates a new JWK object.
r"""Creates a new JWK object.
The function arguments must be valid parameters as defined in the
'IANA JSON Web Key Set Parameters registry' and specified in
Expand All @@ -299,6 +299,8 @@ def __init__(self, **kwargs):
valid key type as value then a new key will be generated according
to the defaults or provided key strength options (type specific).
:param \**kwargs: parameters (otional).
:raises InvalidJWKType: if the key type is invalid
:raises InvalidJWKValue: if incorrect or inconsistent parameters
are provided.
Expand Down Expand Up @@ -1107,6 +1109,10 @@ def __setitem__(self, item, value):
super(JWK, self).__setitem__(item, value)

def update(self, *args, **kwargs):
r"""
:param \*args: arguments
:param \**kwargs: keyword arguments
"""
for k, v in dict(*args, **kwargs).items():
self.__setitem__(k, v)

Expand Down Expand Up @@ -1233,6 +1239,10 @@ def __setitem__(self, key, val):
super(JWKSet, self).__setitem__(key, val)

def update(self, *args, **kwargs):
r"""
:param \*args: arguments
:param \**kwargs: keyword arguments
"""
for k, v in dict(*args, **kwargs).items():
self.__setitem__(k, v)

Expand Down
4 changes: 2 additions & 2 deletions jwcrypto/jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def __init__(self, alg, key, header, payload, algs=None):
:param payload(bytes): An arbitrary value
:param algs: An optional list of allowed algorithms
:raises ValueError: if the key is not a :class:`JWK` object
:raises ValueError: if the key is not a (:class:`jwcrypto.jwk.JWK`)
:raises InvalidJWAAlgorithm: if the algorithm is not valid, is
unknown or otherwise not yet implemented.
:raises InvalidJWSOperation: if the algorithm is not allowed.
Expand Down Expand Up @@ -477,7 +477,7 @@ def add_signature(self, key, alg=None, protected=None, header=None):
:param header: The Unprotected Header (optional)
:raises InvalidJWSObject: if invalid headers are provided.
:raises ValueError: if the key is not a :class:`JWK` object.
:raises ValueError: if the key is not a (:class:`jwcrypto.jwk.JWK`)
:raises ValueError: if the algorithm is missing or is not provided
by one of the headers.
:raises InvalidJWAAlgorithm: if the algorithm is not valid, is
Expand Down

0 comments on commit 1e5c385

Please sign in to comment.