Skip to content

Commit 1b73ac9

Browse files
authored
Add a version policy for the techport server (#9477)
1 parent b7ba37f commit 1b73ac9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

nexus/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,18 @@ impl Server {
250250
log.new(o!("component" => "dropshot_external_techport")),
251251
)
252252
.config(techport_server_config)
253+
.version_policy(dropshot::VersionPolicy::Dynamic(Box::new(
254+
dropshot::ClientSpecifiesVersionInHeader::new(
255+
omicron_common::api::VERSION_HEADER,
256+
nexus_external_api::latest_version(),
257+
)
258+
// Since we don't have control over all clients to the external
259+
// API, we allow the api-version header to not be specified
260+
// (picking the latest version in that case). However, all
261+
// clients that *are* under our control should specify the
262+
// api-version header.
263+
.on_missing(nexus_external_api::latest_version()),
264+
)))
253265
.tls(tls_config.map(dropshot::ConfigTls::Dynamic))
254266
.start()
255267
.map_err(|error| {

0 commit comments

Comments
 (0)