Skip to content

Commit

Permalink
feat!: use git-credentials in git-protocol (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Apr 15, 2022
1 parent 3d339d5 commit 32dc182
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 297 deletions.
10 changes: 9 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ check: ## Build all code in suitable configurations
&& cargo check --features verbose-object-parsing-errors
cd git-index && cargo check --features serde1
cd git-credentials && cargo check --features serde1
cd git-sec && cargo check --features serde1
cd git-revision && cargo check --features serde1
cd git-attributes && cargo check --features serde1
cd git-glob && cargo check --features serde1
Expand Down
1 change: 1 addition & 0 deletions git-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ required-features = ["async-client"]
git-features = { version = "^0.20.0", path = "../git-features", features = ["progress"] }
git-transport = { version = "^0.16.0", path = "../git-transport" }
git-hash = { version = "^0.9.3", path = "../git-hash" }
git-credentials = { version = "^0.1.0", path = "../git-credentials" }

quick-error = "2.0.0"
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
Expand Down
175 changes: 0 additions & 175 deletions git-protocol/src/credentials.rs

This file was deleted.

2 changes: 1 addition & 1 deletion git-protocol/src/fetch/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ quick_error! {
from()
source(err)
}
Credentials(err: credentials::Error) {
Credentials(err: credentials::helper::Error) {
display("Failed to obtain, approve or reject credentials")
from()
source(err)
Expand Down
6 changes: 3 additions & 3 deletions git-protocol/src/fetch_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub async fn fetch<F, D, T>(
fetch_mode: FetchConnection,
) -> Result<(), Error>
where
F: FnMut(credentials::Action<'_>) -> credentials::Result,
F: FnMut(credentials::helper::Action<'_>) -> credentials::helper::Result,
D: Delegate,
T: client::Transport,
{
Expand All @@ -85,8 +85,8 @@ where
drop(result); // needed to workaround this: https://github.com/rust-lang/rust/issues/76149
let url = transport.to_url();
progress.set_name("authentication");
let credentials::Outcome { identity, next } =
authenticate(credentials::Action::Fill(&url))?.expect("FILL provides an identity");
let credentials::helper::Outcome { identity, next } =
authenticate(credentials::helper::Action::Fill(&url))?.expect("FILL provides an identity");
transport.set_identity(identity)?;
progress.step();
progress.set_name("handshake (authenticated)");
Expand Down
3 changes: 1 addition & 2 deletions git-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
#![deny(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]

pub use git_credentials as credentials;
/// A convenience export allowing users of git-protocol to use the transport layer without their own cargo dependency.
pub use git_transport as transport;

///
pub mod credentials;
///
#[cfg(any(feature = "blocking-client", feature = "async-client"))]
pub mod fetch;
Expand Down
1 change: 0 additions & 1 deletion git-protocol/tests/async-protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ pub fn fixture_bytes(path: &str) -> Vec<u8> {
.expect("fixture to be present and readable")
}

mod credentials;
mod fetch;
mod remote_progress;
1 change: 0 additions & 1 deletion git-protocol/tests/blocking-protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ pub fn fixture_bytes(path: &str) -> Vec<u8> {
.expect("fixture to be present and readable")
}

mod credentials;
mod fetch;
mod remote_progress;
86 changes: 0 additions & 86 deletions git-protocol/tests/credentials/mod.rs

This file was deleted.

0 comments on commit 32dc182

Please sign in to comment.