Skip to content

Avoid auth-sanitizer top-level namespaces - #721

Merged
pboling merged 5 commits into
mainfrom
fix/top-level-namespace-pollution
May 20, 2026
Merged

pboling merged 5 commits into
mainfrom
fix/top-level-namespace-pollution

Conversation

@pboling

@pboling pboling commented May 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • load auth-sanitizer through an isolated internal loader
  • keep sanitizer integration under the OAuth2 namespace
  • prevent requiring oauth2 from adding top-level Auth or AuthSanitizer constants

Testing

  • bundle exec rspec spec/oauth2/auth_sanitizer_spec.rb spec/auth/sanitizer/thing_filter_spec.rb spec/oauth2/client_spec.rb spec/oauth2/authenticator_spec.rb

Fixes #720

Copilot AI review requested due to automatic review settings May 20, 2026 19:36
@codecov

codecov Bot commented May 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0bc1903) to head (6082a21).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #721   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        15    +1     
  Lines          553       559    +6     
  Branches       169       169           
=========================================
+ Hits           553       559    +6     

☔ 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.

@coveralls

coveralls commented May 20, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 26186350871

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 10 of 10 lines across 4 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 522
Covered Lines: 522
Line Coverage: 100.0%
Relevant Branches: 174
Covered Branches: 174
Branch Coverage: 100.0%
Branches in Coverage %: Yes
Coverage Strength: 77.01 hits per line

💛 - Coveralls

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the oauth2 gem’s integration with auth-sanitizer to avoid introducing top-level Auth / AuthSanitizer constants when require "oauth2" is executed, by loading auth-sanitizer through an internal isolated loader under the OAuth2 namespace.

Changes:

  • Add OAuth2::AUTH_SANITIZER internal loader to isolate auth-sanitizer constants.
  • Update references and docs from Auth::Sanitizer to OAuth2::AUTH_SANITIZER, while preserving OAuth2::FilteredAttributes.
  • Bump dependency minimum (auth-sanitizer >= 0.1.3) and bump gem version to 2.0.20, with corresponding lockfile and specs updates.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/oauth2/auth_sanitizer_spec.rb Adds spec ensuring requiring oauth2 doesn’t define top-level Auth / AuthSanitizer, and preserves the alias contract.
spec/auth/sanitizer/thing_filter_spec.rb Updates specs to reference sanitizer classes/modules via OAuth2::AUTH_SANITIZER.
oauth2.gemspec Tightens auth-sanitizer dependency to require >= 0.1.3.
lib/oauth2/version.rb Bumps gem version to 2.0.20.
lib/oauth2/filtered_attributes.rb Keeps OAuth2::FilteredAttributes as an alias, now pointing to OAuth2::AUTH_SANITIZER.
lib/oauth2/client.rb Updates logger filtering implementation and YARD docs to use OAuth2::AUTH_SANITIZER.
lib/oauth2/auth_sanitizer.rb Introduces isolated loader implementation for auth-sanitizer under OAuth2::AUTH_SANITIZER.
lib/oauth2.rb Switches from requiring auth/sanitizer to requiring the internal isolated loader and rewires label provider.
Gemfile.lock Locks oauth2 at 2.0.20 and auth-sanitizer at 0.1.3.
CHANGELOG.md Documents the change under [Unreleased].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/oauth2/auth_sanitizer.rb Outdated
Comment thread CHANGELOG.md Outdated
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
oauth2 100% 100% ✔
Summary 100% (522 / 522) 100% (174 / 174) ✔

Minimum allowed line rate is 100%

Copilot AI review requested due to automatic review settings May 20, 2026 20:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@pboling
pboling enabled auto-merge May 20, 2026 23:24
@pboling
pboling disabled auto-merge May 20, 2026 23:24
@pboling
pboling merged commit 23f2855 into main May 20, 2026
35 of 36 checks passed
@pboling
pboling deleted the fix/top-level-namespace-pollution branch May 20, 2026 23:24
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.

v2.0.19 has a breaking change: new Auth namespace

4 participants