Commit 9ebbbee1 authored by Simo Sorce's avatar Simo Sorce

Avoid removing list members while iterating

Unknown keys are permitted and saved in here, so let's simply remove the
useless circus about unknown keys and the issue about trying to remove
from a list while iterating.

Thanks to travis@pobox.com (@nicfit) for finding the issue
Signed-off-by: default avatarSimo Sorce <simo@redhat.com>
Closes #19
parent 09391d78
...@@ -288,11 +288,6 @@ class JWK(object): ...@@ -288,11 +288,6 @@ class JWK(object):
# Let's just store them out of the way # Let's just store them out of the way
for name in names: for name in names:
self._unknown[name] = kwargs[name] self._unknown[name] = kwargs[name]
while name in names:
names.remove(name)
if len(names) != 0:
raise InvalidJWKValue('Unknown key parameters: %s' % names)
if len(self._key) == 0: if len(self._key) == 0:
raise InvalidJWKValue('No Key Values found') raise InvalidJWKValue('No Key Values found')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment