Skip to content

Commit ab96cdd

Browse files
committed
hub_auth
1 parent abc25e8 commit ab96cdd

10 files changed

Lines changed: 828 additions & 3 deletions

File tree

‎Cargo.lock‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ hyper-util = "0.1.20"
4949
minisign-verify = "0.2.5"
5050
plist = "1.10.1"
5151
regex = "1.13.1"
52+
reqwest = { version = "0.13.5", default-features = false, features = ["rustls-no-provider"] }
5253
rustls-native-certs = "0.8.4"
5354
semver = "1.0.28"
5455
serde = { version = "1", features = ["derive"] }
@@ -62,7 +63,7 @@ tauri-plugin-updater = { version = "2.11.0", default-features = false, features
6263
tempfile = "3.27.0"
6364
uuid = { version = "1.26.0", features = ["v4"] }
6465
toml_edit = "0.25.15"
65-
tokio = { version = "1.49.0", features = ["sync", "process", "time"] }
66+
tokio = { version = "1.49.0", features = ["sync", "process", "time", "net", "io-util"] }
6667
tokio-rustls = { version = "0.26.5", default-features = false, features = ["ring", "tls12"] }
6768

6869
# Read the optimization guideline for more details:

‎crates/wizard-core/src/settings.rs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pub struct Settings {
1212
pub codex_proxy_enable: bool,
1313
#[serde(rename = "coreinfra_api_key", skip_serializing_if = "String::is_empty")]
1414
pub coreinfra_token: String,
15+
/// Account session, independent of agent tokens. Never expose through IPC.
16+
#[serde(skip_serializing_if = "String::is_empty")]
17+
pub hub_session: String,
1518
#[serde(skip_serializing_if = "Option::is_none")]
1619
pub codex_path_last: Option<PathBuf>,
1720
#[serde(skip_serializing_if = "Option::is_none")]
@@ -24,6 +27,18 @@ pub struct Settings {
2427
pub opencode_path_last: Option<PathBuf>,
2528
#[serde(skip_serializing_if = "Option::is_none")]
2629
pub pi_path_last: Option<PathBuf>,
30+
/// Account shown in the Hub tile, captured from `/hub/api/profile` at login.
31+
/// Kept last: it serializes as a TOML table.
32+
#[serde(skip_serializing_if = "Option::is_none")]
33+
pub hub_profile: Option<HubProfile>,
34+
}
35+
36+
/// Displayable Hub account details. Deserializing a profile response keeps only these fields.
37+
#[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
38+
pub struct HubProfile {
39+
pub username: String,
40+
#[serde(skip_serializing_if = "Option::is_none")]
41+
pub verified_email: Option<String>,
2742
}
2843

2944
impl Settings {

‎crates/wizard-gui/Cargo.toml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ tauri-build = { workspace = true, features = [] }
2424
[dependencies]
2525
anyhow.workspace = true
2626
log.workspace = true
27+
reqwest.workspace = true
2728
serde.workspace = true
2829
serde_json = { workspace = true, features = ["std"] }
2930
tauri = { workspace = true, features = [] }
3031
tauri-plugin-log.workspace = true
3132
tauri-plugin-single-instance.workspace = true
3233
tauri-plugin-updater.workspace = true
3334
tokio.workspace = true
35+
tokio-rustls.workspace = true
3436
wizard-core.workspace = true
3537
wizard-proxy.workspace = true
3638

0 commit comments

Comments
 (0)