Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion crates/trusted-server-adapter-axum/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,19 @@ impl PlatformBackend for AxumPlatformBackend {
let port = spec
.port
.unwrap_or(if spec.scheme == "https" { 443 } else { 80 });
// Keep two providers that share an origin on distinct names so auction
// response correlation cannot cross providers.
let discriminator = spec
.discriminator
.as_deref()
.map(|d| format!("_p_{}", normalize_env_segment(d)))
.unwrap_or_default();
Ok(format!(
"{}_{}_{}",
"{}_{}_{}{}",
normalize_env_segment(&spec.scheme),
normalize_env_segment(&spec.host),
port,
discriminator,
))
}

Expand Down Expand Up @@ -644,6 +652,7 @@ mod tests {
first_byte_timeout: Duration::from_secs(15),
between_bytes_timeout: Duration::from_secs(15),
host_header_override: None,
discriminator: None,
};
let name1 = backend.predict_name(&spec).expect("should return a name");
let name2 = backend
Expand All @@ -664,6 +673,7 @@ mod tests {
first_byte_timeout: Duration::from_secs(15),
between_bytes_timeout: Duration::from_secs(15),
host_header_override: None,
discriminator: None,
};
assert_eq!(
backend.predict_name(&spec).expect("should return name"),
Expand Down
9 changes: 8 additions & 1 deletion crates/trusted-server-adapter-cloudflare/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ impl PlatformBackend for NoopBackend {
} else {
"_nocert"
};
// Keep two providers that share an origin on distinct names so auction
// response correlation cannot cross providers.
let discriminator = spec
.discriminator
.as_deref()
.map(|d| format!("_p_{d}"))
.unwrap_or_default();
Ok(format!(
"{}_{}_{}_{timeout_ms}ms{cert_suffix}",
"{}_{}_{}_{timeout_ms}ms{cert_suffix}{discriminator}",
spec.scheme, spec.host, port
))
}
Expand Down
1 change: 1 addition & 0 deletions crates/trusted-server-adapter-fastly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ log = { workspace = true }
log-fastly = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = { workspace = true }
trusted-server-core = { workspace = true }
url = { workspace = true }
urlencoding = { workspace = true }
Expand Down
Loading
Loading