diff --git a/Cargo.lock b/Cargo.lock
index cd83e61508..96c50f7e5f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2619,6 +2619,7 @@ dependencies = [
"clock",
"cocoa 0.26.0",
"collections",
+ "credentials_provider",
"feature_flags",
"futures 0.3.31",
"gpui",
@@ -3477,6 +3478,19 @@ dependencies = [
"crc",
]
+[[package]]
+name = "credentials_provider"
+version = "0.1.0"
+dependencies = [
+ "anyhow",
+ "futures 0.3.31",
+ "gpui",
+ "paths",
+ "release_channel",
+ "serde",
+ "serde_json",
+]
+
[[package]]
name = "criterion"
version = "0.5.1"
@@ -6985,6 +6999,7 @@ dependencies = [
"client",
"collections",
"copilot",
+ "credentials_provider",
"deepseek",
"editor",
"feature_flags",
@@ -16682,6 +16697,7 @@ dependencies = [
"command_palette_hooks",
"component_preview",
"copilot",
+ "credentials_provider",
"db",
"diagnostics",
"editor",
diff --git a/Cargo.toml b/Cargo.toml
index 15edf729ca..448f653a51 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,6 +16,7 @@ members = [
"crates/auto_update",
"crates/auto_update_ui",
"crates/breadcrumbs",
+ "crates/buffer_diff",
"crates/call",
"crates/channel",
"crates/cli",
@@ -31,10 +32,10 @@ members = [
"crates/context_server",
"crates/context_server_settings",
"crates/copilot",
+ "crates/credentials_provider",
"crates/db",
"crates/deepseek",
"crates/diagnostics",
- "crates/buffer_diff",
"crates/docs_preprocessor",
"crates/editor",
"crates/evals",
@@ -233,6 +234,7 @@ component_preview = { path = "crates/component_preview" }
context_server = { path = "crates/context_server" }
context_server_settings = { path = "crates/context_server_settings" }
copilot = { path = "crates/copilot" }
+credentials_provider = { path = "crates/credentials_provider" }
db = { path = "crates/db" }
deepseek = { path = "crates/deepseek" }
diagnostics = { path = "crates/diagnostics" }
diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml
index f52f9559e8..e36d71b3dc 100644
--- a/crates/client/Cargo.toml
+++ b/crates/client/Cargo.toml
@@ -22,6 +22,7 @@ async-tungstenite = { workspace = true, features = ["async-std", "async-tls"] }
chrono = { workspace = true, features = ["serde"] }
clock.workspace = true
collections.workspace = true
+credentials_provider.workspace = true
feature_flags.workspace = true
futures.workspace = true
gpui.workspace = true
diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs
index 1b2d007f54..658c32ecfa 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -15,6 +15,7 @@ use async_tungstenite::tungstenite::{
};
use chrono::{DateTime, Utc};
use clock::SystemClock;
+use credentials_provider::CredentialsProvider;
use futures::{
channel::oneshot, future::BoxFuture, AsyncReadExt, FutureExt, SinkExt, Stream, StreamExt,
TryFutureExt as _, TryStreamExt,
@@ -57,14 +58,6 @@ static ZED_SERVER_URL: LazyLock