Skip to content

filter_algorithms names parameter default to all algs - #79

Merged
lepture merged 1 commit into
authlib:mainfrom
azmeuk:filter-alg
Dec 5, 2025
Merged

lepture merged 1 commit into
authlib:mainfrom
azmeuk:filter-alg

Conversation

@azmeuk

@azmeuk azmeuk commented Dec 3, 2025

Copy link
Copy Markdown
Member

Some sugar to the filter_algorithms method.

Copilot AI review requested due to automatic review settings December 3, 2025 22:06
@codecov

codecov Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bc13ead) to head (1034a87).
⚠️ Report is 15 commits behind head on main.

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     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 names parameter of filter_algorithms optional with a default value of None
  • Added logic to default to all algorithms from the registry when names is 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

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
"""
Suggested change
:param names: list of algorithm names
:param names: list of algorithm names, defaults to all available algorithms if not provided

Copilot uses AI. Check for mistakes.
@lepture
lepture merged commit ed2e6df into authlib:main Dec 5, 2025
17 checks passed
@azmeuk
azmeuk deleted the filter-alg branch December 5, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants