Skip to content

Allow to pass registry ssh key #65

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

Merged
merged 2 commits into from
May 22, 2022
Merged

Conversation

l4l
Copy link
Contributor

@l4l l4l commented Aug 22, 2021

No description provided.

@pietroalbini
Copy link
Member

Hello, and thanks for the PR!

The code changes look good, but I'm worried about the extensibility of the API, as git2 supports more authentication methods than just in-memory SSH keys. I think the most extensible solution would be to make the AlternativeRegistry struct public, with an API similar to this:

use rustwide::{AlternativeRegistry, Crate};

let mut registry = AlternativeRegistry::new("https://github.com/rust-lang/crates.io-index");
registry.authenticate_with_ssh_key("key");

let krate = Crate::registry(&registry, "name", "version");

@l4l
Copy link
Contributor Author

l4l commented Oct 27, 2021

Oh, it seems I missed a notification for that thread, sorry for that.

AlternativeRegistry as a pub item makes a perfect sense, although it seems to be a breaking change. Is it fine?

UPD: it seems current changes are breaking anyway due to new Crate::registry arg. So I just proceed with the proposed option.

@pietroalbini
Copy link
Member

Sounds good! We're also pre-1.0 on rustwide, so it's fine to make breaking changes, especially to make the API easier to extend in the future!

@jyn514
Copy link
Member

jyn514 commented Nov 13, 2021

@pietroalbini I think this is waiting on your review.

@gregvirgin
Copy link

I'm currently working with cloudsmith.io, which will only support git credentials. We're configuring our own image to get around this, but want to see if this method could support adding to .git-credentials on the image as well.

@pietroalbini
Copy link
Member

Sorry for the late merge, will release this soon!

@pietroalbini pietroalbini merged commit c184687 into rust-lang:master May 22, 2022
@pietroalbini
Copy link
Member

Released rustwide 0.15.0 with this change.

@l4l l4l deleted the registry-key branch May 24, 2022 11:26
syphar added a commit to syphar/docs.rs that referenced this pull request May 30, 2022
* using the changes from Byron/crates-index-diff-rs#15
* also upgrades `rustwide` and `git2` since `crates-index-diff`
  the includes release includes an update of `libgit2`
* adaptions due to `rustwide` changes in
  rust-lang/rustwide#65
syphar added a commit to syphar/docs.rs that referenced this pull request May 30, 2022
* using the changes from Byron/crates-index-diff-rs#15
* also upgrades `rustwide` and `git2` since `crates-index-diff`
  the includes release includes an update of `libgit2`
* adaptions due to `rustwide` changes in
  rust-lang/rustwide#65
syphar added a commit to rust-lang/docs.rs that referenced this pull request Jun 9, 2022
* using the changes from Byron/crates-index-diff-rs#15
* also upgrades `rustwide` and `git2` since `crates-index-diff`
  the includes release includes an update of `libgit2`
* adaptions due to `rustwide` changes in
  rust-lang/rustwide#65
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.

4 participants