-
-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't raise error when algorithm is not support #746
Conversation
Instead of raising an error for not supported algorithm we log the warning, and continue with other algorithms/keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the build failures please
Added logging import
for more information, see https://pre-commit.ci
I'm off for the easter holydays without a computer, will look into it in a week. |
if not self.Algorithm: | ||
raise PyJWKError("Unable to find a algorithm for key: %s" % self._jwk_data) | ||
import logging | ||
|
||
self.key = self.Algorithm.from_jwk(self._jwk_data) | ||
self.key = None | ||
logger = logging.getLogger(__name__) | ||
logger.warning("Do not support algorithm %s", algorithm) | ||
else: | ||
self.key = self.Algorithm.from_jwk(self._jwk_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might have security implications, as users of this class likely expect the algorithm in the JWK data to be valid.
Should be fixed with #762 |
Instead of raising an error for not supported algorithm we log the warning, and continue with other algorithms/keys