Skip to content

Commit

Permalink
fix: "key_ops" is an array, per RFC 7517 #4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
m0nhawk authored and Ramu Nerella committed Jul 20, 2021
1 parent 4aeef70 commit 8caaad1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fence/jwt/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def public_key_to_jwk(self):
except AttributeError:
# there is no need to decode values that are already strings
pass
jwk_dict.update({"use": "sig", "key_ops": "verify", "kid": self.kid})
jwk_dict.update({"use": "sig", "key_ops": ["verify"], "kid": self.kid})
return jwk_dict


Expand Down
2 changes: 1 addition & 1 deletion tests/rfc7517/test_jwks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_response_values(app, client):
assert key["alg"] == "RS256"
assert key["kty"] == "RSA"
assert key["use"] == "sig"
assert key["key_ops"] == "verify"
assert key["key_ops"] == ["verify"]
assert key["kid"] in app_kids
# Attempt to reproduce the public key from the JWK response.
key_pem = jwk.construct(key).to_pem().decode("utf-8")
Expand Down

0 comments on commit 8caaad1

Please sign in to comment.