-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
Move algorithm-specific logic to be class-based to allow for better extensibility #70
Comments
…e classes in the algorithms module Added register_algorithm to add new algorithms.
As an alternative, setuptools extension points could be used instead. With the current approach, any external "extension package" containing an additional algorithm implementation must be imported by the application before it could be used, because the extension package would register the algorithms only at import time. With extension points, which are designed for use cases like these, this isn't needed anymore. A simple The |
That's a neat idea! I could see that being super useful in applications that see a lot of plug-ins being developed (things like Django, SqlAlchemy, flask) and I have some ideas for where I want to use it. Thanks for sharing it! =) For this library, I anticipate that 99.9999% of the use-cases will be people who are only using the algorithms listed in the JWA spec (which we implement all of the required, all of the reccomended, and most of the optional). I think that someone registering their own non-standard algorithms with this library would be very uncommon so I'm not sure it justifies the additional dependency on I wouldn't be opposed to the setuptools option though. I'll have to read up on it. But that's just my two cents :-) |
Actually I tend to agree with you here @mark-adams. The ugly import-time side-effect and the resulting seemingly "unused" import in application code is just the price one has to pay for using non-standardized crypto! :) |
For future reference: follow-up discussion in #71. |
…e classes in the algorithms module Added register_algorithm to add new algorithms.
…e classes in the algorithms module Added register_algorithm to add new algorithms.
Fixes #70. Implemented registry pattern for class-based algorithms
In #42, we discussed changing to more of a registry model for registration of algorithms. This issue is suggesting that we move to that sort of a model.
The text was updated successfully, but these errors were encountered: