mirror of
https://github.com/openai/codex.git
synced 2026-05-04 05:11:37 +03:00
Add /api-provision to app-server TUI
Wire the app-backed UI through a new internal ephemeral API-key login path so /api-provision can reuse the browser provisioning flow, persist OPENAI_API_KEY to .env, and hot-apply the key without writing auth.json.
Co-authored-by: Codex <noreply@openai.com>
(cherry picked from commit e7d7aebb48)
This commit is contained in:
@@ -832,6 +832,18 @@ impl McpProcess {
|
||||
self.send_request("account/login/start", Some(params)).await
|
||||
}
|
||||
|
||||
/// Send an `account/login/start` JSON-RPC request for ephemeral API key login.
|
||||
pub async fn send_login_account_ephemeral_api_key_request(
|
||||
&mut self,
|
||||
api_key: &str,
|
||||
) -> anyhow::Result<i64> {
|
||||
let params = serde_json::json!({
|
||||
"type": "ephemeralApiKey",
|
||||
"apiKey": api_key,
|
||||
});
|
||||
self.send_request("account/login/start", Some(params)).await
|
||||
}
|
||||
|
||||
/// Send an `account/login/start` JSON-RPC request for ChatGPT login.
|
||||
pub async fn send_login_account_chatgpt_request(&mut self) -> anyhow::Result<i64> {
|
||||
let params = serde_json::json!({
|
||||
|
||||
Reference in New Issue
Block a user