diff --git a/README.md b/README.md index 58b53dc..62baaf6 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ The guest has no network device. ## The vendored driver `vendor/openshell` holds one crate: OpenShell's VM driver (`openshell-driver-vm`), taken from -NVIDIA/OpenShell release `v0.1.9` (commit `ce58cf8`, pinned in [`driver/UPSTREAM.env`](driver/UPSTREAM.env)) and +NVIDIA/OpenShell `main` at commit `f16795b` (after `v0.1.9`; not a release; pinned in [`driver/UPSTREAM.env`](driver/UPSTREAM.env)) and trimmed. It is its own cargo workspace. The other OpenShell crates it uses (`openshell-core` and friends) are **git dependencies on the same commit**, not copies, so building needs network access to GitHub. The changes from upstream are listed in @@ -61,8 +61,9 @@ pinned commit when a release is made. `mise run driver:check-pin` fails if the r ### Compatibility The supervisor protocol is not stable across OpenShell revisions, so the gateway must come -from a revision compatible with the one in `driver/UPSTREAM.env`, currently the `v0.1.9` -release, so run a `v0.1.9` gateway. Other releases have not been checked. `install.sh` prints +from a revision compatible with the one in `driver/UPSTREAM.env`, currently `main` +at `f16795b`, which is not a release: build the gateway from that commit. Released gateways, +`v0.1.9` included, have not been checked against it. `install.sh` prints the commit the installed driver was built from and the gateway's reported version, and leaves the comparison to you. diff --git a/driver/UPSTREAM.env b/driver/UPSTREAM.env index 0cf8478..fd131d0 100644 --- a/driver/UPSTREAM.env +++ b/driver/UPSTREAM.env @@ -8,8 +8,8 @@ # driver crate from it (see crates/openshell-driver-vm/README.md), then change the commit here # and the `rev` in vendor/openshell/Cargo.toml. OPENSHELL_REPO=https://github.com/NVIDIA/OpenShell -OPENSHELL_COMMIT=ce58cf8e9b953281352d98a637e41616295b1318 -OPENSHELL_TAG=v0.1.9 +OPENSHELL_COMMIT=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9 +OPENSHELL_TAG= # Optional: build the embedded runtime (host supervisor, guest sandbox, guest init) from # another revision than the pin above, to try an OpenShell change against an unchanged diff --git a/vendor/openshell/Cargo.lock b/vendor/openshell/Cargo.lock index 9670324..bceac5f 100644 --- a/vendor/openshell/Cargo.lock +++ b/vendor/openshell/Cargo.lock @@ -54,6 +54,17 @@ dependencies = [ "libc", ] +[[package]] +name = "annotate-snippets" +version = "0.12.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0258346f92c78dbc5b336b9a5b27c64447aa10643bc64e651db2edb145361564" +dependencies = [ + "anstyle", + "memchr", + "unicode-width 0.2.2", +] + [[package]] name = "anstream" version = "1.0.0" @@ -90,7 +101,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -101,7 +112,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -119,6 +130,12 @@ dependencies = [ "rustversion", ] +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + [[package]] name = "asn1-rs" version = "0.7.2" @@ -617,6 +634,12 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -708,8 +731,18 @@ version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + +[[package]] +name = "darling" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" +dependencies = [ + "darling_core 0.24.1", + "darling_macro 0.24.1", ] [[package]] @@ -726,17 +759,41 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "darling_core" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 3.0.5", +] + [[package]] name = "darling_macro" version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core", + "darling_core 0.20.11", "quote", "syn 2.0.117", ] +[[package]] +name = "darling_macro" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" +dependencies = [ + "darling_core 0.24.1", + "quote", + "syn 3.0.5", +] + [[package]] name = "data-encoding" version = "2.10.0" @@ -781,7 +838,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ - "darling", + "darling 0.20.11", "proc-macro2", "quote", "syn 2.0.117", @@ -797,6 +854,27 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.117", +] + [[package]] name = "digest" version = "0.10.7" @@ -849,14 +927,14 @@ checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] name = "educe" -version = "0.6.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +checksum = "a00371d2607edea062396ef1ce6ade65c8e915ac7a1277daa198208420f682c6" dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.5", ] [[package]] @@ -868,6 +946,29 @@ dependencies = [ "serde", ] +[[package]] +name = "encoding_rs" +version = "0.8.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89253175e704ab869b04f9db224d38630e0211a53841a79181deae0889e169f5" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "encoding_rs_io" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba3fe847045ecff794b9c138293a80db914678c453ad63fbf0c6a9eb6e00b22" +dependencies = [ + "encoding_rs", +] + [[package]] name = "enum-ordinalize" version = "4.4.2" @@ -901,7 +1002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -1005,9 +1106,9 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "form_urlencoded" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e" dependencies = [ "percent-encoding", ] @@ -1204,6 +1305,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "granit-parser" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd04d0d9c7079b416b458d2317aea4aa964c81938cb7c20f559758c4f422dc8" +dependencies = [ + "arraydeque", + "smallvec", +] + [[package]] name = "h2" version = "0.4.19" @@ -1229,8 +1340,6 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "allocator-api2", - "equivalent", "foldhash 0.1.5", ] @@ -1260,30 +1369,6 @@ dependencies = [ "hashbrown 0.16.1", ] -[[package]] -name = "headers" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3314d5adb5d94bcdf56771f2e50dbbc80bb4bdf88967526706205ac9eff24eb" -dependencies = [ - "base64 0.22.1", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1 0.10.6", -] - -[[package]] -name = "headers-core" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.5.0" @@ -1320,15 +1405,6 @@ dependencies = [ "digest 0.11.2", ] -[[package]] -name = "home" -version = "0.5.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "hostname" version = "0.4.2" @@ -1425,25 +1501,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-http-proxy" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1d471ea2f65ba45eddb1d6ab7d58ac2671d2d4ac14da5c6516ae1d97e1327a" -dependencies = [ - "bytes", - "futures-util", - "headers", - "http", - "hyper", - "hyper-rustls", - "hyper-util", - "pin-project-lite", - "tokio", - "tokio-rustls", - "tower-service", -] - [[package]] name = "hyper-named-pipe" version = "0.1.1" @@ -1490,16 +1547,17 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bytes", "futures-channel", "futures-util", "http", "http-body", + "httparse", "hyper", "ipnet", "libc", @@ -1720,6 +1778,41 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "jiff" +version = "0.2.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f" +dependencies = [ + "jiff-core", + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e599b80292e597019b8b3e392de3f4bea2959ddfb8c7dff60e035e9e311a2c1b" +dependencies = [ + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "jni" version = "0.21.1" @@ -1736,6 +1829,36 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.20", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.117", +] + [[package]] name = "jni-sys" version = "0.3.1" @@ -1799,9 +1922,9 @@ dependencies = [ [[package]] name = "jsonpath-rust" -version = "0.7.5" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c00ae348f9f8fd2d09f82a98ca381c60df9e0820d8d79fce43e649b4dc3128b" +checksum = "c83bc96c838e7a3de9dc89ea291363ac073371959637e3b2207556e9320547b8" dependencies = [ "pest", "pest_derive", @@ -1839,14 +1962,13 @@ dependencies = [ [[package]] name = "k8s-openapi" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c75b990324f09bef15e791606b7b7a296d02fc88a344f6eba9390970a870ad5" +checksum = "ab0d13801242174b1f3966907c3f32039f2d6b36c7ce82c61225d66ed5d1eb70" dependencies = [ "base64 0.22.1", - "chrono", + "jiff", "serde", - "serde-value", "serde_json", ] @@ -1867,9 +1989,9 @@ checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" [[package]] name = "kube" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a4eb20010536b48abe97fec37d23d43069bcbe9686adcf9932202327bc5ca6e" +checksum = "c73b082f549411623a4f8949bd24dcaedacb1511379c461c76d579fde301d021" dependencies = [ "k8s-openapi", "kube-client", @@ -1880,50 +2002,51 @@ dependencies = [ [[package]] name = "kube-client" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc2ed952042df20d15ac2fe9614d0ec14b6118eab89633985d4b36e688dccf1" +checksum = "ae56b223bca490db1f1b115bfc606d411177511d7748d8cc019a7e3b2935430b" dependencies = [ - "base64 0.22.1", + "base64 0.23.1", "bytes", - "chrono", "either", "futures", - "home", "http", "http-body", "http-body-util", "hyper", - "hyper-http-proxy", "hyper-rustls", "hyper-timeout", "hyper-util", + "jiff", "jsonpath-rust", "k8s-openapi", "kube-core", - "pem 3.0.6", + "pem 4.0.0", + "percent-encoding", "rustls", + "rustls-platform-verifier 0.7.1", "secrecy", "serde", + "serde-saphyr", "serde_json", - "serde_yaml", "thiserror 2.0.20", "tokio", "tokio-util", "tower", - "tower-http", + "tower-http 0.7.1", "tracing", ] [[package]] name = "kube-core" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff0d0793db58e70ca6d689489183816cb3aa481673e7433dc618cf7e8007c675" +checksum = "6de84b47fc1aa35ba0ef9059ef54b47c8b47f0979afd15487e525282f2d73fb9" dependencies = [ - "chrono", + "derive_more", "form_urlencoded", "http", + "jiff", "json-patch", "k8s-openapi", "schemars", @@ -1935,32 +2058,31 @@ dependencies = [ [[package]] name = "kube-derive" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c562f58dc9f7ca5feac8a6ee5850ca221edd6f04ce0dd2ee873202a88cd494c9" +checksum = "de1fb46ac34371491ac0277c13e0e1bb9288000e64c86ca3d91343754818e64e" dependencies = [ - "darling", + "darling 0.24.1", "proc-macro2", "quote", "serde", "serde_json", - "syn 2.0.117", + "syn 3.0.5", ] [[package]] name = "kube-runtime" -version = "0.99.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f34cfab9b4bd8633062e0e85edb81df23cb09f159f2e31c60b069ae826ffdc" +checksum = "9dea60005024b6ec1819c426209aa29b9eaca64f6b3988ab73c55f43fa484392" dependencies = [ "ahash", "async-broadcast", "async-stream", - "async-trait", "backon", "educe", "futures", - "hashbrown 0.15.5", + "hashbrown 0.16.1", "hostname", "json-patch", "k8s-openapi", @@ -2165,6 +2287,12 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + [[package]] name = "nix" version = "0.29.0" @@ -2177,6 +2305,12 @@ dependencies = [ "libc", ] +[[package]] +name = "nohash-hasher" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" + [[package]] name = "nom" version = "7.1.3" @@ -2208,7 +2342,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2332,7 +2466,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openshell-core" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "async-trait", "base64 0.22.1", @@ -2348,6 +2482,7 @@ dependencies = [ "openshell-extension-core", "openshell-otel", "openshell-policy-schema", + "openshell-spiffe", "prost", "prost-types", "protoc-bin-vendored", @@ -2373,7 +2508,7 @@ dependencies = [ [[package]] name = "openshell-crypto" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "aws-lc-rs", "jsonwebtoken", @@ -2410,6 +2545,7 @@ dependencies = [ "openshell-otel", "openshell-otel-test-support", "openshell-sandbox-backend", + "openshell-spiffe", "opentelemetry", "opentelemetry_sdk", "polling", @@ -2429,7 +2565,7 @@ dependencies = [ "tonic", "tonic-build", "tonic-prost", - "tower-http", + "tower-http 0.6.8", "tracing", "tracing-opentelemetry", "tracing-subscriber", @@ -2440,7 +2576,7 @@ dependencies = [ [[package]] name = "openshell-extension-core" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "hyper-util", "serde", @@ -2453,7 +2589,7 @@ dependencies = [ [[package]] name = "openshell-isolation-interface" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "openshell-core", "serde", @@ -2465,7 +2601,7 @@ dependencies = [ [[package]] name = "openshell-ocsf" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "chrono", "serde", @@ -2479,7 +2615,7 @@ dependencies = [ [[package]] name = "openshell-otel" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "async-trait", "bytes", @@ -2501,7 +2637,7 @@ dependencies = [ "thiserror 2.0.20", "tokio", "tonic", - "tower-http", + "tower-http 0.6.8", "tracing", "tracing-opentelemetry", "tracing-subscriber", @@ -2511,7 +2647,7 @@ dependencies = [ [[package]] name = "openshell-otel-test-support" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "bytes", "http", @@ -2535,7 +2671,7 @@ dependencies = [ [[package]] name = "openshell-policy-schema" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "miette", "noyalib", @@ -2548,7 +2684,7 @@ dependencies = [ [[package]] name = "openshell-sandbox-backend" version = "0.0.0" -source = "git+https://github.com/NVIDIA/OpenShell?rev=ce58cf8e9b953281352d98a637e41616295b1318#ce58cf8e9b953281352d98a637e41616295b1318" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" dependencies = [ "async-trait", "bytes", @@ -2577,6 +2713,18 @@ dependencies = [ "uuid", ] +[[package]] +name = "openshell-spiffe" +version = "0.0.0" +source = "git+https://github.com/NVIDIA/OpenShell?rev=f16795bc76b13fcc35d8b0d2b49cfc788c701ef9#f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" +dependencies = [ + "async-trait", + "base64 0.22.1", + "serde", + "serde_json", + "thiserror 2.0.20", +] + [[package]] name = "openssh" version = "0.11.6" @@ -2856,6 +3004,15 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.5" @@ -3112,7 +3269,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -3232,6 +3389,26 @@ dependencies = [ "bitflags", ] +[[package]] +name = "ref-cast" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + [[package]] name = "regex" version = "1.12.3" @@ -3292,7 +3469,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower", - "tower-http", + "tower-http 0.6.8", "tower-service", "url", "wasm-bindgen", @@ -3323,7 +3500,7 @@ dependencies = [ "quinn", "rustls", "rustls-pki-types", - "rustls-platform-verifier", + "rustls-platform-verifier 0.6.2", "serde", "serde_json", "serde_urlencoded", @@ -3332,7 +3509,7 @@ dependencies = [ "tokio-rustls", "tokio-util", "tower", - "tower-http", + "tower-http 0.6.8", "tower-service", "url", "wasm-bindgen", @@ -3367,6 +3544,15 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rusticata-macros" version = "4.1.0" @@ -3386,7 +3572,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -3434,17 +3620,38 @@ checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" dependencies = [ "core-foundation", "core-foundation-sys", - "jni", + "jni 0.21.1", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android 0.1.1", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1167586491e2b18b8bfbb293e8180ec17c201c4f076d7cb3070ca964e7598f98" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni 0.22.4", "log", "once_cell", "rustls", "rustls-native-certs", - "rustls-platform-verifier-android", + "rustls-platform-verifier-android 0.2.0", "rustls-webpki", "security-framework", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -3453,6 +3660,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +[[package]] +name = "rustls-platform-verifier-android" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eec689c0bc40ff2458a5977b6619cb718087084a18e02a131c599b62d05e1a5f" + [[package]] name = "rustls-webpki" version = "0.103.16" @@ -3497,11 +3710,12 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.22" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e" dependencies = [ "dyn-clone", + "ref-cast", "schemars_derive", "serde", "serde_json", @@ -3509,14 +3723,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.22" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +checksum = "e1c3a92094fa7d61aa124645844facb6b554dfc797136d0f5fd1f890e2bffc69" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.117", + "syn 3.0.5", ] [[package]] @@ -3573,6 +3787,23 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-saphyr" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "969cde0349344dbbf58b5f9badbfb8f806db13969364eb8007c057ef687007d9" +dependencies = [ + "annotate-snippets", + "base64 0.23.1", + "encoding_rs_io", + "granit-parser", + "nohash-hasher", + "num-traits", + "serde_core", + "smallvec", + "zmij", +] + [[package]] name = "serde-value" version = "0.7.0" @@ -3605,13 +3836,13 @@ dependencies = [ [[package]] name = "serde_derive_internals" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.5", ] [[package]] @@ -3661,30 +3892,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures 0.2.17", - "digest 0.10.7", -] - [[package]] name = "sha1" version = "0.11.0" @@ -3764,6 +3971,22 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "simple_asn1" version = "0.6.4" @@ -3798,7 +4021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3945,7 +4168,7 @@ dependencies = [ "log", "percent-encoding", "serde", - "sha1 0.11.0", + "sha1", "sha2 0.11.0", "sqlx-core", "thiserror 2.0.20", @@ -4151,7 +4374,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -4161,7 +4384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4450,14 +4673,12 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "base64 0.22.1", "bitflags", "bytes", "futures-util", "http", "http-body", "iri-string", - "mime", "pin-project-lite", "tower", "tower-layer", @@ -4466,6 +4687,26 @@ dependencies = [ "uuid", ] +[[package]] +name = "tower-http" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a05a66a4fdd61cbbe0a1d755ffe0ca6aba159dd4820936a0ff8a8278245b9c" +dependencies = [ + "base64 0.22.1", + "bitflags", + "bytes", + "http", + "http-body", + "mime", + "percent-encoding", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -4643,12 +4884,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.7.1" @@ -4663,9 +4898,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.8" +version = "2.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a" dependencies = [ "form_urlencoded", "idna", @@ -4925,7 +5160,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.52.0", ] [[package]] @@ -5011,15 +5246,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -5053,30 +5279,13 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", + "windows_i686_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -5089,12 +5298,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -5107,12 +5310,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -5125,24 +5322,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -5155,12 +5340,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -5173,12 +5352,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -5191,12 +5364,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -5209,12 +5376,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "wit-bindgen" version = "0.51.0" diff --git a/vendor/openshell/Cargo.toml b/vendor/openshell/Cargo.toml index 59f1888..74e9217 100644 --- a/vendor/openshell/Cargo.toml +++ b/vendor/openshell/Cargo.toml @@ -17,12 +17,13 @@ repository = "https://github.com/NVIDIA/OpenShell" # The rest of OpenShell, from the revision driver/UPSTREAM.env names (keep the two in sync: # `mise run driver:check-pin` checks). The host supervisor and guest binaries the driver # embeds are built from that revision too. -openshell-core = { git = "https://github.com/NVIDIA/OpenShell", rev = "ce58cf8e9b953281352d98a637e41616295b1318", default-features = false } -openshell-isolation-interface = { git = "https://github.com/NVIDIA/OpenShell", rev = "ce58cf8e9b953281352d98a637e41616295b1318" } -openshell-sandbox-backend = { git = "https://github.com/NVIDIA/OpenShell", rev = "ce58cf8e9b953281352d98a637e41616295b1318" } -openshell-otel = { git = "https://github.com/NVIDIA/OpenShell", rev = "ce58cf8e9b953281352d98a637e41616295b1318" } -openshell-otel-test-support = { git = "https://github.com/NVIDIA/OpenShell", rev = "ce58cf8e9b953281352d98a637e41616295b1318" } -openshell-crypto = { git = "https://github.com/NVIDIA/OpenShell", rev = "ce58cf8e9b953281352d98a637e41616295b1318", default-features = false, features = ["aws-lc"] } +openshell-core = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9", default-features = false } +openshell-isolation-interface = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" } +openshell-sandbox-backend = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" } +openshell-otel = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" } +openshell-otel-test-support = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" } +openshell-spiffe = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9" } +openshell-crypto = { git = "https://github.com/NVIDIA/OpenShell", rev = "f16795bc76b13fcc35d8b0d2b49cfc788c701ef9", default-features = false, features = ["aws-lc"] } # Async runtime tokio = { version = "1.53.3", features = ["full"] } diff --git a/vendor/openshell/crates/openshell-driver-vm/Cargo.toml b/vendor/openshell/crates/openshell-driver-vm/Cargo.toml index 5e9114b..37c2dc6 100644 --- a/vendor/openshell/crates/openshell-driver-vm/Cargo.toml +++ b/vendor/openshell/crates/openshell-driver-vm/Cargo.toml @@ -122,6 +122,7 @@ tonic-build = { version = "0.14", optional = true } [dev-dependencies] spiffe = { workspace = true } openshell-otel-test-support = { workspace = true } +openshell-spiffe = { workspace = true } temp-env = "0.3" tempfile = "3" rcgen = { workspace = true } diff --git a/vendor/openshell/crates/openshell-driver-vm/src/driver.rs b/vendor/openshell/crates/openshell-driver-vm/src/driver.rs index b13b12a..86432b4 100644 --- a/vendor/openshell/crates/openshell-driver-vm/src/driver.rs +++ b/vendor/openshell/crates/openshell-driver-vm/src/driver.rs @@ -14,7 +14,7 @@ use crate::image_cache_gc; use crate::image_config::{ImageRuntimeConfig, layered_environment, validate_default_working_dir}; use crate::isolation::VmBoundarySpec; -use crate::layer_applier::apply_layer_dir_to_rootfs; +use crate::layer_applier::BootstrapExtractionBudget; use crate::lifecycle::{ GuestInitDropin, LaunchAbortReason, LaunchPlan, LifecycleExtensionRegistry, RestoreContext, extension_state_dir, @@ -32,7 +32,7 @@ use bollard::Docker; use bollard::errors::Error as BollardError; use bollard::models::ContainerCreateBody; use bollard::query_parameters::{CreateContainerOptionsBuilder, RemoveContainerOptionsBuilder}; -use flate2::read::{GzDecoder, MultiGzDecoder}; +use flate2::read::MultiGzDecoder; use futures::{Stream, StreamExt, TryStreamExt}; use nix::errno::Errno; use nix::sys::signal::{Signal, kill}; @@ -117,6 +117,7 @@ pub const MIN_MEM_MIB: u32 = 256; /// Most virtual CPUs Firecracker gives one VM. pub const MAX_VCPUS: u8 = 32; const DEFAULT_OVERLAY_DISK_MIB: u64 = 4096; +const DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES: u64 = 10 * 1024 * 1024 * 1024; const DEFAULT_REGISTRY_LAYER_DOWNLOAD_CONCURRENCY: usize = 4; const MAX_REGISTRY_LAYER_DOWNLOAD_CONCURRENCY: usize = 16; const REGISTRY_REQUEST_MAX_ATTEMPTS: usize = 4; @@ -402,6 +403,9 @@ pub struct VmDriverConfig { pub launcher_bin: Option, pub default_image: String, pub bootstrap_image: String, + /// Per-image byte limit for host extraction of registry bootstrap layers. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub bootstrap_extraction_max_bytes: Option, pub log_level: String, /// Virtual CPUs of a sandbox that sets no `cpu_limit`. pub vcpus: u8, @@ -437,6 +441,9 @@ pub struct VmDriverConfig { /// Corporate forward proxy settings delivered to the host supervisor. #[serde(flatten)] pub upstream_proxy: UpstreamProxyConfig, + /// Policy DNS IPv6 egress mode and NAT64 prefixes for host control. + #[serde(flatten)] + pub ipv6_egress: openshell_core::SupervisorIpv6EgressConfig, /// Gateway-host PEM CA bundle staged into the guest overlay for the /// corporate proxy and TLS-intercepted server certificates. pub proxy_ca_bundle: Option, @@ -506,6 +513,10 @@ impl std::fmt::Debug for VmDriverConfig { .field("launcher_bin", &self.launcher_bin) .field("default_image", &self.default_image) .field("bootstrap_image", &self.bootstrap_image) + .field( + "bootstrap_extraction_max_bytes", + &self.bootstrap_extraction_max_bytes, + ) .field("log_level", &self.log_level) .field("vcpus", &self.vcpus) .field("max_vcpus", &self.max_vcpus) @@ -545,6 +556,7 @@ impl std::fmt::Debug for VmDriverConfig { "proxy_ca_bundle_configured", &self.proxy_ca_bundle.is_some(), ) + .field("ipv6_egress", &self.ipv6_egress) .field( "provider_spiffe_workload_api_tcp_endpoint_configured", &self.provider_spiffe_workload_api_tcp_endpoint.is_some(), @@ -588,6 +600,7 @@ impl Default for VmDriverConfig { launcher_bin: None, default_image: String::new(), bootstrap_image: String::new(), + bootstrap_extraction_max_bytes: None, log_level: "info".to_string(), vcpus: DEFAULT_VCPUS, max_vcpus: None, @@ -602,6 +615,7 @@ impl Default for VmDriverConfig { additional_ca_certificate_count: None, additional_ca_snapshot: None, upstream_proxy: UpstreamProxyConfig::default(), + ipv6_egress: openshell_core::SupervisorIpv6EgressConfig::default(), proxy_ca_bundle: None, provider_spiffe_workload_api_tcp_endpoint: None, provider_spiffe_allow_guest_tcp: false, @@ -631,6 +645,7 @@ impl VmDriverConfig { pub fn validate_runtime_security_config(&self) -> Result<(), String> { self.upstream_proxy.validate()?; + self.ipv6_egress.validate()?; if let Some(path) = self.proxy_ca_bundle.as_ref() { if path.as_os_str().is_empty() { return Err("proxy_ca_bundle must not be empty when set".to_string()); @@ -1747,6 +1762,7 @@ impl VmDriver { .arg(&auth_bundle_path) .args(upstream_proxy_args) .args(network_trust_args) + .args(self.config.ipv6_egress.supervisor_args()) .env( openshell_core::sandbox_env::ADMITTED_ISOLATION_BACKEND, DRIVER_ADMITTED_BACKEND, @@ -5217,12 +5233,9 @@ impl VmDriver { tokio::fs::create_dir_all(image_cache_root_dir(&self.config.state_dir)) .await .map_err(|err| Status::internal(format!("create image cache dir failed: {err}")))?; - tokio::fs::create_dir_all(&cache_dir) - .await - .map_err(|err| Status::internal(format!("create image cache dir failed: {err}")))?; if tokio::fs::metadata(&staging_dir).await.is_ok() { - tokio::fs::remove_dir_all(&staging_dir) + remove_bootstrap_staging(&staging_dir) .await .map_err(|err| { Status::internal(format!( @@ -5258,7 +5271,7 @@ impl VmDriver { error = %err.message(), "vm driver: pull_registry_image_rootfs failed" ); - let _ = tokio::fs::remove_dir_all(&staging_dir).await; + let _ = remove_bootstrap_staging(&staging_dir).await; return Err(err); } info!( @@ -5305,7 +5318,7 @@ impl VmDriver { error = %err, "vm driver: rootfs preparation failed" ); - let _ = tokio::fs::remove_dir_all(&staging_dir).await; + let _ = remove_bootstrap_staging(&staging_dir).await; return Err(Status::failed_precondition(err)); } @@ -5333,14 +5346,20 @@ impl VmDriver { error = %err, "vm driver: rootfs image build failed" ); - let _ = tokio::fs::remove_dir_all(&staging_dir).await; + let _ = remove_bootstrap_staging(&staging_dir).await; return Err(Status::failed_precondition(err)); } - self.publish_prepared_image(&prepared_image, &image_path) - .await?; - let _ = tokio::fs::remove_dir_all(&staging_dir).await; - Ok(()) + let published = async { + tokio::fs::create_dir_all(&cache_dir) + .await + .map_err(|err| Status::internal(format!("create image cache dir failed: {err}")))?; + self.publish_prepared_image(&prepared_image, &image_path) + .await + } + .await; + let _ = remove_bootstrap_staging(&staging_dir).await; + published } /// Watch the launcher child process and surface errors as driver @@ -6380,8 +6399,12 @@ impl VmDriver { .map_err(|err| Status::internal(format!("create layer staging dir failed: {err}")))?; let total_layers = manifest.layers.len(); - let total_bytes: i64 = manifest.layers.iter().map(|layer| layer.size.max(0)).sum(); - let mut layers = futures::stream::iter(manifest.layers.iter().cloned().enumerate()) + let total_bytes = manifest + .layers + .iter() + .map(|layer| layer.size.max(0)) + .fold(0, i64::saturating_add); + let mut layers = futures::stream::iter(manifest.layers.into_iter().enumerate()) .map(|(index, layer)| async move { self.publish_registry_layer_progress( sandbox_id, @@ -6406,9 +6429,35 @@ impl VmDriver { .await?; layers.sort_by_key(|layer| layer.index); - for layer in &layers { - apply_registry_layer_blob(image_ref, rootfs, layer).await?; - } + // The blobs are verified. One writer owns the budget and each staged + // tree stays immutable while its files are copied into the rootfs. + let limit = self.config.bootstrap_extraction_max_bytes.map_or( + DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES, + std::num::NonZeroU64::get, + ); + let layer_root = staging_dir.join("layers/root"); + let rootfs = rootfs.to_owned(); + tokio::task::spawn_blocking(move || { + let mut budget = BootstrapExtractionBudget::new(limit); + for layer in layers { + extract_layer_blob_to_dir( + &layer.blob_path, + &layer.media_type, + &layer_root, + &mut budget, + ) + .and_then(|()| budget.apply_layer(&layer_root, &rootfs)) + .map_err(|err| format!("layer '{}': {err}", layer.digest))?; + } + Ok::<(), String>(()) + }) + .await + .map_err(|err| Status::internal(format!("bootstrap layer extraction panicked: {err}")))? + .map_err(|err| { + Status::failed_precondition(format!( + "failed to extract vm bootstrap image '{image_ref}': {err}" + )) + })?; remove_registry_layer_staging(staging_dir).await?; @@ -6471,7 +6520,8 @@ impl VmDriver { struct DownloadedRegistryLayer { index: usize, digest: String, - layer_root: PathBuf, + blob_path: PathBuf, + media_type: String, } async fn download_registry_layer_blob( @@ -6486,9 +6536,6 @@ async fn download_registry_layer_blob( let blob_path = staging_dir .join("layers") .join(format!("{index:02}-{digest_component}.blob")); - let layer_root = staging_dir - .join("layers") - .join(format!("{index:02}-{digest_component}.root")); let mut file = pull_registry_blob_file( "download image layer", @@ -6525,51 +6572,17 @@ async fn download_registry_layer_blob( )) })?; - let blob_path_for_unpack = blob_path.clone(); - let layer_root_for_unpack = layer_root.clone(); - let media_type = layer.media_type.clone(); - tokio::task::spawn_blocking(move || { - extract_layer_blob_to_dir(&blob_path_for_unpack, &media_type, &layer_root_for_unpack) - }) - .await - .map_err(|err| Status::internal(format!("layer extraction panicked: {err}")))? - .map_err(|err| { - Status::failed_precondition(format!( - "failed to extract layer '{}' for vm sandbox image '{image_ref}': {err}", - layer.digest - )) - })?; - Ok(DownloadedRegistryLayer { index, digest: layer.digest, - layer_root, - }) -} - -async fn apply_registry_layer_blob( - image_ref: &str, - rootfs: &Path, - layer: &DownloadedRegistryLayer, -) -> Result<(), Status> { - let layer_root_for_unpack = layer.layer_root.clone(); - let rootfs_for_unpack = rootfs.to_path_buf(); - tokio::task::spawn_blocking(move || { - apply_layer_dir_to_rootfs(&layer_root_for_unpack, &rootfs_for_unpack) - }) - .await - .map_err(|err| Status::internal(format!("layer application panicked: {err}")))? - .map_err(|err| { - Status::failed_precondition(format!( - "failed to apply layer '{}' for vm sandbox image '{image_ref}': {err}", - layer.digest - )) + blob_path, + media_type: layer.media_type, }) } async fn remove_registry_layer_staging(staging_dir: &Path) -> Result<(), Status> { let layers_dir = staging_dir.join("layers"); - tokio::fs::remove_dir_all(&layers_dir).await.map_err(|err| { + remove_bootstrap_staging(&layers_dir).await.map_err(|err| { Status::internal(format!( "remove registry layer staging dir '{}' failed: {err}", layers_dir.display() @@ -6577,6 +6590,11 @@ async fn remove_registry_layer_staging(staging_dir: &Path) -> Result<(), Status> }) } +async fn remove_bootstrap_staging(dir: &Path) -> std::io::Result<()> { + let dir = dir.to_owned(); + tokio::task::spawn_blocking(move || preparation::remove_staging_tree(&dir)).await? +} + async fn download_registry_descriptor_blob_file( client: &OciClient, reference: &Reference, @@ -6777,30 +6795,24 @@ fn extract_layer_blob_to_dir( blob_path: &Path, media_type: &str, dest: &Path, + budget: &mut BootstrapExtractionBudget, ) -> Result<(), String> { if dest.exists() { - fs::remove_dir_all(dest).map_err(|err| format!("remove {}: {err}", dest.display()))?; + preparation::remove_staging_tree(dest) + .map_err(|err| format!("remove {}: {err}", dest.display()))?; } - fs::create_dir_all(dest).map_err(|err| format!("create {}: {err}", dest.display()))?; - let file = fs::File::open(blob_path).map_err(|err| format!("open {}: {err}", blob_path.display()))?; match layer_compression_from_media_type(media_type)? { - LayerCompression::None => extract_tar_reader_to_dir(file, dest), - LayerCompression::Gzip => extract_tar_reader_to_dir(GzDecoder::new(file), dest), + LayerCompression::None => budget.unpack_tar(file, dest), + LayerCompression::Gzip => budget.unpack_tar(MultiGzDecoder::new(file), dest), LayerCompression::Zstd => { let decoder = zstd::stream::read::Decoder::new(file) .map_err(|err| format!("decompress {}: {err}", blob_path.display()))?; - extract_tar_reader_to_dir(decoder, dest) + budget.unpack_tar(decoder, dest) } } -} - -fn extract_tar_reader_to_dir(reader: impl Read, dest: &Path) -> Result<(), String> { - let mut archive = tar::Archive::new(reader); - archive - .unpack(dest) - .map_err(|err| format!("extract layer into {}: {err}", dest.display())) + .map_err(|err| format!("extract layer into {}: {err}", dest.display())) } // `media_type` is an OCI media type string (e.g. `application/vnd.oci.image.layer.v1.tar+gzip`), @@ -12515,6 +12527,11 @@ mod tests { assert!(err.contains("unknown/unknown")); } + fn apply_layer_dir_to_rootfs(layer: &Path, rootfs: &Path) -> Result<(), String> { + BootstrapExtractionBudget::new(DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES) + .apply_layer(layer, rootfs) + } + #[test] fn apply_layer_dir_to_rootfs_honors_whiteouts() { let base = unique_temp_dir(); @@ -12724,10 +12741,14 @@ mod tests { let mut lower_tar = tar::Builder::new(Vec::new()); append_test_tar_symlink(&mut lower_tar, "escape", &outside); let lower_tar = lower_tar.into_inner().expect("finish lower tar"); - extract_tar_reader_to_dir(std::io::Cursor::new(lower_tar), &lower).unwrap(); + BootstrapExtractionBudget::new(DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES) + .unpack_tar(std::io::Cursor::new(lower_tar), &lower) + .unwrap(); let upper_tar = tar_bytes_with_file("escape/payload", b"escaped"); - extract_tar_reader_to_dir(std::io::Cursor::new(upper_tar), &upper).unwrap(); + BootstrapExtractionBudget::new(DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES) + .unpack_tar(std::io::Cursor::new(upper_tar), &upper) + .unwrap(); apply_layer_dir_to_rootfs(&lower, &rootfs).unwrap(); let error = apply_layer_dir_to_rootfs(&upper, &rootfs) @@ -12759,12 +12780,16 @@ mod tests { append_test_tar_file(&mut lower_tar, "usr/bin/bash", b"bash"); append_test_tar_symlink(&mut lower_tar, "bin", Path::new("usr/bin")); let lower_tar = lower_tar.into_inner().expect("finish lower tar"); - extract_tar_reader_to_dir(std::io::Cursor::new(lower_tar), &lower).unwrap(); + BootstrapExtractionBudget::new(DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES) + .unpack_tar(std::io::Cursor::new(lower_tar), &lower) + .unwrap(); // The tar contains no explicit `bin/` entry. Extraction necessarily // materializes it as an implicit parent for `bin/tool`. let upper_tar = tar_bytes_with_file("bin/tool", b"tool"); - extract_tar_reader_to_dir(std::io::Cursor::new(upper_tar), &upper).unwrap(); + BootstrapExtractionBudget::new(DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES) + .unpack_tar(std::io::Cursor::new(upper_tar), &upper) + .unwrap(); apply_layer_dir_to_rootfs(&lower, &rootfs).unwrap(); apply_layer_dir_to_rootfs(&upper, &rootfs).unwrap(); @@ -12784,6 +12809,183 @@ mod tests { let _ = fs::remove_dir_all(base); } + #[test] + fn bootstrap_extraction_bounds_decoded_tar_through_eof_for_each_compression() { + let mut tar = tar_bytes_with_file("tool", b"contents"); + tar.resize(8192, 0); + let tail = b"after the tar end marker"; + let decoded_bytes = (tar.len() + tail.len()) as u64; + let gzip = [gzip_bytes(&tar), gzip_bytes(tail)].concat(); + let zstd = [ + zstd::encode_all(&tar[..], 0).unwrap(), + zstd::encode_all(&tail[..], 0).unwrap(), + ] + .concat(); + for (media, bytes) in [ + ( + "application/vnd.oci.image.layer.v1.tar", + [&tar[..], tail].concat(), + ), + ("application/vnd.oci.image.layer.v1.tar+gzip", gzip), + ("application/vnd.oci.image.layer.v1.tar+zstd", zstd), + ] { + let temp = tempfile::tempdir().unwrap(); + let blob = temp.path().join("blob"); + fs::write(&blob, bytes).unwrap(); + for limit in [decoded_bytes + 1, decoded_bytes, decoded_bytes - 1] { + let dest = temp.path().join(limit.to_string()); + let result = extract_layer_blob_to_dir( + &blob, + media, + &dest, + &mut BootstrapExtractionBudget::new(limit), + ); + if limit < decoded_bytes { + assert!(result.unwrap_err().contains("decoded layer tars")); + } else { + result.unwrap(); + assert_eq!(fs::read(dest.join("tool")).unwrap(), b"contents"); + } + } + } + } + + #[test] + fn bootstrap_extraction_counts_decoded_tar_across_layers() { + let mut tar = tar_bytes_with_file("tool", b"small"); + tar.resize(8192, 0); + let temp = tempfile::tempdir().unwrap(); + let mut budget = BootstrapExtractionBudget::new(2 * tar.len() as u64 - 1); + budget + .unpack_tar(tar.as_slice(), &temp.path().join("lower")) + .unwrap(); + let error = budget + .unpack_tar(tar.as_slice(), &temp.path().join("upper")) + .unwrap_err(); + assert!(error.to_string().contains("decoded layer tars"), "{error}"); + } + + #[test] + fn bootstrap_extraction_global_pax_header_only_spends_decoded_bytes() { + let mut builder = tar::Builder::new(Vec::new()); + let mut header = tar::Header::new_ustar(); + let comment = b"13 comment=x\n"; + header.set_entry_type(tar::EntryType::XGlobalHeader); + header.set_mode(0o644); + header.set_size(comment.len() as u64); + builder + .append_data(&mut header, "pax", &comment[..]) + .unwrap(); + append_test_tar_file(&mut builder, "payload", &[1; 8192]); + let tar = builder.into_inner().unwrap(); + let temp = tempfile::tempdir().unwrap(); + let stage = temp.path().join("layer"); + let root = temp.path().join("root"); + let mut budget = BootstrapExtractionBudget::new(2 * 8192); + budget.unpack_tar(&tar[..], &stage).unwrap(); + budget.apply_layer(&stage, &root).unwrap(); + assert_eq!(fs::read(root.join("payload")).unwrap(), [1; 8192]); + assert!(!root.join("pax").exists()); + } + + #[test] + fn bootstrap_extraction_bounds_path_entries_before_creating_parents() { + let tar = tar_bytes_with_file("a/b/c/empty", b""); + let temp = tempfile::tempdir().unwrap(); + let stage = temp.path().join("layer"); + let root = temp.path().join("root"); + let mut too_small = BootstrapExtractionBudget::new(4 * 4096 - 1); + let err = too_small.unpack_tar(&tar[..], &stage).unwrap_err(); + assert!(err.to_string().contains("filesystem output"), "{err}"); + assert!(!stage.join("a").exists()); + + let mut budget = BootstrapExtractionBudget::new(8 * 4096); + budget.unpack_tar(&tar[..], &stage).unwrap(); + budget.apply_layer(&stage, &root).unwrap(); + assert!(root.join("a/b/c/empty").is_file()); + } + + #[test] + fn bootstrap_extraction_checks_sparse_logical_size_before_creating_file() { + for logical_size in [1024 * 1024, u64::MAX] { + let mut builder = tar::Builder::new(Vec::new()); + let mut header = tar::Header::new_gnu(); + header.set_entry_type(tar::EntryType::GNUSparse); + header.set_size(1); + header.set_mode(0o644); + let gnu = header.as_gnu_mut().unwrap(); + gnu.set_real_size(logical_size); + gnu.sparse[0].set_offset(logical_size - 1); + gnu.sparse[0].set_length(1); + builder + .append_data(&mut header, "sparse", &b"x"[..]) + .unwrap(); + let tar = builder.into_inner().unwrap(); + let temp = tempfile::tempdir().unwrap(); + let dest = temp.path(); + let error = BootstrapExtractionBudget::new(1024 * 1024 - 1) + .unpack_tar(&tar[..], dest) + .unwrap_err(); + assert!(error.to_string().contains("filesystem output"), "{error}"); + assert!(!dest.join("sparse").exists()); + if logical_size == 1024 * 1024 { + BootstrapExtractionBudget::new(logical_size) + .unpack_tar(&tar[..], dest) + .unwrap(); + assert_eq!( + fs::metadata(dest.join("sparse")).unwrap().len(), + logical_size + ); + } + } + } + + #[test] + fn bootstrap_extraction_checks_pax_size_before_creating_file() { + let mut builder = tar::Builder::new(Vec::new()); + builder + .append_pax_extensions([("size", &b"8192"[..])]) + .unwrap(); + let mut header = tar::Header::new_gnu(); + header.set_size(1); + header.set_mode(0o644); + builder + .append_data(&mut header, "file", &[7; 8192][..]) + .unwrap(); + let tar = builder.into_inner().unwrap(); + let temp = tempfile::tempdir().unwrap(); + let error = BootstrapExtractionBudget::new(8191) + .unpack_tar(tar.as_slice(), temp.path()) + .unwrap_err(); + assert!(error.to_string().contains("filesystem output"), "{error}"); + assert!(!temp.path().join("file").exists()); + } + + #[test] + fn bootstrap_extraction_reserves_each_hard_link_copy_before_replacement() { + let mut builder = tar::Builder::new(Vec::new()); + append_test_tar_file(&mut builder, "a", &[3; 4096]); + for name in ["b", "c"] { + let mut header = tar::Header::new_gnu(); + header.set_entry_type(tar::EntryType::Link); + header.set_size(0); + builder.append_link(&mut header, name, "a").unwrap(); + } + let tar = builder.into_inner().unwrap(); + let temp = tempfile::tempdir().unwrap(); + let staged = temp.path().join("layer"); + let root = temp.path().join("root"); + fs::create_dir(&root).unwrap(); + fs::write(root.join("c"), b"old").unwrap(); + // Three staged entries and three merged copies each consume one block. + let mut budget = BootstrapExtractionBudget::new(6 * 4096 - 1); + budget.unpack_tar(&tar[..], &staged).unwrap(); + let error = budget.apply_layer(&staged, &root).unwrap_err(); + assert!(error.contains("filesystem output"), "{error}"); + assert_eq!(fs::read(root.join("b")).unwrap(), [3; 4096]); + assert_eq!(fs::read(root.join("c")).unwrap(), b"old"); + } + #[test] fn extracts_zstd_compressed_oci_layer() { let temp = tempfile::tempdir().unwrap(); @@ -12797,6 +12999,7 @@ mod tests { &blob, "application/vnd.oci.image.layer.v1.tar+zstd", &extracted, + &mut BootstrapExtractionBudget::new(DEFAULT_BOOTSTRAP_EXTRACTION_MAX_BYTES), ) .unwrap(); @@ -14105,13 +14308,17 @@ while :; do sleep 0.05; done"#, const TEST_STAGING_LIMIT: u64 = 10 * 1024 * 1024; /// Build an uncompressed tar holding a single file. - fn tar_bytes_with_file(name: &str, contents: &[u8]) -> Vec { + pub(super) fn tar_bytes_with_file(name: &str, contents: &[u8]) -> Vec { let mut builder = tar::Builder::new(Vec::new()); append_test_tar_file(&mut builder, name, contents); builder.into_inner().expect("finish tar") } - fn append_test_tar_file(builder: &mut tar::Builder>, name: &str, contents: &[u8]) { + pub(super) fn append_test_tar_file( + builder: &mut tar::Builder>, + name: &str, + contents: &[u8], + ) { let mut header = tar::Header::new_gnu(); header.set_size(u64::try_from(contents.len()).expect("tar entry size fits u64")); header.set_mode(0o644); @@ -14133,7 +14340,7 @@ while :; do sleep 0.05; done"#, .expect("append symlink entry"); } - fn gzip_bytes(bytes: &[u8]) -> Vec { + pub(super) fn gzip_bytes(bytes: &[u8]) -> Vec { let mut encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::default()); encoder.write_all(bytes).expect("gzip payload"); encoder.finish().expect("finish gzip") @@ -14387,6 +14594,33 @@ while :; do sleep 0.05; done"#, ); } + #[test] + fn ipv6_egress_settings_parse_validate_and_render_supervisor_args() { + let mut value = serde_json::to_value(proxy_config(None, None, None)).unwrap(); + value["policy_dns_ipv6_egress"] = "enabled".into(); + value["nat64_prefixes"] = serde_json::json!(["2001:db8:64::/96"]); + let config: VmDriverConfig = + serde_json::from_value(value).expect("VM driver config parses flattened keys"); + config.validate_runtime_security_config().unwrap(); + assert_eq!( + config.ipv6_egress.supervisor_args(), + [ + "--policy-dns-ipv6-egress", + "enabled", + "--nat64-prefix", + "2001:db8:64::/96" + ] + ); + let invalid = VmDriverConfig { + ipv6_egress: openshell_core::SupervisorIpv6EgressConfig { + nat64_prefixes: vec!["2001:db8::/33".to_string()], + ..Default::default() + }, + ..proxy_config(None, None, None) + }; + assert!(invalid.validate_runtime_security_config().is_err()); + } + #[test] fn upstream_proxy_args_are_empty_without_a_configured_proxy() { assert!( diff --git a/vendor/openshell/crates/openshell-driver-vm/src/layer_applier.rs b/vendor/openshell/crates/openshell-driver-vm/src/layer_applier.rs index 2742c78..42c21af 100644 --- a/vendor/openshell/crates/openshell-driver-vm/src/layer_applier.rs +++ b/vendor/openshell/crates/openshell-driver-vm/src/layer_applier.rs @@ -6,15 +6,120 @@ use std::collections::VecDeque; use std::ffi::OsString; use std::fs; -use std::io::Write as _; +use std::io::{self, Read, Write as _}; #[cfg(unix)] use std::os::unix::ffi::OsStrExt as _; #[cfg(unix)] use std::os::unix::fs::PermissionsExt; use std::path::{Component, Path, PathBuf}; -pub fn apply_layer_dir_to_rootfs(layer_root: &Path, rootfs: &Path) -> Result<(), String> { - LayerApplier::new(rootfs)?.apply(layer_root) +const MIN_ENTRY_BYTES: u64 = 4096; + +/// Both limits span every layer of one bootstrap build. Tar headers and padding +/// consume decoded bytes. Sparse holes and copies of hard links consume output +/// bytes even when there is little or no corresponding data in the tar. +pub struct BootstrapExtractionBudget { + limit: u64, + decoded_left: u64, + output_left: u64, +} + +impl BootstrapExtractionBudget { + pub fn new(limit: u64) -> Self { + Self { + limit, + decoded_left: limit, + output_left: limit, + } + } + + fn exceeded(&self, kind: &str) -> io::Error { + io::Error::other(format!( + "bootstrap extraction limit of {} bytes exceeded for {kind}", + self.limit + )) + } + + fn reserve_entry(&mut self, bytes: u64) -> io::Result<()> { + self.output_left = self + .output_left + .checked_sub(bytes.max(MIN_ENTRY_BYTES)) + .ok_or_else(|| self.exceeded("filesystem output"))?; + Ok(()) + } + + pub fn unpack_tar(&mut self, reader: impl Read, dest: &Path) -> io::Result<()> { + fs::create_dir_all(dest)?; + let dest = dest.canonicalize()?; + let mut input = reader.take(self.decoded_left); + let unpack = self.unpack_entries(&mut tar::Archive::new(&mut input), &dest); + if unpack.is_ok() { + // The tar parser stops at the first end marker. Account for padding, + // trailing data and concatenated compression frames through EOF. + io::copy(&mut input, &mut io::sink())?; + } + self.decoded_left = input.limit(); + if self.decoded_left == 0 && input.into_inner().read(&mut [0])? != 0 { + return Err(self.exceeded("decoded layer tars")); + } + unpack + } + + fn unpack_entries( + &mut self, + archive: &mut tar::Archive, + dest: &Path, + ) -> io::Result<()> { + // Match Archive::unpack: validate each path with unpack_in and apply + // directory modes after descendants, deepest first. + let mut directories = Vec::new(); + for entry in archive.entries()? { + let mut entry = entry?; + let kind = entry.header().entry_type(); + if kind.is_pax_global_extensions() + || kind.is_pax_local_extensions() + || kind.is_gnu_longname() + || kind.is_gnu_longlink() + { + continue; + } + // unpack_in can create every parent of a member, even if the tar + // has no entries for those directories. Reserve before it writes. + for _ in entry + .path()? + .components() + .filter(|c| matches!(c, Component::Normal(_))) + .skip(1) + { + self.reserve_entry(0)?; + } + let bytes = if kind.is_symlink() { + entry + .link_name_bytes() + .map_or(0, |target| target.len() as u64) + } else if kind.is_dir() { + 0 + } else { + // tar resolves PAX size overrides and GNU sparse extents here. + entry.size() + }; + self.reserve_entry(bytes)?; + if kind.is_dir() { + directories.push(entry); + } else { + entry.unpack_in(dest)?; + } + } + directories.sort_by(|a, b| b.path_bytes().cmp(&a.path_bytes())); + for mut directory in directories { + directory.unpack_in(dest)?; + } + Ok(()) + } + + pub fn apply_layer(&mut self, layer_root: &Path, rootfs: &Path) -> Result<(), String> { + LayerApplier::new(rootfs)?.apply(layer_root, self) + } } /// Owns all filesystem mutations performed while merging an extracted OCI @@ -91,23 +196,32 @@ impl LayerApplier { }) } - fn apply(&self, layer_root: &Path) -> Result<(), String> { + fn apply( + &self, + layer_root: &Path, + budget: &mut BootstrapExtractionBudget, + ) -> Result<(), String> { #[cfg(unix)] { let root = ResolvedDirectory { fd: self.open_root_dir()?, components: Vec::new(), }; - self.merge_directory(layer_root, &root) + self.merge_directory(layer_root, &root, budget) } #[cfg(not(unix))] { - self.merge_directory(layer_root, &self.rootfs) + self.merge_directory(layer_root, &self.rootfs, budget) } } #[cfg(not(unix))] - fn merge_directory(&self, source_dir: &Path, target_dir: &Path) -> Result<(), String> { + fn merge_directory( + &self, + source_dir: &Path, + target_dir: &Path, + budget: &mut BootstrapExtractionBudget, + ) -> Result<(), String> { fs::create_dir_all(target_dir) .map_err(|err| format!("create {}: {err}", target_dir.display()))?; @@ -140,6 +254,12 @@ impl LayerApplier { let metadata = fs::symlink_metadata(&source_path) .map_err(|err| format!("stat {}: {err}", source_path.display()))?; let file_type = metadata.file_type(); + let bytes = if file_type.is_dir() { + 0 + } else { + metadata.len() + }; + budget.reserve_entry(bytes).map_err(|err| err.to_string())?; if file_type.is_dir() { let plan = self.plan_directory_merge(&dest_path)?; @@ -148,7 +268,7 @@ impl LayerApplier { } fs::create_dir_all(plan.path()) .map_err(|err| format!("create {}: {err}", plan.path().display()))?; - self.merge_directory(&source_path, plan.path())?; + self.merge_directory(&source_path, plan.path(), budget)?; if plan.applies_directory_metadata() { fs::set_permissions(plan.path(), metadata.permissions()) .map_err(|err| format!("chmod {}: {err}", plan.path().display()))?; @@ -186,6 +306,7 @@ impl LayerApplier { &self, source_dir: &Path, target_dir: &ResolvedDirectory, + budget: &mut BootstrapExtractionBudget, ) -> Result<(), String> { let mut entries = fs::read_dir(source_dir) .map_err(|err| format!("read {}: {err}", source_dir.display()))? @@ -215,6 +336,12 @@ impl LayerApplier { let metadata = fs::symlink_metadata(&source_path) .map_err(|err| format!("stat {}: {err}", source_path.display()))?; let file_type = metadata.file_type(); + let bytes = if file_type.is_dir() { + 0 + } else { + metadata.len() + }; + budget.reserve_entry(bytes).map_err(|err| err.to_string())?; if file_type.is_dir() { let plan = self.plan_directory_merge(target_dir, &file_name)?; @@ -231,7 +358,7 @@ impl LayerApplier { self.create_child_directory(target_dir, &file_name)? } }; - self.merge_directory(&source_path, &child)?; + self.merge_directory(&source_path, &child, budget)?; if apply_metadata { rustix::fs::fchmod(&child.fd, Self::mode_from_metadata(&metadata)).map_err( |err| format!("chmod {}: {err}", self.directory_path(&child).display()), @@ -441,7 +568,7 @@ impl LayerApplier { ) .map_err(|err| format!("create {}: {err}", path.display()))?; let mut destination = fs::File::from(fd); - std::io::copy(&mut source, &mut destination).map_err(|err| { + io::copy(&mut source, &mut destination).map_err(|err| { format!( "copy {} to {}: {err}", source_path.display(), @@ -764,7 +891,13 @@ mod tests { fs::rename(rootfs.join("pivot"), rootfs.join("detached")).unwrap(); std::os::unix::fs::symlink(&outside, rootfs.join("pivot")).unwrap(); - applier.merge_directory(&upper, &opened).unwrap(); + applier + .merge_directory( + &upper, + &opened, + &mut super::BootstrapExtractionBudget::new(4096), + ) + .unwrap(); assert_eq!( fs::read_to_string(outside.join("victim")).unwrap(), diff --git a/vendor/openshell/crates/openshell-driver-vm/src/main.rs b/vendor/openshell/crates/openshell-driver-vm/src/main.rs index c2a8602..d1a273f 100644 --- a/vendor/openshell/crates/openshell-driver-vm/src/main.rs +++ b/vendor/openshell/crates/openshell-driver-vm/src/main.rs @@ -78,6 +78,9 @@ struct Args { #[arg(long, env = "OPENSHELL_VM_BOOTSTRAP_IMAGE", default_value = "")] bootstrap_image: String, + #[arg(long, env = "OPENSHELL_VM_BOOTSTRAP_EXTRACTION_MAX_BYTES")] + bootstrap_extraction_max_bytes: Option, + #[arg( long, env = "OPENSHELL_VM_DRIVER_STATE_DIR", @@ -143,6 +146,19 @@ struct Args { #[arg(long, env = "OPENSHELL_VM_UPSTREAM_PROXY_CA_BUNDLE")] upstream_proxy_ca_bundle: Option, + /// AAAA handling for the host supervisors' mediated policy DNS: `auto`, + /// `enabled` or `disabled`. + #[arg(long, env = "OPENSHELL_VM_POLICY_DNS_IPV6_EGRESS")] + policy_dns_ipv6_egress: Option, + + /// NAT64 prefix (RFC 6052 CIDR) of the host network. Repeatable. + #[arg( + long = "nat64-prefix", + env = "OPENSHELL_VM_NAT64_PREFIXES", + value_delimiter = ',' + )] + nat64_prefixes: Vec, + /// Guest-reachable SPIFFE Workload API endpoint (`tcp:IP:port`). #[arg( long = "provider-spiffe-workload-api-tcp-endpoint", @@ -353,6 +369,7 @@ async fn main() -> Result<()> { launcher_bin: args.launcher_bin.clone(), default_image: args.default_image.clone(), bootstrap_image: args.bootstrap_image.clone(), + bootstrap_extraction_max_bytes: args.bootstrap_extraction_max_bytes, log_level: args.log_level.clone(), vcpus: args.vcpus, max_vcpus: args.max_vcpus, @@ -374,6 +391,10 @@ async fn main() -> Result<()> { proxy_connect_by_hostname: args.upstream_proxy_connect_by_hostname.then_some(true), }, proxy_ca_bundle: args.upstream_proxy_ca_bundle.clone(), + ipv6_egress: openshell_core::SupervisorIpv6EgressConfig { + policy_dns_ipv6_egress: args.policy_dns_ipv6_egress, + nat64_prefixes: args.nat64_prefixes.clone(), + }, provider_spiffe_workload_api_tcp_endpoint: args .provider_spiffe_workload_api_tcp_endpoint .clone(), @@ -737,6 +758,29 @@ mod tests { ); } + #[test] + fn ipv6_egress_flags_parse_with_supervisor_names() { + let args = Args::parse_from([ + "openshell-driver-vm", + "--policy-dns-ipv6-egress", + "enabled", + "--nat64-prefix", + "64:ff9b:1::/96", + "--nat64-prefix", + "2001:db8:64::/96", + ]); + assert_eq!( + args.policy_dns_ipv6_egress, + Some(openshell_core::PolicyDnsIpv6Egress::Enabled) + ); + assert_eq!(args.nat64_prefixes, ["64:ff9b:1::/96", "2001:db8:64::/96"]); + assert!( + Args::parse_from(["openshell-driver-vm"]) + .nat64_prefixes + .is_empty() + ); + } + #[test] fn corporate_proxy_settings_default_to_unset() { let args = Args::parse_from(["openshell-driver-vm"]); diff --git a/vendor/openshell/crates/openshell-driver-vm/src/preparation.rs b/vendor/openshell/crates/openshell-driver-vm/src/preparation.rs index f7007ce..c39ec6c 100644 --- a/vendor/openshell/crates/openshell-driver-vm/src/preparation.rs +++ b/vendor/openshell/crates/openshell-driver-vm/src/preparation.rs @@ -12,7 +12,7 @@ use std::fs::{self, File, OpenOptions}; use std::io::{self, Read, Write}; use std::os::fd::AsRawFd; -use std::os::unix::fs::OpenOptionsExt; +use std::os::unix::fs::{OpenOptionsExt, PermissionsExt as _}; use std::path::{Path, PathBuf}; use std::process::{ExitStatus, Stdio}; use std::sync::Arc; @@ -409,7 +409,7 @@ fn reclaim(directory: &Path, lease_path: &Path) -> io::Result { if marker != LEASE_MARKER { return Ok(false); } - match fs::remove_dir_all(directory) { + match remove_staging_tree(directory) { Ok(()) => {} Err(error) if error.kind() == io::ErrorKind::NotFound => {} Err(error) => return Err(error), @@ -422,6 +422,29 @@ fn reclaim(directory: &Path, lease_path: &Path) -> io::Result { Ok(true) } +/// Remove a private staging tree after its writers have stopped. Image +/// directory modes may deny the driver permission to unlink their children. +pub(super) fn remove_staging_tree(path: &Path) -> io::Result<()> { + match fs::remove_dir_all(path) { + Err(err) if err.kind() == io::ErrorKind::PermissionDenied => {} + result => return result, + } + + let mut pending = vec![path.to_owned()]; + while let Some(dir) = pending.pop() { + if dir.symlink_metadata()?.is_dir() { + fs::set_permissions(&dir, fs::Permissions::from_mode(0o700))?; + for child in dir.read_dir()? { + let child = child?; + if child.file_type()?.is_dir() { + pending.push(child.path()); + } + } + } + } + fs::remove_dir_all(path) +} + fn lock(file: &File, nonblocking: bool) -> io::Result { let operation = libc::LOCK_EX | if nonblocking { libc::LOCK_NB } else { 0 }; // SAFETY: flock receives a valid borrowed file descriptor and no pointers. @@ -569,6 +592,26 @@ mod tests { use super::*; use std::os::unix::fs::{PermissionsExt, symlink}; + #[test] + fn removes_inaccessible_staging_directories_without_following_links() { + let temp = tempfile::tempdir().unwrap(); + let dir = temp.path().join("staged"); + let outside = temp.path().join("outside"); + fs::create_dir(&dir).unwrap(); + fs::create_dir(&outside).unwrap(); + fs::write(outside.join("keep"), b"outside").unwrap(); + fs::set_permissions(&outside, fs::Permissions::from_mode(0o750)).unwrap(); + symlink(&outside, dir.join("link")).unwrap(); + fs::set_permissions(&dir, fs::Permissions::from_mode(0o000)).unwrap(); + remove_staging_tree(&dir).unwrap(); + assert!(!dir.exists()); + assert_eq!(fs::read(outside.join("keep")).unwrap(), b"outside"); + assert_eq!( + fs::metadata(outside).unwrap().permissions().mode() & 0o777, + 0o750 + ); + } + fn request(root: &Path) -> Request { Request { config: VmDriverConfig { diff --git a/vendor/openshell/crates/openshell-driver-vm/src/registry_cache_tests.rs b/vendor/openshell/crates/openshell-driver-vm/src/registry_cache_tests.rs index 3c9bd45..1c90c15 100644 --- a/vendor/openshell/crates/openshell-driver-vm/src/registry_cache_tests.rs +++ b/vendor/openshell/crates/openshell-driver-vm/src/registry_cache_tests.rs @@ -7,7 +7,7 @@ use oci_client::manifest::OCI_IMAGE_INDEX_MEDIA_TYPE; use tokio::io::AsyncReadExt as _; /// A loopback registry with independent HEAD identity and GET contents. Blob -/// requests deliberately fail, so a rejected manifest needs no VM or formatter. +/// requests without fixture contents fail before reaching a VM or formatter. struct Registry { address: String, requests: Arc>>, @@ -17,7 +17,7 @@ struct Registry { impl Registry { async fn start( head_digest: String, - manifests: HashMap>, + objects: HashMap>, get_digest: Option, mut retry_once: bool, ) -> Self { @@ -46,7 +46,7 @@ impl Registry { } else if manifest.is_some() && method == "HEAD" { digest = Some(head_digest.clone()); ("200 OK", b"".as_slice()) - } else if let Some(body) = manifest.and_then(|key| manifests.get(key)) { + } else if let Some(body) = manifest.and_then(|key| objects.get(key)) { if retry_once { retry_once = false; ("503 Service Unavailable", b"retry".as_slice()) @@ -54,6 +54,11 @@ impl Registry { digest = Some(get_digest.clone().unwrap_or_else(|| sha256(body))); ("200 OK", body.as_slice()) } + } else if let Some(body) = path + .strip_prefix("/v2/test/image/blobs/") + .and_then(|key| objects.get(key)) + { + ("200 OK", body.as_slice()) } else { ("404 Not Found", b"fixture has no blob".as_slice()) }; @@ -76,6 +81,27 @@ impl Registry { } } + async fn with_layers(layers: Vec<(&str, Vec)>) -> Self { + let mut manifest: serde_json::Value = serde_json::from_slice(&manifest("config")).unwrap(); + let mut objects = HashMap::new(); + manifest["layers"] = layers + .into_iter() + .map(|(media_type, bytes)| { + let digest = sha256(&bytes); + let descriptor = serde_json::json!({ + "mediaType": media_type, "digest": digest, "size": bytes.len() + }); + objects.insert(digest, bytes); + descriptor + }) + .collect(); + let body = serde_json::to_vec(&manifest).unwrap(); + let digest = sha256(&body); + objects.insert(digest.clone(), body.clone()); + objects.insert("latest".into(), body); + Self::start(digest, objects, None, false).await + } + fn reference(&self, digest: Option<&str>) -> String { let suffix = digest.map_or_else(|| ":latest".to_string(), |value| format!("@{value}")); format!("{}/test/image{suffix}", self.address) @@ -734,3 +760,117 @@ async fn driver_refuses_a_socket_with_local_images_off() { }; assert!(err.contains("unset one of them"), "{err}"); } + +#[tokio::test] +async fn empty_bootstrap_layers_reuse_one_staging_directory() { + let empty = tests::gzip_bytes(&[]); + let mut layers = vec![("application/vnd.oci.image.layer.v1.tar+gzip", empty); 3]; + layers.push(( + "application/vnd.oci.image.layer.v1.tar", + tests::tar_bytes_with_file("over-limit", b"x"), + )); + let registry = Registry::with_layers(layers).await; + let image = registry.reference(None); + let state = tempfile::tempdir().unwrap(); + let mut driver = driver(state.path()); + driver.config.bootstrap_extraction_max_bytes = std::num::NonZeroU64::new(1); + let scratch = state.path().join("stage"); + let error = driver + .pull_registry_image_rootfs( + "test", + &client(), + &parse_registry_reference(&image).unwrap(), + &RegistryAuth::Anonymous, + &image, + &scratch, + &scratch.join("rootfs"), + ) + .await + .unwrap_err(); + assert!(error.message().contains("decoded layer tars"), "{error}"); + let staging_dirs = fs::read_dir(scratch.join("layers")) + .unwrap() + .map(Result::unwrap) + .filter(|entry| entry.file_type().unwrap().is_dir()) + .count(); + assert_eq!(staging_dirs, 1); +} + +#[tokio::test] +async fn bootstrap_extraction_limit_spans_layers_and_cleans_failed_build() { + let mut lower = tar::Builder::new(Vec::new()); + let mut dir = tar::Header::new_gnu(); + dir.set_entry_type(tar::EntryType::Directory); + dir.set_mode(0o555); + dir.set_size(0); + lower + .append_data(&mut dir, "readonly", std::io::empty()) + .unwrap(); + tests::append_test_tar_file(&mut lower, "readonly/empty", b""); + tests::append_test_tar_file(&mut lower, "shared", &[1; 4096]); + let lower = lower.into_inner().unwrap(); + let upper = tests::tar_bytes_with_file("shared", &[2; 4096]); + let registry = Registry::with_layers(vec![ + ( + "application/vnd.oci.image.layer.v1.tar+gzip", + tests::gzip_bytes(&lower), + ), + ( + "application/vnd.oci.image.layer.v1.tar+zstd", + zstd::encode_all(&upper[..], 0).unwrap(), + ), + ]) + .await; + let image = registry.reference(None); + let client = client(); + let state = tempfile::tempdir().unwrap(); + let mut driver = driver(state.path()); + let attempt = state.path().join("attempt"); + fs::create_dir(&attempt).unwrap(); + driver.preparation_root = Some(attempt.clone()); + // Four path components staged and three entries merged in the lower layer. + // The upper file is charged again when staged and when merged. + driver.config.bootstrap_extraction_max_bytes = std::num::NonZeroU64::new(9 * 4096 - 1); + let error = ensure_image(&driver, &image, &client, true) + .await + .unwrap_err(); + assert!( + error.message().contains("bootstrap extraction limit"), + "{error}" + ); + assert!(attempt.read_dir().unwrap().next().is_none()); + assert!( + fs::read_dir(image_cache_root_dir(state.path())) + .unwrap() + .next() + .is_none(), + "a rejected image must not leave a cache entry" + ); + + driver.config.bootstrap_extraction_max_bytes = std::num::NonZeroU64::new(9 * 4096); + let staging = state.path().join("retry"); + let rootfs = staging.join("rootfs"); + driver + .pull_registry_image_rootfs( + "test", + &client, + &parse_registry_reference(&image).unwrap(), + &RegistryAuth::Anonymous, + &image, + &staging, + &rootfs, + ) + .await + .unwrap(); + assert_eq!(fs::read(rootfs.join("shared")).unwrap(), [2; 4096]); + assert!(!staging.join("layers").exists()); + assert_eq!( + fs::metadata(rootfs.join("readonly")) + .unwrap() + .permissions() + .mode() + & 0o777, + 0o555 + ); + fs::set_permissions(rootfs.join("readonly"), fs::Permissions::from_mode(0o755)).unwrap(); +} diff --git a/vendor/openshell/crates/openshell-driver-vm/src/supervisor_identity/tests.rs b/vendor/openshell/crates/openshell-driver-vm/src/supervisor_identity/tests.rs index 53859da..40a2aa6 100644 --- a/vendor/openshell/crates/openshell-driver-vm/src/supervisor_identity/tests.rs +++ b/vendor/openshell/crates/openshell-driver-vm/src/supervisor_identity/tests.rs @@ -216,7 +216,7 @@ async fn workload_api_child() { let Some(socket) = std::env::var_os(CHILD_SOCKET_ENV) else { return; }; - let endpoint = openshell_core::spiffe::workload_api_endpoint(Path::new(&socket)); + let endpoint = openshell_spiffe::workload_api_endpoint(Path::new(&socket)); let client = spiffe::WorkloadApiClient::connect_to(&endpoint) .await .expect("connect"); @@ -305,11 +305,10 @@ async fn other_processes_are_refused() { .unwrap(); // This test process is not it. - let client = spiffe::WorkloadApiClient::connect_to( - openshell_core::spiffe::workload_api_endpoint(&socket), - ) - .await - .unwrap(); + let client = + spiffe::WorkloadApiClient::connect_to(openshell_spiffe::workload_api_endpoint(&socket)) + .await + .unwrap(); let error = client.fetch_jwt_token([AUDIENCE], None).await.unwrap_err(); assert!( matches!(error, spiffe::WorkloadApiError::PermissionDenied(_))