mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
Enforce managed authentication backend settings (#39043)
## What changed - Add `cli_auth_credentials_store` and `chatgpt_base_url` as exact managed requirements loaded from local requirements configuration. - Apply these requirements to runtime and bootstrap authentication configuration, overriding user-configured values. - Expose the managed values through `configRequirements/read` and reject attempts to change them through config write APIs. - Ignore these local-only authentication requirements in cloud-managed requirement layers. ## Testing - Cover requirement loading and composition, runtime and bootstrap overrides, app-server responses, and read-only config writes. GitOrigin-RevId: 8ea9c096386072036ca5441f3d48af8707988a65
This commit is contained in:
1 parent
d0fd4e830a
commit
0f21cb3413
24 files changed
+458
-22
No files matched your search
@@ -383,6 +383,8 @@ pub struct ConfigReadResponse {
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ConfigRequirements {
|
||||
pub cli_auth_credentials_store: Option<CliAuthCredentialsStoreMode>,
|
||||
pub chatgpt_base_url: Option<String>,
|
||||
#[experimental(nested)]
|
||||
pub allowed_approval_policies: Option<Vec<AskForApproval>>,
|
||||
#[experimental("configRequirements/read.allowedApprovalsReviewers")]
|
||||
@@ -417,6 +419,16 @@ pub struct ConfigRequirements {
|
||||
pub windows_sandbox_private_desktop: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/", rename_all = "camelCase")]
|
||||
pub enum CliAuthCredentialsStoreMode {
|
||||
File,
|
||||
Keyring,
|
||||
Auto,
|
||||
Ephemeral,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
|
||||
@@ -1994,6 +1994,8 @@ fn config_approvals_reviewer_is_marked_experimental() {
|
||||
fn config_requirements_granular_allowed_approval_policy_is_marked_experimental() {
|
||||
let reason =
|
||||
crate::experimental_api::ExperimentalApi::experimental_reason(&ConfigRequirements {
|
||||
cli_auth_credentials_store: None,
|
||||
chatgpt_base_url: None,
|
||||
allowed_approval_policies: Some(vec![AskForApproval::Granular {
|
||||
sandbox_approval: true,
|
||||
rules: true,
|
||||
|
||||
Reference in new issue
Block a user