From 8d68260525685ab59f9756e31633a28a2dae227b Mon Sep 17 00:00:00 2001 From: Dominik Spitzli Date: Thu, 12 Nov 2026 13:07:12 +0100 Subject: [PATCH] chore: use canonical Spitzli plugin SDK and binaries --- Cargo.lock | 174 +++++++++++++-------------- Cargo.toml | 20 +-- Dockerfile | 8 +- NAMESPACE-MIGRATION.json | 57 +++++++++ NOTICE | 4 +- README.md | 4 +- scripts/plugin-release/release.mjs | 2 +- src/dedicated.rs | 4 +- src/lib.rs | 6 +- src/main.rs | 32 ++--- src/store.rs | 8 +- standalone.json | 14 +-- tests/lifecycle.rs | 20 +-- tests/storage_retention.rs | 12 +- tests/storage_transport.rs | 2 +- tools/manifest-validator/Cargo.lock | 52 ++++---- tools/manifest-validator/Cargo.toml | 8 +- tools/manifest-validator/src/main.rs | 2 +- ui/index.tsx | 2 +- 19 files changed, 244 insertions(+), 187 deletions(-) create mode 100644 NAMESPACE-MIGRATION.json diff --git a/Cargo.lock b/Cargo.lock index cfa4aef..cd2adce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1987,6 +1987,93 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "spitzli-plugin-kit" +version = "0.1.0" +source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8019f3df67dba3fed3083f22635e4725028c1b5e#8019f3df67dba3fed3083f22635e4725028c1b5e" +dependencies = [ + "aes-gcm", + "getrandom 0.2.17", + "hex", + "rustix", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "spitzli-plugin-protocol", + "spitzli-plugin-runtime", + "tokio", + "tokio-postgres", + "tokio-postgres-rustls", + "tonic", + "url", + "uuid", +] + +[[package]] +name = "spitzli-plugin-protocol" +version = "0.1.0" +source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8019f3df67dba3fed3083f22635e4725028c1b5e#8019f3df67dba3fed3083f22635e4725028c1b5e" +dependencies = [ + "base64", + "chrono", + "ed25519-dalek", + "jsonschema", + "node-semver", + "regex", + "serde", + "serde_json", + "sha2 0.10.9", + "url", + "uuid", +] + +[[package]] +name = "spitzli-plugin-runtime" +version = "0.1.0" +source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8019f3df67dba3fed3083f22635e4725028c1b5e#8019f3df67dba3fed3083f22635e4725028c1b5e" +dependencies = [ + "ed25519-dalek", + "hex", + "hyper-util", + "prost", + "rustix", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "sha2 0.10.9", + "spitzli-plugin-protocol", + "tokio", + "tokio-rustls", + "tokio-stream", + "tonic", + "tonic-prost", + "tonic-prost-build", + "tower", + "url", + "x509-parser", +] + +[[package]] +name = "spitzli-postgres" +version = "0.1.0" +dependencies = [ + "ed25519-dalek", + "hex", + "postgres-protocol", + "serde", + "serde_json", + "spitzli-plugin-kit", + "spitzli-plugin-protocol", + "spitzli-plugin-runtime", + "tokio", + "tokio-postgres", + "tonic", + "url", + "uuid", +] + [[package]] name = "spki" version = "0.7.3" @@ -2674,93 +2761,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webdock-plugin-kit" -version = "0.1.0" -source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6#8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -dependencies = [ - "aes-gcm", - "getrandom 0.2.17", - "hex", - "rustix", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "tokio", - "tokio-postgres", - "tokio-postgres-rustls", - "tonic", - "url", - "uuid", - "webdock-plugin-protocol", - "webdock-plugin-runtime", -] - -[[package]] -name = "webdock-plugin-protocol" -version = "0.1.0" -source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6#8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -dependencies = [ - "base64", - "chrono", - "ed25519-dalek", - "jsonschema", - "node-semver", - "regex", - "serde", - "serde_json", - "sha2 0.10.9", - "url", - "uuid", -] - -[[package]] -name = "webdock-plugin-runtime" -version = "0.1.0" -source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6#8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -dependencies = [ - "ed25519-dalek", - "hex", - "hyper-util", - "prost", - "rustix", - "rustls", - "rustls-pemfile", - "serde", - "serde_json", - "sha2 0.10.9", - "tokio", - "tokio-rustls", - "tokio-stream", - "tonic", - "tonic-prost", - "tonic-prost-build", - "tower", - "url", - "webdock-plugin-protocol", - "x509-parser", -] - -[[package]] -name = "webdock-postgres" -version = "0.1.0" -dependencies = [ - "ed25519-dalek", - "hex", - "postgres-protocol", - "serde", - "serde_json", - "tokio", - "tokio-postgres", - "tonic", - "url", - "uuid", - "webdock-plugin-kit", - "webdock-plugin-protocol", - "webdock-plugin-runtime", -] - [[package]] name = "whoami" version = "2.1.3" diff --git a/Cargo.toml b/Cargo.toml index b3bbfbd..7303a6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ ["package"] -"name" = "webdock-postgres" +"name" = "spitzli-postgres" "version" = "0.1.0" "edition" = "2024" "rust-version" = "1.94" @@ -23,20 +23,20 @@ "version" = "1" "features" = ["macros", "rt-multi-thread", "signal", "time"] -["dependencies"."webdock-plugin-protocol"] +["dependencies"."spitzli-plugin-protocol"] "git" = "https://github.com/spitzli/cloud-plugin-sdk" -"rev" = "8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -"package" = "webdock-plugin-protocol" +"rev" = "8019f3df67dba3fed3083f22635e4725028c1b5e" +"package" = "spitzli-plugin-protocol" -["dependencies"."webdock-plugin-runtime"] +["dependencies"."spitzli-plugin-runtime"] "git" = "https://github.com/spitzli/cloud-plugin-sdk" -"rev" = "8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -"package" = "webdock-plugin-runtime" +"rev" = "8019f3df67dba3fed3083f22635e4725028c1b5e" +"package" = "spitzli-plugin-runtime" -["dependencies"."webdock-plugin-kit"] +["dependencies"."spitzli-plugin-kit"] "git" = "https://github.com/spitzli/cloud-plugin-sdk" -"rev" = "8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -"package" = "webdock-plugin-kit" +"rev" = "8019f3df67dba3fed3083f22635e4725028c1b5e" +"package" = "spitzli-plugin-kit" ["dependencies"."tonic"] "version" = "0.14.6" diff --git a/Dockerfile b/Dockerfile index 0deaddd..d58147c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,15 +6,15 @@ WORKDIR /src COPY . . # Shared only among reviewed Spitzli platform sources; never customer build code. FROM source AS check -RUN --mount=type=cache,id=spitzli-native-sdk-8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6-registry,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6-git,target=/usr/local/cargo/git,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6-target,target=/src/target,sharing=locked cargo check --locked --all-targets --jobs 3 && cargo test --locked --all-targets --jobs 3 +RUN --mount=type=cache,id=spitzli-native-sdk-8019f3df67dba3fed3083f22635e4725028c1b5e-registry,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8019f3df67dba3fed3083f22635e4725028c1b5e-git,target=/usr/local/cargo/git,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8019f3df67dba3fed3083f22635e4725028c1b5e-target,target=/src/target,sharing=locked cargo check --locked --all-targets --jobs 3 && cargo test --locked --all-targets --jobs 3 FROM source AS build -RUN --mount=type=cache,id=spitzli-native-sdk-8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6-registry,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6-git,target=/usr/local/cargo/git,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6-target,target=/src/target,sharing=locked cargo build --locked --release --bins --jobs 3 && mkdir /out && install -m 0555 /src/target/release/webdock-postgres /out/webdock-postgres +RUN --mount=type=cache,id=spitzli-native-sdk-8019f3df67dba3fed3083f22635e4725028c1b5e-registry,target=/usr/local/cargo/registry,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8019f3df67dba3fed3083f22635e4725028c1b5e-git,target=/usr/local/cargo/git,sharing=locked --mount=type=cache,id=spitzli-native-sdk-8019f3df67dba3fed3083f22635e4725028c1b5e-target,target=/src/target,sharing=locked cargo build --locked --release --bins --jobs 3 && mkdir /out && install -m 0555 /src/target/release/spitzli-postgres /out/spitzli-postgres FROM docker.io/library/debian:trixie-slim@sha256:f6b08b09a05725f9431502d3b5714f5c4576e82c1a84fa1debe0c24a7e0c3ec4 COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY LICENSE COMMERCIAL-LICENSING.md NOTICE /usr/share/licenses/spitzli-cloud/ -COPY --from=build --chown=65532:65532 --chmod=0555 /out/webdock-postgres /usr/local/bin/webdock-postgres +COPY --from=build --chown=65532:65532 --chmod=0555 /out/spitzli-postgres /usr/local/bin/spitzli-postgres ENV HOME=/tmp USER 65532:65532 -ENTRYPOINT ["/usr/local/bin/webdock-postgres"] +ENTRYPOINT ["/usr/local/bin/spitzli-postgres"] diff --git a/NAMESPACE-MIGRATION.json b/NAMESPACE-MIGRATION.json new file mode 100644 index 0000000..643c046 --- /dev/null +++ b/NAMESPACE-MIGRATION.json @@ -0,0 +1,57 @@ +{ + "baseSource": "a0f2ea6ef495d4877d145198a6effe86d650aaa8", + "date": "2026-11-12", + "formatVersion": 1, + "licenseUnchanged": true, + "originalSourceSnapshotRetained": true, + "package": "spitzli-postgres", + "preservedBindingFilesSHA256": { + "COMMERCIAL-LICENSING.md": "5b8832f5014f16e2cf4f7ee295de32760eed20981495d184bd9f1517be256a09", + "EXPORT-PROVENANCE.json": "9b373ffd2b19732779b05b4f2c8668a0d977c5bae10aff968a59aaf2932d629c", + "LICENSE": "0d96a4ff68ad6d4b6f1f30f713b18d5184912ba8dd389f86aa7710db079abcb0", + "manifest.json": "7a553f50e0d6a9d39c036772442dfd1af30a1eada8b3914c80651d48c61b3958" + }, + "qualifiedChangedSourceSHA256": { + "Cargo.lock": "12a418cf413fefe5988f3b6e31b13943b77ef783341649287c62841ac012d13e", + "Cargo.toml": "98993bed440c5af8b807280671acb0230625aea9f81f5cee98c1e60a741cb578", + "Dockerfile": "3f94537e9af06abc14a03ecdb77a7883c14bedb503eaf037c8cbb9eaf550e1db", + "NOTICE": "4949ccd63735c148d2fd1f1423772d11938087ba0bdbcf4aad81c576bcfa09b8", + "README.md": "e81fdfb09d8a7d3e15bc1247c55075247af67864075798e68e5e4e590afc7b8b", + "scripts/plugin-release/release.mjs": "30462a348f238bc78dab840688199574ad4fc5e9b039310306d6210f4c433890", + "src/dedicated.rs": "426684c6e402923eb4329fedcf5b35b955a94537a3e1f1107b4addd2578bec6a", + "src/lib.rs": "1925f41a32c4a9f4f71739189e371782c99343d65721ae5f8caabe49d3663444", + "src/main.rs": "cfc8c963dacf5b188b4805862d943540f34d83723caae3e8d9dbb68fc68d2e34", + "src/store.rs": "530619bdb7731a0561f04e1911d8f141d6381732fd8a78ead38450395cf11d53", + "standalone.json": "f9726058c8238050da39c93af6a7d4e902ca3b654f1485cfb215c9227931dd6b", + "tests/lifecycle.rs": "3f39a9bfed162dad254e8470edb822413a20c42b653859f3882c935592f80216", + "tests/storage_retention.rs": "7bebb3e8652164bf2ee7b539f06bb1c5387166f814ba4e60b48d914c0502d445", + "tests/storage_transport.rs": "561e16916f430dcf8afaee5918d99faf3974969c9f9de8d34f59dae2e4165408", + "tools/manifest-validator/Cargo.lock": "ae2cb28761abf9ce99c9f5c4df246d47d61955a9919907fd222f511d13d84ba6", + "tools/manifest-validator/Cargo.toml": "81aa8724804a7f701f7b312c8851937369409d029071d2034dbd6f535b86df6a", + "tools/manifest-validator/src/main.rs": "bb5f5ab38c63e2c28aa64a329696e923aa747e62de2d058e2de734ada06e72b4", + "ui/index.tsx": "d01001df0a91778fb33b0d837f39fb461b38d5b2fce25fa58431d2798a616838" + }, + "runtimeArtifactsReplaced": false, + "scope": "Rust package/import and binary namespace, host UI import namespace, paired test environment variables and exact SDK pin", + "sdkGit": "https://github.com/spitzli/cloud-plugin-sdk", + "sdkRevision": "8019f3df67dba3fed3083f22635e4725028c1b5e", + "sourceChecks": { + "allRegistryLockfilesPreserved": [ + "Cargo.lock", + "tools/manifest-validator/Cargo.lock" + ], + "format": true, + "releaseContract": true, + "rustLiteralFilesChecked": 9, + "strictClippy": true, + "testsIgnored": 5, + "testsPassed": 4, + "ui": { + "component": "postgres", + "hostConsoleSource": "a9fa78a6264a64a5e3e9405a49d94da189f7638b", + "typecheckPassed": true + } + }, + "version": "0.1.0", + "wireStoredCryptographicAndExternalResourceBindings": "retained for coordinated migration" +} diff --git a/NOTICE b/NOTICE index 8f8f4fb..69c129f 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,7 @@ -Webdock +Spitzli Cloud Copyright (c) 2026 Spitzli Development and contributors. -Original Webdock code is licensed under AGPL-3.0-only unless separately noted. +Original Spitzli Cloud code is licensed under AGPL-3.0-only unless separately noted. Alternative written licenses may be available from the relevant rights holder. See LICENSE and COMMERCIAL-LICENSING.md. diff --git a/README.md b/README.md index 8f0025f..5949375 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ The retained implementation notes below include platform integration procedures. Commands referring to Core, `tools/` or `apps/console` require the [platform source checkout](https://github.com/spitzli/webdock); they are not standalone setup steps. -This release maintains existing retained PostgreSQL resources only. New shared and self-hosted database orders are disabled; Neon BYOK is the default for new database connections. Publishing this artifact does not install it, create customers or databases, enable orders, or delete existing data. Core keeps `WEBDOCK_DATABASE_NEW_ORDERS_ENABLED=false`. +This release maintains existing retained PostgreSQL resources only. New shared and self-hosted database orders are disabled; Neon BYOK is the default for new database connections. Publishing this artifact does not install it, create customers or databases, enable orders, or delete existing data. Core keeps `SPITZLI_DATABASE_NEW_ORDERS_ENABLED=false`. The retained maintenance protocol supports the existing resource types: @@ -58,6 +58,6 @@ The React UI in `ui/` is bundled by the Console and shown on the resource page. ```sh cargo test --locked # manifest contract # Real PostgreSQL (disposable, loopback); Core and the cluster are stood in for: -WEBDOCK_POSTGRES_PLUGIN_TEST_ADMIN_URL=postgres://… \ +SPITZLI_POSTGRES_PLUGIN_TEST_ADMIN_URL=postgres://… \ cargo test --locked -- --include-ignored ``` diff --git a/scripts/plugin-release/release.mjs b/scripts/plugin-release/release.mjs index 11b4590..4f227e7 100644 --- a/scripts/plugin-release/release.mjs +++ b/scripts/plugin-release/release.mjs @@ -78,7 +78,7 @@ export function validateDockerfile(raw) { export function validateSDKDependencies(dependencies) { const sources = new Set(); - for (const dependency of dependencies.filter(dep => dep.name.startsWith('webdock-'))) { + for (const dependency of dependencies.filter(dep => dep.name.startsWith('spitzli-') || dep.name.startsWith('webdock-'))) { requireValue(typeof dependency.source === 'string' && /\?rev=[a-f0-9]{40}(?:#|$)/.test(dependency.source), 'Every SDK crate must use a reviewed Git revision'); sources.add(dependency.source.split('#')[0]); } diff --git a/src/dedicated.rs b/src/dedicated.rs index 9759b53..d458880 100644 --- a/src/dedicated.rs +++ b/src/dedicated.rs @@ -3,9 +3,9 @@ //! is just a new apply. Customers connect through Traefik, routed by TLS server name. use serde::Deserialize; use serde_json::{Value, json}; +pub use spitzli_plugin_kit::workloads::{HostWorkloads, Workloads}; +use spitzli_plugin_protocol::PluginError; use uuid::Uuid; -pub use webdock_plugin_kit::workloads::{HostWorkloads, Workloads}; -use webdock_plugin_protocol::PluginError; #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "camelCase", deny_unknown_fields)] diff --git a/src/lib.rs b/src/lib.rs index f7e5bcd..43ee99b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,16 +2,16 @@ //! The Core admits every call (audience, access mode, resource ownership); this plugin checks //! again that a resource belongs to the invoking project before touching it. pub mod dedicated; -pub use webdock_plugin_kit::seal; +pub use spitzli_plugin_kit::seal; pub mod shared; pub mod store; use serde::Deserialize; use serde_json::{Value, json}; +use spitzli_plugin_protocol::{ErrorCode, InvocationClaims, Manifest, PluginError}; +use spitzli_plugin_runtime::ActionHandler; use std::sync::Arc; use uuid::Uuid; -use webdock_plugin_protocol::{ErrorCode, InvocationClaims, Manifest, PluginError}; -use webdock_plugin_runtime::ActionHandler; type Result = std::result::Result; pub const PLUGIN_ID: &str = "postgres"; diff --git a/src/main.rs b/src/main.rs index a2dd706..c4df0cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,8 @@ //! PostgreSQL plugin runtime over private Unix sockets, with its own storage database. use serde::Deserialize; +use spitzli_plugin_kit::transport::{CoreTls, ListenTls, RuntimeTransport}; +use spitzli_plugin_runtime::{self as runtime}; use std::{path::PathBuf, process::ExitCode, sync::Arc}; -use webdock_plugin_kit::transport::{CoreTls, ListenTls, RuntimeTransport}; -use webdock_plugin_runtime::{self as runtime}; type Error = Box; #[derive(Deserialize)] @@ -19,8 +19,8 @@ struct Configuration { storage_url: String, storage_ca: Option, secret_key_hex: String, - shared_servers: Vec, - dedicated: Option, + shared_servers: Vec, + dedicated: Option, } async fn run() -> Result<(), Error> { let mut args = std::env::args_os().skip(1); @@ -29,7 +29,7 @@ async fn run() -> Result<(), Error> { return Err("unexpected argument".into()); } let config: Configuration = - serde_json::from_slice(&webdock_plugin_kit::read_file(&path, true)?)?; + serde_json::from_slice(&spitzli_plugin_kit::read_file(&path, true)?)?; let transport = RuntimeTransport { listen: config.listen, core: config.core, @@ -37,39 +37,39 @@ async fn run() -> Result<(), Error> { core_tls: config.core_tls, }; transport.validate()?; - let manifest = webdock_plugin_protocol::Manifest::parse(&webdock_plugin_kit::read_file( + let manifest = spitzli_plugin_protocol::Manifest::parse(&spitzli_plugin_kit::read_file( &config.manifest, false, )?)?; - webdock_postgres::validate_manifest(&manifest)?; + spitzli_postgres::validate_manifest(&manifest)?; for server in &config.shared_servers { - webdock_plugin_kit::loopback(&server.admin_url)?; + spitzli_plugin_kit::loopback(&server.admin_url)?; } let store = match config.storage_ca { Some(path) => { - webdock_postgres::store::Store::connect_tls( + spitzli_postgres::store::Store::connect_tls( &config.storage_url, - &webdock_plugin_kit::read_file(&path, false)?, + &spitzli_plugin_kit::read_file(&path, false)?, ) .await? } - None => webdock_postgres::store::Store::connect(&config.storage_url).await?, + None => spitzli_postgres::store::Store::connect(&config.storage_url).await?, }; for server in &config.shared_servers { server.harden().await?; } let client = transport.core_client().await?; let placement = config.dedicated.map(|dedicated| { - let workloads = webdock_postgres::dedicated::HostWorkloads { + let workloads = spitzli_postgres::dedicated::HostWorkloads { client: client.clone(), plugin: manifest.id().into(), generation: config.generation, }; - webdock_postgres::dedicated::Placement::new(Box::new(workloads), dedicated) + spitzli_postgres::dedicated::Placement::new(Box::new(workloads), dedicated) }); - let plugin = webdock_postgres::Plugin::new( + let plugin = spitzli_postgres::Plugin::new( store, - webdock_postgres::seal::Sealer::new(&config.secret_key_hex)?, + spitzli_postgres::seal::Sealer::new(&config.secret_key_hex)?, config.shared_servers, placement, ); @@ -88,7 +88,7 @@ async fn run() -> Result<(), Error> { config.generation, ed25519_dalek::VerifyingKey::from_bytes(&key)?, Arc::new(authority), - Arc::new(webdock_postgres::Handler(plugin)), + Arc::new(spitzli_postgres::Handler(plugin)), )?; let shutdown = async { let _ = tokio::signal::ctrl_c().await; diff --git a/src/store.rs b/src/store.rs index 9bc869d..00decb4 100644 --- a/src/store.rs +++ b/src/store.rs @@ -63,20 +63,20 @@ fn resource(row: &tokio_postgres::Row) -> Resource { } } -pub type Error = webdock_plugin_kit::Error; +pub type Error = spitzli_plugin_kit::Error; pub struct Store(Client); impl Store { /// Connects and applies pending migrations under an advisory lock. pub async fn connect(url: &str) -> Result { - webdock_plugin_kit::loopback(url)?; + spitzli_plugin_kit::loopback(url)?; Ok(Self( - webdock_plugin_kit::storage(url, "postgres", MIGRATIONS).await?, + spitzli_plugin_kit::storage(url, "postgres", MIGRATIONS).await?, )) } /// Remote metadata storage verifies the actual PostgreSQL hostname with the private CA. pub async fn connect_tls(url: &str, ca: &[u8]) -> Result { Ok(Self( - webdock_plugin_kit::storage_tls(url, ca, "postgres", MIGRATIONS).await?, + spitzli_plugin_kit::storage_tls(url, ca, "postgres", MIGRATIONS).await?, )) } pub async fn insert(&self, r: &Resource) -> Result<(), Error> { diff --git a/standalone.json b/standalone.json index 082d039..9e4676b 100644 --- a/standalone.json +++ b/standalone.json @@ -1,14 +1,14 @@ { "binaries": [ - "webdock-postgres" + "spitzli-postgres" ], "connectionsOwner": "Core", "coreIntegrationDependencies": [], "coreIntegrationTests": [], - "entrypoint": "webdock-postgres", + "entrypoint": "spitzli-postgres", "lockfileRequiresRegeneration": true, "name": "postgres", - "package": "webdock-postgres", + "package": "spitzli-postgres", "release": { "mode": "native-extension", "protocol": "webdock.plugin.v2", @@ -17,11 +17,11 @@ "version": "0.1.0" }, "sdkDependencies": [ - "webdock-plugin-kit", - "webdock-plugin-protocol", - "webdock-plugin-runtime" + "spitzli-plugin-kit", + "spitzli-plugin-protocol", + "spitzli-plugin-runtime" ], "sdkGit": "https://github.com/spitzli/cloud-plugin-sdk", - "sdkRevision": "8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6", + "sdkRevision": "8019f3df67dba3fed3083f22635e4725028c1b5e", "source": "plugins/postgres" } diff --git a/tests/lifecycle.rs b/tests/lifecycle.rs index ae23693..825f594 100644 --- a/tests/lifecycle.rs +++ b/tests/lifecycle.rs @@ -1,15 +1,15 @@ //! Real PostgreSQL, no Core: a disposable local server named by -//! `WEBDOCK_POSTGRES_PLUGIN_TEST_ADMIN_URL` (loopback only) holds plugin storage and shared databases. +//! `SPITZLI_POSTGRES_PLUGIN_TEST_ADMIN_URL` (loopback only) holds plugin storage and shared databases. //! Dedicated instances go to a stand-in for Core's `plugin.workloads`; they run on the local k3s //! in the live dev stack. use serde_json::{Value, json}; -use std::sync::{Arc, Mutex}; -use tokio_postgres::NoTls; -use webdock_plugin_protocol::{ErrorCode, InvocationClaims, Manifest}; -use webdock_plugin_runtime::ActionHandler; -use webdock_postgres::{ +use spitzli_plugin_protocol::{ErrorCode, InvocationClaims, Manifest}; +use spitzli_plugin_runtime::ActionHandler; +use spitzli_postgres::{ Handler, Plugin, dedicated, seal::Sealer, shared::SharedServer, store::Store, }; +use std::sync::{Arc, Mutex}; +use tokio_postgres::NoTls; /// What Core holds for the units: the objects of the last apply and what the agent reported. #[derive(Default)] @@ -26,7 +26,7 @@ impl dedicated::Workloads for Core { &self, method: &str, input: Value, - ) -> Result { + ) -> Result { let mut units = self.0.lock().unwrap(); let unit = input["unit"].as_str().unwrap().to_owned(); Ok(match method { @@ -53,7 +53,7 @@ impl Core { fn admin_url() -> url::Url { let url = url::Url::parse( - &std::env::var("WEBDOCK_POSTGRES_PLUGIN_TEST_ADMIN_URL").expect("disposable local server"), + &std::env::var("SPITZLI_POSTGRES_PLUGIN_TEST_ADMIN_URL").expect("disposable local server"), ) .unwrap(); assert_eq!(url.host_str(), Some("127.0.0.1")); @@ -127,7 +127,7 @@ impl Fixture { project: &str, action: &str, input: Value, - ) -> Result { + ) -> Result { let claims = InvocationClaims { job: None, v: 1, @@ -168,7 +168,7 @@ fn id(created: &Value) -> Value { #[test] fn shipped_manifest_is_the_reviewed_contract() { let manifest = Manifest::parse(include_bytes!("../manifest.json")).unwrap(); - webdock_postgres::validate_manifest(&manifest).unwrap(); + spitzli_postgres::validate_manifest(&manifest).unwrap(); } #[tokio::test] diff --git a/tests/storage_retention.rs b/tests/storage_retention.rs index b70a00f..4457949 100644 --- a/tests/storage_retention.rs +++ b/tests/storage_retention.rs @@ -1,11 +1,11 @@ //! Physical Store retention proof; signed release/Console lifecycle is a separate acceptance. -use std::{process::Command, time::Duration}; -use tokio_postgres::{Client, NoTls}; -use uuid::Uuid; -use webdock_postgres::{ +use spitzli_postgres::{ seal::Sealer, store::{Resource, Store}, }; +use std::{process::Command, time::Duration}; +use tokio_postgres::{Client, NoTls}; +use uuid::Uuid; fn docker() -> Command { let mut command = Command::new("docker"); @@ -27,7 +27,7 @@ impl Drop for Fixture { impl Fixture { async fn start() -> Self { assert_eq!( - std::env::var("WEBDOCK_POSTGRES_STORAGE_DOCKER_TEST").as_deref(), + std::env::var("SPITZLI_POSTGRES_STORAGE_DOCKER_TEST").as_deref(), Ok("1") ); let container = format!("webdock-postgres-storage-{}", Uuid::new_v4().simple()); @@ -97,7 +97,7 @@ impl Fixture { } #[tokio::test] -#[ignore = "requires WEBDOCK_POSTGRES_STORAGE_DOCKER_TEST=1; creates only an owned disposable PostgreSQL"] +#[ignore = "requires SPITZLI_POSTGRES_STORAGE_DOCKER_TEST=1; creates only an owned disposable PostgreSQL"] async fn physical_three_migrations_and_sealed_resource_survive_repeated_store_startup() { let fixture = Fixture::start().await; let admin = fixture.connect().await.unwrap(); diff --git a/tests/storage_transport.rs b/tests/storage_transport.rs index fb15012..db8aed5 100644 --- a/tests/storage_transport.rs +++ b/tests/storage_transport.rs @@ -1,4 +1,4 @@ -use webdock_postgres::store::Store; +use spitzli_postgres::store::Store; #[tokio::test] async fn no_tls_store_is_loopback_only_and_tls_never_falls_back() { assert_eq!( diff --git a/tools/manifest-validator/Cargo.lock b/tools/manifest-validator/Cargo.lock index dd69a41..26ce02b 100644 --- a/tools/manifest-validator/Cargo.lock +++ b/tools/manifest-validator/Cargo.lock @@ -991,6 +991,32 @@ version = "1.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8" +[[package]] +name = "spitzli-plugin-protocol" +version = "0.1.0" +source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8019f3df67dba3fed3083f22635e4725028c1b5e#8019f3df67dba3fed3083f22635e4725028c1b5e" +dependencies = [ + "base64", + "chrono", + "ed25519-dalek", + "jsonschema", + "node-semver", + "regex", + "serde", + "serde_json", + "sha2", + "url", + "uuid", +] + +[[package]] +name = "spitzli-registry-manifest-validator" +version = "0.1.0" +dependencies = [ + "serde_json", + "spitzli-plugin-protocol", +] + [[package]] name = "spki" version = "0.7.3" @@ -1239,32 +1265,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "webdock-plugin-protocol" -version = "0.1.0" -source = "git+https://github.com/spitzli/cloud-plugin-sdk?rev=8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6#8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -dependencies = [ - "base64", - "chrono", - "ed25519-dalek", - "jsonschema", - "node-semver", - "regex", - "serde", - "serde_json", - "sha2", - "url", - "uuid", -] - -[[package]] -name = "webdock-registry-manifest-validator" -version = "0.1.0" -dependencies = [ - "serde_json", - "webdock-plugin-protocol", -] - [[package]] name = "windows-link" version = "0.2.1" diff --git a/tools/manifest-validator/Cargo.toml b/tools/manifest-validator/Cargo.toml index 3d08d68..e4c3b1d 100644 --- a/tools/manifest-validator/Cargo.toml +++ b/tools/manifest-validator/Cargo.toml @@ -1,5 +1,5 @@ ["package"] -"name" = "webdock-registry-manifest-validator" +"name" = "spitzli-registry-manifest-validator" "version" = "0.1.0" "edition" = "2024" "rust-version" = "1.94" @@ -11,10 +11,10 @@ ["dependencies"] "serde_json" = "1" -["dependencies"."webdock-plugin-protocol"] +["dependencies"."spitzli-plugin-protocol"] "git" = "https://github.com/spitzli/cloud-plugin-sdk" -"rev" = "8ed57d89c3263b050f126e4c2ba7f6cdebb0daa6" -"package" = "webdock-plugin-protocol" +"rev" = "8019f3df67dba3fed3083f22635e4725028c1b5e" +"package" = "spitzli-plugin-protocol" ["profile"] diff --git a/tools/manifest-validator/src/main.rs b/tools/manifest-validator/src/main.rs index efb848a..6453517 100644 --- a/tools/manifest-validator/src/main.rs +++ b/tools/manifest-validator/src/main.rs @@ -1,5 +1,5 @@ use std::io::{self, Read, Write}; -use webdock_plugin_protocol::Manifest; +use spitzli_plugin_protocol::Manifest; const MAX_REGISTRY_BYTES: usize = 64 * 1024; diff --git a/ui/index.tsx b/ui/index.tsx index 39ea8fa..f35494e 100644 --- a/ui/index.tsx +++ b/ui/index.tsx @@ -1,7 +1,7 @@ // Console UI of the PostgreSQL plugin. Bundled by the Console; every call goes through the plugin action API. import { useState } from "react"; import { z } from "zod"; -import { Failure, Loading, ui, usePluginMutation, usePluginQuery, usePluginReveal, type PluginUI, type ResourceProps } from "@webdock/plugin-ui"; +import { Failure, Loading, ui, usePluginMutation, usePluginQuery, usePluginReveal, type PluginUI, type ResourceProps } from "@spitzli/plugin-ui"; const viewSchema = z.object({ offering: z.enum(["shared", "dedicated"]),