Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect auth set in upstream host uri #317

Merged

Conversation

jebentier
Copy link
Contributor

Description:

Some private gem repos like Gemfury use Basic Auth with just an api key rather than a username and password (ex. https://<api_key>@gem.fury.io/<repo>). Setting up upstream mirroring for this case should work as described in #247, but because Faraday does not respect Basic Authentication being passed in the URL unless its of the user:pass format, some additional logic was needed to support this use case.


Tasks:

  • Describe the problem / feature
  • Write tests

I will abide by the code of conduct.

@olleolleolle
Copy link
Member

Awesome addition!

@olleolleolle
Copy link
Member

spec/gemstash/http_client_spec.rb:25:12: C: Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
  describe '#for' do
           ^^^^^^
spec/gemstash/http_client_spec.rb:26:13: C: Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
    context 'when user:pass auth is in the upstream url' do
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/gemstash/http_client_spec.rb:32:13: C: Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
    context 'when api_key auth is in the upstream url' do
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/gemstash/http_client_spec.rb:38:13: C: Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
    context 'when no auth is included in the upstream url' do
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

@jebentier
Copy link
Contributor Author

@olleolleolle Thank you for getting the test run done, I've gone ahead and fixed up the linter errors.

@olleolleolle
Copy link
Member

I noted that the JRuby 9.2 build had failures from having a too-old RubyGems preinstalled: now we updated, and we went from "erroring the build" to "one test failure".

@olleolleolle olleolleolle merged commit 1cc83ad into rubygems:master Jun 9, 2022
@olleolleolle
Copy link
Member

@jebentier This is now merged!

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.

2 participants