From d041cc0470c39a341de7b709e7cab5e7d5a011ef Mon Sep 17 00:00:00 2001 From: Lann Martin Date: Mon, 25 Sep 2023 11:36:03 -0400 Subject: [PATCH] http: Make `base = "/"` the default Signed-off-by: Lann Martin --- crates/doctor/src/manifest/trigger.rs | 27 +++---------------- .../tests/data/manifest_trigger_correct.toml | 2 +- ...trigger_http_app_trigger_missing_base.toml | 7 ----- ..._http_component_trigger_missing_route.toml | 2 +- crates/http/src/trigger.rs | 5 ++++ crates/loader/src/local/mod.rs | 2 +- crates/loader/src/local/tests.rs | 6 ++--- .../insecure-allow-all-with-invalid-url.toml | 2 +- ...-http-base.toml => invalid-http-base.toml} | 6 ++--- .../tests/invalid-manifest-duplicate-id.toml | 2 +- crates/loader/tests/invalid-manifest.toml | 2 +- .../invalid-url-in-allowed-http-hosts.toml | 2 +- crates/loader/tests/invalid-version.toml | 2 +- crates/loader/tests/valid-manifest.toml | 2 +- .../loader/tests/valid-with-files/spin.toml | 2 +- .../loader/tests/wagi-custom-entrypoint.toml | 2 +- crates/manifest/src/lib.rs | 1 + crates/trigger/src/locked.rs | 2 +- docs/spin.toml | 2 +- examples/config-rust/spin.toml | 2 +- examples/config-tinygo/spin.toml | 2 +- examples/http-cpp/spin.toml | 2 +- examples/http-rust-outbound-http/spin.toml | 2 +- examples/http-rust-router-macro/spin.toml | 2 +- examples/http-rust-router/spin.toml | 2 +- examples/http-rust/spin.toml | 2 +- examples/http-tinygo-outbound-http/spin.toml | 2 +- examples/http-tinygo-router/README.md | 2 +- examples/http-tinygo-router/spin.toml | 2 +- examples/http-tinygo/README.md | 2 +- examples/http-tinygo/spin.toml | 2 +- examples/rust-key-value/spin.toml | 2 +- examples/rust-outbound-mysql/spin.toml | 2 +- examples/rust-outbound-pg/spin.toml | 2 +- examples/rust-outbound-redis/spin.toml | 2 +- examples/spin-wagi-http/spin.toml | 2 +- examples/tinygo-key-value/spin.toml | 2 +- examples/tinygo-outbound-redis/spin.toml | 2 +- examples/tinygo-sqlite/spin.toml | 2 +- examples/wagi-http-rust/spin.toml | 2 +- sdk/go/http/testdata/http-tinygo/spin.toml | 2 +- sdk/go/http/testdata/spin-roundtrip/spin.toml | 2 +- tests/build/nested/spin.toml | 2 +- tests/build/sibling/spin.toml | 2 +- tests/build/simple/spin.toml | 2 +- tests/http/headers-env-routes-test/spin.toml | 2 +- tests/http/http-tinygo/spin.toml | 2 +- tests/http/vault-config-test/spin.toml | 2 +- tests/integration.rs | 2 +- .../http-rust-outbound-redis/spin.toml | 2 +- tests/testcases/assets-test/spin.toml | 2 +- tests/testcases/config-variables/spin.toml | 2 +- tests/testcases/error/spin.toml | 2 +- .../headers-dynamic-env-test/spin.toml | 2 +- .../headers-env-routes-test/spin.toml | 2 +- .../http-rust-outbound-mysql/spin.toml | 2 +- .../testcases/http-rust-outbound-pg/spin.toml | 2 +- tests/testcases/longevity-apps-test/spin.toml | 2 +- tests/watch/http-rust/spin.toml | 2 +- tests/watch/static-fileserver/spin.toml | 2 +- 60 files changed, 69 insertions(+), 91 deletions(-) delete mode 100644 crates/doctor/tests/data/manifest_trigger_http_app_trigger_missing_base.toml rename crates/loader/tests/{missing-http-base.toml => invalid-http-base.toml} (59%) diff --git a/crates/doctor/src/manifest/trigger.rs b/crates/doctor/src/manifest/trigger.rs index 1bf0e62f1..cebfeb690 100644 --- a/crates/doctor/src/manifest/trigger.rs +++ b/crates/doctor/src/manifest/trigger.rs @@ -57,8 +57,6 @@ pub enum TriggerDiagnosis { MissingAppTrigger, /// Invalid app trigger config InvalidAppTrigger(&'static str), - /// HTTP trigger missing base field - HttpAppTriggerMissingBase, /// HTTP component trigger missing route field HttpComponentTriggerMissingRoute(String, bool), /// Invalid HTTP component trigger config @@ -76,12 +74,9 @@ impl TriggerDiagnosis { let Some(trigger_type) = trigger.get("type") else { return Some(Self::InvalidAppTrigger("trigger table missing type")); }; - let Some(trigger_type) = trigger_type.as_str() else { + let Some(_) = trigger_type.as_str() else { return Some(Self::InvalidAppTrigger("type must be a string")); }; - if trigger_type == "http" && trigger.get("base").is_none() { - return Some(Self::HttpAppTriggerMissingBase); - } None } @@ -116,7 +111,6 @@ impl Diagnosis for TriggerDiagnosis { Self::InvalidAppTrigger(msg) => { format!("Invalid app trigger config: {msg}") } - Self::HttpAppTriggerMissingBase => "http trigger config missing base".into(), Self::HttpComponentTriggerMissingRoute(id, _) => { format!("HTTP component {id:?} missing trigger.route") } @@ -128,7 +122,7 @@ impl Diagnosis for TriggerDiagnosis { fn treatment(&self) -> Option<&dyn Treatment> { match self { - Self::MissingAppTrigger | Self::HttpAppTriggerMissingBase => Some(self), + Self::MissingAppTrigger => Some(self), // We can reasonably fill in default "route" iff there is only one component Self::HttpComponentTriggerMissingRoute(_, single_component) if *single_component => { Some(self) @@ -143,9 +137,6 @@ impl ManifestTreatment for TriggerDiagnosis { fn summary(&self) -> String { match self { TriggerDiagnosis::MissingAppTrigger => "Add default HTTP trigger config".into(), - TriggerDiagnosis::HttpAppTriggerMissingBase => { - "Set default HTTP trigger base '/'".into() - } TriggerDiagnosis::HttpComponentTriggerMissingRoute(id, _) => { format!("Set trigger.route '/...' for component {id:?}") } @@ -155,7 +146,7 @@ impl ManifestTreatment for TriggerDiagnosis { async fn treat_manifest(&self, doc: &mut Document) -> anyhow::Result<()> { match self { - Self::MissingAppTrigger | Self::HttpAppTriggerMissingBase => { + Self::MissingAppTrigger => { // Get or insert missing trigger config if doc.get("trigger").is_none() { doc.insert("trigger", Item::Value(InlineTable::new().into())); @@ -175,8 +166,6 @@ impl ManifestTreatment for TriggerDiagnosis { decor.set_suffix(suffix.to_string().trim()); } } - // Set missing "base" - trigger.entry("base").or_insert(Item::Value("/".into())); } } Self::HttpComponentTriggerMissingRoute(_, true) => { @@ -230,16 +219,6 @@ mod tests { assert!(matches!(diag, TriggerDiagnosis::MissingAppTrigger)); } - #[tokio::test] - async fn test_http_app_trigger_missing_base() { - let diag = run_broken_test::( - "manifest_trigger", - "http_app_trigger_missing_base", - ) - .await; - assert!(matches!(diag, TriggerDiagnosis::HttpAppTriggerMissingBase)); - } - #[tokio::test] async fn test_http_component_trigger_missing_route() { let diag = run_broken_test::( diff --git a/crates/doctor/tests/data/manifest_trigger_correct.toml b/crates/doctor/tests/data/manifest_trigger_correct.toml index 5b9a97bdc..9c1147025 100644 --- a/crates/doctor/tests/data/manifest_trigger_correct.toml +++ b/crates/doctor/tests/data/manifest_trigger_correct.toml @@ -1,4 +1,4 @@ -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] id = "http-component" diff --git a/crates/doctor/tests/data/manifest_trigger_http_app_trigger_missing_base.toml b/crates/doctor/tests/data/manifest_trigger_http_app_trigger_missing_base.toml deleted file mode 100644 index 9c1147025..000000000 --- a/crates/doctor/tests/data/manifest_trigger_http_app_trigger_missing_base.toml +++ /dev/null @@ -1,7 +0,0 @@ -trigger = { type = "http" } - -[[component]] -id = "http-component" - -[component.trigger] -route = "/..." \ No newline at end of file diff --git a/crates/doctor/tests/data/manifest_trigger_http_component_trigger_missing_route.toml b/crates/doctor/tests/data/manifest_trigger_http_component_trigger_missing_route.toml index 2a6b6da88..75bd027b9 100644 --- a/crates/doctor/tests/data/manifest_trigger_http_component_trigger_missing_route.toml +++ b/crates/doctor/tests/data/manifest_trigger_http_component_trigger_missing_route.toml @@ -1,4 +1,4 @@ -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] id = "http-component" \ No newline at end of file diff --git a/crates/http/src/trigger.rs b/crates/http/src/trigger.rs index a567dce36..50c6fb2ba 100644 --- a/crates/http/src/trigger.rs +++ b/crates/http/src/trigger.rs @@ -10,5 +10,10 @@ pub struct Metadata { // The type of trigger which should always been "http" in this case pub r#type: String, // The based url + #[serde(default = "default_base")] pub base: String, } + +pub fn default_base() -> String { + "/".into() +} diff --git a/crates/loader/src/local/mod.rs b/crates/loader/src/local/mod.rs index 724c748f5..3e698e24f 100644 --- a/crates/loader/src/local/mod.rs +++ b/crates/loader/src/local/mod.rs @@ -497,7 +497,7 @@ source = "nonexistent.wasm" r#" spin_version = "1" name = "test" -trigger = {{ type = "http", base = "/" }} +trigger = {{ type = "http" }} version = "0.0.1" [variables] diff --git a/crates/loader/src/local/tests.rs b/crates/loader/src/local/tests.rs index d12e9f310..d12a23c26 100644 --- a/crates/loader/src/local/tests.rs +++ b/crates/loader/src/local/tests.rs @@ -202,14 +202,14 @@ fn test_unknown_version_is_rejected() { } #[tokio::test] -async fn gives_correct_error_when_missing_app_trigger_field() -> Result<()> { - const MANIFEST: &str = "tests/missing-http-base.toml"; +async fn gives_correct_error_for_invalid_app_trigger_field() -> Result<()> { + const MANIFEST: &str = "tests/invalid-http-base.toml"; let app = raw_manifest_from_file(&PathBuf::from(MANIFEST)).await; let e = format!("{:#}", app.unwrap_err()); assert!( - e.contains("missing field `base`"), + e.contains("expected a string for key `base`"), "Expected error to contain trigger field information but was '{e}'" ); diff --git a/crates/loader/tests/insecure-allow-all-with-invalid-url.toml b/crates/loader/tests/insecure-allow-all-with-invalid-url.toml index e82c68656..e468d3ba7 100644 --- a/crates/loader/tests/insecure-allow-all-with-invalid-url.toml +++ b/crates/loader/tests/insecure-allow-all-with-invalid-url.toml @@ -1,7 +1,7 @@ spin_version = "1" name = "spin-hello-world-duplicate" version = "1.0.0" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] id = "hello" diff --git a/crates/loader/tests/missing-http-base.toml b/crates/loader/tests/invalid-http-base.toml similarity index 59% rename from crates/loader/tests/missing-http-base.toml rename to crates/loader/tests/invalid-http-base.toml index 2d11da786..a80759da4 100644 --- a/crates/loader/tests/missing-http-base.toml +++ b/crates/loader/tests/invalid-http-base.toml @@ -1,8 +1,8 @@ spin_version = "1" authors = ["Gul Madred", "Edward Jellico", "JL"] -description = "A HTTP application without a base" -name = "missing-http-base" -trigger = {type = "http"} +description = "A HTTP application with an invalid base" +name = "invalid-http-base" +trigger = { type = "http", base = 7 } version = "6.11.2" [[component]] diff --git a/crates/loader/tests/invalid-manifest-duplicate-id.toml b/crates/loader/tests/invalid-manifest-duplicate-id.toml index a03a2e50a..15cda1edb 100644 --- a/crates/loader/tests/invalid-manifest-duplicate-id.toml +++ b/crates/loader/tests/invalid-manifest-duplicate-id.toml @@ -1,7 +1,7 @@ spin_version = "1" name = "spin-hello-world-duplicate" version = "1.0.0" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] id = "hello" diff --git a/crates/loader/tests/invalid-manifest.toml b/crates/loader/tests/invalid-manifest.toml index c23c4f666..60578208f 100644 --- a/crates/loader/tests/invalid-manifest.toml +++ b/crates/loader/tests/invalid-manifest.toml @@ -2,5 +2,5 @@ spin_version = "1" authors = ["Gul Madred", "Edward Jellico", "JL"] description = "A simple application that returns the number of lights" name = "chain-of-command" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} ver diff --git a/crates/loader/tests/invalid-url-in-allowed-http-hosts.toml b/crates/loader/tests/invalid-url-in-allowed-http-hosts.toml index a06d3c186..cac49d9c1 100644 --- a/crates/loader/tests/invalid-url-in-allowed-http-hosts.toml +++ b/crates/loader/tests/invalid-url-in-allowed-http-hosts.toml @@ -1,7 +1,7 @@ spin_version = "1" name = "spin-hello-world-duplicate" version = "1.0.0" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] id = "hello" diff --git a/crates/loader/tests/invalid-version.toml b/crates/loader/tests/invalid-version.toml index 502f9b492..818037fc4 100644 --- a/crates/loader/tests/invalid-version.toml +++ b/crates/loader/tests/invalid-version.toml @@ -2,7 +2,7 @@ spin_version = "77.301.12" authors = ["Gul Madred", "Edward Jellico", "JL"] description = "Because if we get to API version 77.301.12 then we have bigger problems" name = "chain-of-command" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "6.11.2" [[component]] diff --git a/crates/loader/tests/valid-manifest.toml b/crates/loader/tests/valid-manifest.toml index 6c2392f29..98016e2f3 100644 --- a/crates/loader/tests/valid-manifest.toml +++ b/crates/loader/tests/valid-manifest.toml @@ -2,7 +2,7 @@ spin_version = "1" authors = ["Gul Madred", "Edward Jellico", "JL"] description = "A simple application that returns the number of lights" name = "chain-of-command" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "6.11.2" [[component]] diff --git a/crates/loader/tests/valid-with-files/spin.toml b/crates/loader/tests/valid-with-files/spin.toml index 5524ff0ae..e5368fce4 100644 --- a/crates/loader/tests/valid-with-files/spin.toml +++ b/crates/loader/tests/valid-with-files/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "spin-local-source-test" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "1.0.0" [[component]] diff --git a/crates/loader/tests/wagi-custom-entrypoint.toml b/crates/loader/tests/wagi-custom-entrypoint.toml index 1e44fbf57..0443ab1bc 100644 --- a/crates/loader/tests/wagi-custom-entrypoint.toml +++ b/crates/loader/tests/wagi-custom-entrypoint.toml @@ -2,7 +2,7 @@ name = "spin-wagi-custom-entrypoint" spin_version = "1" version = "1.0.0" authors = [ "Fermyon Engineering " ] -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] source = "spin-fs.wasm" diff --git a/crates/manifest/src/lib.rs b/crates/manifest/src/lib.rs index c6b8a1b57..9145e5fa8 100644 --- a/crates/manifest/src/lib.rs +++ b/crates/manifest/src/lib.rs @@ -205,6 +205,7 @@ impl From for ApplicationTriggerSerialised { /// HTTP trigger configuration. #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] +#[serde(default)] pub struct HttpTriggerConfiguration { /// Base path for the HTTP application. pub base: String, diff --git a/crates/trigger/src/locked.rs b/crates/trigger/src/locked.rs index b42d5f948..e0e8aade5 100644 --- a/crates/trigger/src/locked.rs +++ b/crates/trigger/src/locked.rs @@ -221,7 +221,7 @@ mod tests { spin_version = "1" name = "test-app" version = "0.0.1" - trigger = { type = "http", base = "/" } + trigger = { type = "http" } [variables] test_var = { default = "test-val" } diff --git a/docs/spin.toml b/docs/spin.toml index 268f123ed..fe0ccd89e 100644 --- a/docs/spin.toml +++ b/docs/spin.toml @@ -3,7 +3,7 @@ name = "spin-docs" version = "0.1.0" description = "The Spin documentation website running on... Spin." authors = [ "Fermyon Engineering " ] -trigger = { type = "http", base = "/" } +trigger = { type = "http" } [[component]] id = "redirect-download" diff --git a/examples/config-rust/spin.toml b/examples/config-rust/spin.toml index 114b1c2d3..ab2cf2e61 100644 --- a/examples/config-rust/spin.toml +++ b/examples/config-rust/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A Spin Rust application demonstrating the config sdk." name = "spin-config-rust" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [variables] diff --git a/examples/config-tinygo/spin.toml b/examples/config-tinygo/spin.toml index 67516b824..fc08c4ab3 100644 --- a/examples/config-tinygo/spin.toml +++ b/examples/config-tinygo/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-config-tinygo" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [variables] diff --git a/examples/http-cpp/spin.toml b/examples/http-cpp/spin.toml index 9dc85cacb..5367e2540 100644 --- a/examples/http-cpp/spin.toml +++ b/examples/http-cpp/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple application that returns hello." name = "spin-hello-world" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-rust-outbound-http/spin.toml b/examples/http-rust-outbound-http/spin.toml index efa11da22..8b8edd690 100644 --- a/examples/http-rust-outbound-http/spin.toml +++ b/examples/http-rust-outbound-http/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "Demonstrates outbound HTTP calls" name = "spin-outbound-http" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-rust-router-macro/spin.toml b/examples/http-rust-router-macro/spin.toml index 8be7b5df6..c80b0c2f9 100644 --- a/examples/http-rust-router-macro/spin.toml +++ b/examples/http-rust-router-macro/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "An application that demonstrates HTTP routing." name = "spin-rust-router" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-rust-router/spin.toml b/examples/http-rust-router/spin.toml index c65048912..ec8bb34e5 100644 --- a/examples/http-rust-router/spin.toml +++ b/examples/http-rust-router/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "An application that demonstrates HTTP routing." name = "spin-rust-router" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-rust/spin.toml b/examples/http-rust/spin.toml index 10854dc58..1341b68d0 100644 --- a/examples/http-rust/spin.toml +++ b/examples/http-rust/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple application that returns hello." name = "spin-hello-world" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-tinygo-outbound-http/spin.toml b/examples/http-tinygo-outbound-http/spin.toml index ab01306c2..e687ac44f 100644 --- a/examples/http-tinygo-outbound-http/spin.toml +++ b/examples/http-tinygo-outbound-http/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go that performs outbound HTTP requests." name = "spin-tinygo-outbound-http" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-tinygo-router/README.md b/examples/http-tinygo-router/README.md index cc086b433..bec697523 100644 --- a/examples/http-tinygo-router/README.md +++ b/examples/http-tinygo-router/README.md @@ -43,7 +43,7 @@ apiVersion = "0.1.0" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-hello-world" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-tinygo-router/spin.toml b/examples/http-tinygo-router/spin.toml index 868c480b7..3bbfb6917 100644 --- a/examples/http-tinygo-router/spin.toml +++ b/examples/http-tinygo-router/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-hello-tinygo" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-tinygo/README.md b/examples/http-tinygo/README.md index ac6d02877..b47752fa8 100644 --- a/examples/http-tinygo/README.md +++ b/examples/http-tinygo/README.md @@ -44,7 +44,7 @@ apiVersion = "0.1.0" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-hello-world" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/http-tinygo/spin.toml b/examples/http-tinygo/spin.toml index 7e4dd2c76..037e52305 100644 --- a/examples/http-tinygo/spin.toml +++ b/examples/http-tinygo/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-hello-tinygo" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/rust-key-value/spin.toml b/examples/rust-key-value/spin.toml index ffad4089b..66bf917a0 100644 --- a/examples/rust-key-value/spin.toml +++ b/examples/rust-key-value/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple application that exercises key-value storage." name = "spin-key-value" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/rust-outbound-mysql/spin.toml b/examples/rust-outbound-mysql/spin.toml index 2c3eb9b7b..37af79ee8 100644 --- a/examples/rust-outbound-mysql/spin.toml +++ b/examples/rust-outbound-mysql/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["itowlson "] description = "Demo of calling MySQL from a Spin application" name = "rust-outbound-mysql" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/examples/rust-outbound-pg/spin.toml b/examples/rust-outbound-pg/spin.toml index 11d090371..ef6e905a5 100644 --- a/examples/rust-outbound-pg/spin.toml +++ b/examples/rust-outbound-pg/spin.toml @@ -1,7 +1,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] name = "rust-outbound-pg-example" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/examples/rust-outbound-redis/spin.toml b/examples/rust-outbound-redis/spin.toml index 589a4b296..d50fa2cc2 100644 --- a/examples/rust-outbound-redis/spin.toml +++ b/examples/rust-outbound-redis/spin.toml @@ -1,7 +1,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] name = "rust-outbound-redis-example" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/examples/spin-wagi-http/spin.toml b/examples/spin-wagi-http/spin.toml index 758191967..7747a3c14 100644 --- a/examples/spin-wagi-http/spin.toml +++ b/examples/spin-wagi-http/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A hello world application that serves content from a C++ program and a Rust program" name = "spin-wagi-hello" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/examples/tinygo-key-value/spin.toml b/examples/tinygo-key-value/spin.toml index b76907a60..273a2bd19 100644 --- a/examples/tinygo-key-value/spin.toml +++ b/examples/tinygo-key-value/spin.toml @@ -1,7 +1,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] name = "tinygo-key-value-example" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/examples/tinygo-outbound-redis/spin.toml b/examples/tinygo-outbound-redis/spin.toml index 91be113db..f4b3dfb98 100644 --- a/examples/tinygo-outbound-redis/spin.toml +++ b/examples/tinygo-outbound-redis/spin.toml @@ -1,7 +1,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] name = "tinygo-outbound-redis-example" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/examples/tinygo-sqlite/spin.toml b/examples/tinygo-sqlite/spin.toml index 0607f2e26..16dca579a 100644 --- a/examples/tinygo-sqlite/spin.toml +++ b/examples/tinygo-sqlite/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Adam Reese "] description = "" name = "tinygo-sqlite" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/examples/wagi-http-rust/spin.toml b/examples/wagi-http-rust/spin.toml index 07b18bb83..7496459e3 100644 --- a/examples/wagi-http-rust/spin.toml +++ b/examples/wagi-http-rust/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "An application that returns the arguments the program started with, the environment variables set, and current time" name = "wagi-hello-world" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/sdk/go/http/testdata/http-tinygo/spin.toml b/sdk/go/http/testdata/http-tinygo/spin.toml index 635e39ac4..10f42ca6e 100644 --- a/sdk/go/http/testdata/http-tinygo/spin.toml +++ b/sdk/go/http/testdata/http-tinygo/spin.toml @@ -2,7 +2,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-http-tinygo-test" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/sdk/go/http/testdata/spin-roundtrip/spin.toml b/sdk/go/http/testdata/spin-roundtrip/spin.toml index 778f3043f..cf7209aab 100644 --- a/sdk/go/http/testdata/spin-roundtrip/spin.toml +++ b/sdk/go/http/testdata/spin-roundtrip/spin.toml @@ -2,7 +2,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-roundtrip-test" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/tests/build/nested/spin.toml b/tests/build/nested/spin.toml index 48ef8e557..38066de0f 100644 --- a/tests/build/nested/spin.toml +++ b/tests/build/nested/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "spin-build-nested" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "1.0.0" [[component]] diff --git a/tests/build/sibling/spin.toml b/tests/build/sibling/spin.toml index 03647255d..7b15e5815 100644 --- a/tests/build/sibling/spin.toml +++ b/tests/build/sibling/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "spin-build-sibling" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "1.0.0" [[component]] diff --git a/tests/build/simple/spin.toml b/tests/build/simple/spin.toml index 4a0ebeca6..71789d574 100644 --- a/tests/build/simple/spin.toml +++ b/tests/build/simple/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "spin-build-simple" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "1.0.0" [[component]] diff --git a/tests/http/headers-env-routes-test/spin.toml b/tests/http/headers-env-routes-test/spin.toml index e2775c70c..c0f258a33 100644 --- a/tests/http/headers-env-routes-test/spin.toml +++ b/tests/http/headers-env-routes-test/spin.toml @@ -3,7 +3,7 @@ name = "spin-headers-env-routes-test" version = "1.0.0" authors = ["Fermyon Engineering "] description = "A simple application that returns hello and goodbye." -trigger = {type = "http", base = "/"} +trigger = {type = "http"} [[component]] id = "env" diff --git a/tests/http/http-tinygo/spin.toml b/tests/http/http-tinygo/spin.toml index f8c887880..d9e30d20b 100644 --- a/tests/http/http-tinygo/spin.toml +++ b/tests/http/http-tinygo/spin.toml @@ -2,7 +2,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] description = "A simple Spin application written in (Tiny)Go." name = "spin-http-tinygo-test" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/tests/http/vault-config-test/spin.toml b/tests/http/vault-config-test/spin.toml index 422a6f3b3..f2526137a 100644 --- a/tests/http/vault-config-test/spin.toml +++ b/tests/http/vault-config-test/spin.toml @@ -2,7 +2,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] description = "A simple application that returns query values from config providers" name = "vault-config-test" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [variables] diff --git a/tests/integration.rs b/tests/integration.rs index c6df78b27..00d569fc4 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -468,7 +468,7 @@ mod integration_tests { // We still don't see full help if there are no components. let toml_text = r#"spin_version = "1" name = "unbuilt" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] id = "unbuilt" diff --git a/tests/outbound-redis/http-rust-outbound-redis/spin.toml b/tests/outbound-redis/http-rust-outbound-redis/spin.toml index 3f48e01b3..5454cc71c 100644 --- a/tests/outbound-redis/http-rust-outbound-redis/spin.toml +++ b/tests/outbound-redis/http-rust-outbound-redis/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "rust-outbound-redis-example" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/tests/testcases/assets-test/spin.toml b/tests/testcases/assets-test/spin.toml index 7c34f9a8c..345fd4ecb 100644 --- a/tests/testcases/assets-test/spin.toml +++ b/tests/testcases/assets-test/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "assets-test" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "1.0.0" [[component]] diff --git a/tests/testcases/config-variables/spin.toml b/tests/testcases/config-variables/spin.toml index d52029578..d03ba5e96 100644 --- a/tests/testcases/config-variables/spin.toml +++ b/tests/testcases/config-variables/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple application that exercises the use of a configuration variable" name = "config-variables" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [variables] diff --git a/tests/testcases/error/spin.toml b/tests/testcases/error/spin.toml index 6e072a63b..ca119262d 100644 --- a/tests/testcases/error/spin.toml +++ b/tests/testcases/error/spin.toml @@ -1,4 +1,4 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "error" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} diff --git a/tests/testcases/headers-dynamic-env-test/spin.toml b/tests/testcases/headers-dynamic-env-test/spin.toml index 09392d4b0..fca302f7e 100644 --- a/tests/testcases/headers-dynamic-env-test/spin.toml +++ b/tests/testcases/headers-dynamic-env-test/spin.toml @@ -3,7 +3,7 @@ name = "headers-dynamic-env-test" version = "1.0.0" authors = ["Fermyon Engineering "] description = "A simple application that returns hello and goodbye." -trigger = {type = "http", base = "/"} +trigger = {type = "http"} [[component]] id = "env" diff --git a/tests/testcases/headers-env-routes-test/spin.toml b/tests/testcases/headers-env-routes-test/spin.toml index b6aff444a..e44e173ae 100644 --- a/tests/testcases/headers-env-routes-test/spin.toml +++ b/tests/testcases/headers-env-routes-test/spin.toml @@ -3,7 +3,7 @@ name = "headers-env-routes-test" version = "1.0.0" authors = ["Fermyon Engineering "] description = "A simple application that returns hello and goodbye." -trigger = {type = "http", base = "/"} +trigger = {type = "http"} [[component]] id = "env" diff --git a/tests/testcases/http-rust-outbound-mysql/spin.toml b/tests/testcases/http-rust-outbound-mysql/spin.toml index 4d6a2b4b2..842002bc2 100644 --- a/tests/testcases/http-rust-outbound-mysql/spin.toml +++ b/tests/testcases/http-rust-outbound-mysql/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "http-rust-outbound-mysql" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/tests/testcases/http-rust-outbound-pg/spin.toml b/tests/testcases/http-rust-outbound-pg/spin.toml index e57582d4d..c37313487 100644 --- a/tests/testcases/http-rust-outbound-pg/spin.toml +++ b/tests/testcases/http-rust-outbound-pg/spin.toml @@ -1,7 +1,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] name = "rust-outbound-pg-example" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]] diff --git a/tests/testcases/longevity-apps-test/spin.toml b/tests/testcases/longevity-apps-test/spin.toml index 80690f458..7b0f92494 100644 --- a/tests/testcases/longevity-apps-test/spin.toml +++ b/tests/testcases/longevity-apps-test/spin.toml @@ -2,7 +2,7 @@ spin_version = "1" authors = ["Fermyon Engineering "] description = "A longevity test for verifying backward compatible runtime" name = "longevity-test" -trigger = {type = "http", base = "/"} +trigger = {type = "http"} version = "1.0.0" [[component]] diff --git a/tests/watch/http-rust/spin.toml b/tests/watch/http-rust/spin.toml index 707df1ffd..22cc36f82 100644 --- a/tests/watch/http-rust/spin.toml +++ b/tests/watch/http-rust/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Fermyon Engineering "] description = "A simple application that returns hello." name = "spin-hello-world" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "1.0.0" [[component]] diff --git a/tests/watch/static-fileserver/spin.toml b/tests/watch/static-fileserver/spin.toml index e2279d934..14a34bd1b 100644 --- a/tests/watch/static-fileserver/spin.toml +++ b/tests/watch/static-fileserver/spin.toml @@ -2,7 +2,7 @@ spin_manifest_version = "1" authors = ["Caleb Schoepp "] description = "A fileserver for your static assets" name = "static-fileserver" -trigger = { type = "http", base = "/" } +trigger = { type = "http" } version = "0.1.0" [[component]]