Repository navigation
filter_algorithms names parameter default to all algs - #79
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #79 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 47 47
Lines 2850 2852 +2
Branches 320 321 +1
=========================================
+ Hits 2850 2852 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds convenience functionality to the filter_algorithms method by making the names parameter optional, defaulting to all available algorithms when not specified.
- Made the
namesparameter offilter_algorithmsoptional with a default value ofNone - Added logic to default to all algorithms from the registry when
namesis not provided - Added test coverage to verify the new default behavior matches explicit behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/joserfc/_rfc7515/registry.py | Made names parameter optional in filter_algorithms method, defaulting to all algorithms when None |
| tests/jws/test_registry.py | Added test to verify default behavior matches explicit behavior when passing all algorithm names |
| docs/changelog.rst | Documented the new optional parameter behavior in the unreleased changelog section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Filter JWS algorithms based on the given algorithm names. | ||
|
|
||
| :param key: key instance | ||
| :param names: list of algorithm names |
There was a problem hiding this comment.
The docstring should be updated to document that the names parameter is now optional and defaults to all algorithms when not provided. For example:
"""Filter JWS algorithms based on the given algorithm names.
:param key: key instance
:param names: list of algorithm names, defaults to all available algorithms if not provided
"""| :param names: list of algorithm names | |
| :param names: list of algorithm names, defaults to all available algorithms if not provided |
Some sugar to the
filter_algorithmsmethod.