mirror of
https://github.com/block/buzz.git
synced 2026-11-26 11:12:22 +00:00
docs(runtime): describe trusted launcher API contract
Signed-off-by: Alex Rosenzweig <arosenzweig@squareup.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
//! Local certificate verification for protected agents and their CLI helpers.
|
||||
use std::path::Path;
|
||||
/// Optional launcher-owned certificate snapshot path.
|
||||
pub const ROOTS_ENV: &str = "BUZZ_SANDBOX_TLS_ROOTS";
|
||||
/// Use ordinary platform trust unless an explicit launcher snapshot is configured.
|
||||
pub fn http_builder() -> Result<reqwest::ClientBuilder, anyhow::Error> {
|
||||
let builder = reqwest::Client::builder();
|
||||
match std::env::var_os(ROOTS_ENV) {
|
||||
@@ -8,6 +10,7 @@ pub fn http_builder() -> Result<reqwest::ClientBuilder, anyhow::Error> {
|
||||
Some(path) => builder_with_roots(builder, Path::new(&path)),
|
||||
}
|
||||
}
|
||||
/// Restrict verification to a nonempty DER certificate snapshot; invalid input fails closed.
|
||||
pub fn builder_with_roots(
|
||||
builder: reqwest::ClientBuilder,
|
||||
path: &Path,
|
||||
|
||||
Reference in New Issue
Block a user