Skip to content

Avoid auth-sanitizer top-level namespaces#13

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

Avoid auth-sanitizer top-level namespaces#13
pboling merged 6 commits into
mainfrom
fix/top-level-namespace-pollution

Conversation

@pboling
Copy link
Copy Markdown
Member

@pboling pboling commented May 20, 2026

Summary

  • load auth-sanitizer through an isolated internal loader
  • keep sanitizer integration under the OAuth::TTY namespace
  • prevent requiring oauth/tty from adding top-level Auth or AuthSanitizer constants

Testing

  • bundle exec rspec spec/oauth/tty/auth_sanitizer_spec.rb spec/oauth/tty/command_spec.rb

Copilot AI review requested due to automatic review settings May 20, 2026 19:36
Copy link
Copy Markdown

Copilot AI left a comment

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 auth-sanitizer integration so require "oauth/tty" no longer introduces top-level Auth / AuthSanitizer constants, keeping the sanitizer loaded and referenced under the OAuth::TTY namespace to avoid downstream constant collisions.

Changes:

  • Added an internal isolated loader (OAuth::TTY::AUTH_SANITIZER) to load auth-sanitizer without defining top-level namespaces.
  • Updated Command (and its RBS signature) to include OAuth::TTY::AUTH_SANITIZER::FilteredAttributes instead of Auth::Sanitizer::FilteredAttributes.
  • Bumped the gem version to 1.0.8 and tightened the auth-sanitizer dependency to >= 0.1.3.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/oauth/tty/auth_sanitizer.rb Introduces the isolated loader that returns a sanitizer module without leaking top-level constants.
lib/oauth/tty.rb Stops requiring auth/sanitizer directly; loads the internal isolated loader instead.
lib/oauth/tty/command.rb Switches FilteredAttributes include to the namespaced isolated sanitizer constant.
sig/oauth/tty/command.rbs Aligns the type signature with the new include target.
spec/oauth/tty/auth_sanitizer_spec.rb Adds coverage asserting no top-level constants are introduced and that Command includes FilteredAttributes.
oauth-tty.gemspec Pins auth-sanitizer to >= 0.1.3 within ~> 0.1.
lib/oauth/tty/version.rb Bumps version to 1.0.8.
Gemfile.lock Reflects the version bump and dependency update to auth-sanitizer 0.1.3.
CHANGELOG.md Documents the fix under Unreleased.

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

Comment thread spec/oauth/tty/auth_sanitizer_spec.rb Outdated
@pboling pboling merged commit e28a1fb into main May 20, 2026
26 checks passed
@pboling pboling deleted the fix/top-level-namespace-pollution branch May 20, 2026 23:25
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