mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Test remote plugin archive verification end to end (#63527)
## Why Verifier unit tests exercise the signing checks in isolation. Integration tests cover how callers handle verification failures, including whether they preserve an existing cache or write checkout files. ## What changed Reuse the signed archive fixture with a mock backend to cover these paths: - `plugin/install` accepts an unsigned archive without fetching signing keys. - `plugin/reconcile` caches unsigned and valid signed releases, reuses a cached version without downloading it again, and preserves that version when a newer archive fails verification or signing keys are unavailable. - `plugin/share/checkout` writes the checkout and local metadata after successful verification and leaves them absent for a tampered archive. - The measurement reference cache rejects a tampered archive and accepts valid bytes on retry for the same plugin version. Wire the tests into Bazel and give the new RPC suite the existing app-server integration test concurrency limits in nextest. GitOrigin-RevId: bfac72216ccee6c5a33fe08ef0081fad48ac842d
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
//! Loads the signed archive and its catalog and signing-key responses from the same test vector.
|
||||
|
||||
use base64::Engine;
|
||||
use base64::engine::general_purpose::STANDARD;
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
|
||||
pub const ALLOW_HTTP_BUNDLE_DOWNLOADS: &str =
|
||||
"CODEX_TEST_ALLOW_HTTP_REMOTE_PLUGIN_BUNDLE_DOWNLOADS";
|
||||
|
||||
pub struct PluginArchiveSigningFixture {
|
||||
pub archive: Vec<u8>,
|
||||
pub signing: Value,
|
||||
pub signing_keys_response: Value,
|
||||
}
|
||||
|
||||
impl PluginArchiveSigningFixture {
|
||||
pub fn load() -> anyhow::Result<Self> {
|
||||
#[derive(Deserialize)]
|
||||
struct Vector {
|
||||
archive_base64: String,
|
||||
signing: Value,
|
||||
signing_keys_response: Value,
|
||||
}
|
||||
let vector: Vector = serde_json::from_str(include_str!(
|
||||
"../../testdata/plugin_archive_signing_v1.json"
|
||||
))?;
|
||||
Ok(Self {
|
||||
archive: STANDARD.decode(vector.archive_base64)?,
|
||||
signing: vector.signing,
|
||||
signing_keys_response: vector.signing_keys_response,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user