mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
d45cd26248
## Summary - Adapts the moved `codex-cloud-config` crate from the legacy cloud requirements endpoint to the new config bundle endpoint. - Switches runtime consumers from `CloudRequirementsLoader` to `CloudConfigBundleLoader` so one shared bundle supplies cloud-delivered config and requirements. - Removes the legacy cloud requirements domain loader path. ## Details This intentionally keeps `codex-cloud-config` monolithic for review lineage: the previous PR establishes the crate move, and this PR shows the behavior change against that moved implementation. A follow-up PR splits the module back into focused files. The new bundle path preserves the important cloud requirements loader semantics where intended: account-scoped signed cache, 30 minute TTL, 5 minute refresh cadence, retry/backoff, auth recovery, and fail-closed startup loading. The cached payload changes from a single requirements TOML string to the backend-delivered bundle, and validation rejects malformed config or requirements fragments before cache write/use.
26 lines
744 B
Rust
26 lines
744 B
Rust
use super::*;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
#[test]
|
|
fn adds_enterprise_requirements_in_order() {
|
|
let bundle = CloudConfigBundleFixture::enterprise_requirement("first")
|
|
.add_enterprise_requirement("second")
|
|
.into_bundle();
|
|
|
|
assert_eq!(
|
|
bundle.requirements_toml.enterprise_managed,
|
|
vec![
|
|
CloudRequirementsFragment {
|
|
id: "req_1".to_string(),
|
|
name: "Base requirements".to_string(),
|
|
contents: "first".to_string(),
|
|
},
|
|
CloudRequirementsFragment {
|
|
id: "req_2".to_string(),
|
|
name: "Requirements 2".to_string(),
|
|
contents: "second".to_string(),
|
|
},
|
|
]
|
|
);
|
|
}
|