[codex][device-stable-id][12/n] Send source stable ID with managed auth requests

This commit is contained in:
Riley Pinkerton
2026-06-18 07:04:07 +00:00
parent e7b6e0d859
commit 82008057b1
36 changed files with 358 additions and 40 deletions
+9
View File
@@ -1,3 +1,4 @@
use std::collections::HashMap;
use std::path::Path;
use anyhow::Context;
@@ -169,6 +170,14 @@ async fn device_login_revokes_existing_auth_before_requesting_new_tokens() -> Re
"client_id": CLIENT_ID,
})
);
let token_exchange = url::form_urlencoded::parse(&requests[3].body).collect::<HashMap<_, _>>();
let installation_id = std::fs::read_to_string(codex_home.path().join("installation_id"))?;
assert_eq!(
token_exchange
.get("source_surface_stable_id")
.map(std::convert::AsRef::as_ref),
Some(installation_id.trim())
);
let auth = read_auth_json(codex_home.path())?;
assert_eq!(auth["tokens"]["refresh_token"], "new-refresh");