Mastercard / oauth1-signer-ruby

Zero dependency library for generating a Mastercard API compliant OAuth signature.
https://developer.mastercard.com/platform/documentation/security-and-authentication/using-oauth-1a-to-access-mastercard-apis/
MIT License
5 stars 0 forks source link

Namespace `oauth.rb` #19

Closed radar closed 1 year ago

radar commented 2 years ago

When the LOAD_PATH is configured for a Ruby application, the lib directory for the gems it depends on are added. This is done through Bundler.setup, but could be done through other means, too.

This gem provides a top-level oauth.rb, but so does https://github.com/oauth-xx/oauth-ruby/tree/main/lib. If these two gems are used synchronously in a Ruby project, the file that is included by:

require "oauth"

Is non-deterministic. It's either:

  1. This gem
  2. The oauth gem

Not only this, but your OAuth class will also clash with that gem's constant too.

I'd recommend:

  1. Changing the file path to lib/mastercard/oauth.rb
  2. Changing the constant to Mastercard::OAuth
danny-gallagher commented 1 year ago

Hi @radar, Thanks for raising the issue. We haven't run into anyone using 2 OAuth libraries simultaneously, maybe it's a big of an edge case. But if you'd like to create a PR with the proposed changes above, we'd be happy to take a look.