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

wrong host passed to dependencies #337

Closed
antoine-sachet opened this issue Apr 9, 2019 · 1 comment · Fixed by #345
Closed

wrong host passed to dependencies #337

antoine-sachet opened this issue Apr 9, 2019 · 1 comment · Fixed by #345

Comments

@antoine-sachet
Copy link
Contributor

antoine-sachet commented Apr 9, 2019

The host passed at top level is passed to the dependencies. This causes the install to fail when the dependency host should be different.

Consider:

  • Package A on bitbucket. Its DESCRIPTION has a Remotes field with github::antoine-sachet/packageB

  • Package B on github.

Installing package A with install_bitbucket("bbuser/packageA") fails!

Indeed, with the host in ... being passed to the dependencies, I end up with a github_remote with host = "api.bitbucket.org/2.0". Incidentally, this results in #322.

This issue was introduced by #145 ... It's a bad idea to pass the host to dependencies. I thought the correct way to specify the dependencies' hosts was through the "Remotes" field of the DESCRIPTION?

This is also to some extent a security concern. My credentials are passed to a dependency's host if the corresponding XXX_remote() matches the arguments of install_YYY().

@antoine-sachet
Copy link
Contributor Author

antoine-sachet commented Apr 10, 2019

Basically, any package with a dependency hosted with another service will fail to install. All the remote prefixes like bitbucket::, github::, gitlab::, etc prefixes are broken.

In my case, installing a github dependency from a bitbucket package, I simply end up with a github_remote with bitbucket as the host.

It is even worse in the case of e.g. a gitlab package with a dependency on a github package, because not only would the host be wrong, but the wrong auth_token would be sent.

antoine-sachet added a commit to antoine-sachet/remotes that referenced this issue Apr 10, 2019
Effectively reverts r-lib#145. This will break the install of private dependencies for people who used the auth_token (or equivalent) argument. It is however easy and more robust to pass credentials to the deps via environment variables.
jimhester pushed a commit that referenced this issue Apr 10, 2019
Effectively reverts some of #145. This will break the install of private dependencies for people who used the auth_token (or equivalent) argument. It is however easy and more robust to pass credentials to the deps via environment variables.

Fixes #337
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 a pull request may close this issue.

1 participant