diff --git a/src/Application/Common/Interfaces/BindleService/RevisionComponent.cs b/src/Application/Common/Interfaces/BindleService/RevisionComponent.cs index 654d88a0d..c42cda9b0 100644 --- a/src/Application/Common/Interfaces/BindleService/RevisionComponent.cs +++ b/src/Application/Common/Interfaces/BindleService/RevisionComponent.cs @@ -20,7 +20,7 @@ public class RevisionComponent public string? Files { get; set; } /// Optional list of HTTP hosts the component is allowed to connect. - public List? AllowedHTTPHosts { get; set; } + public List? AllowedHttpHosts { get; set; } /// Environment variables to be mapped inside the Wasm module at runtime. public Dictionary? Environment { get; set; } diff --git a/tests/Infrastructure.UnitTests/Services/BindleServiceTests.cs b/tests/Infrastructure.UnitTests/Services/BindleServiceTests.cs index a7ee85b7c..81ff6f5d7 100644 --- a/tests/Infrastructure.UnitTests/Services/BindleServiceTests.cs +++ b/tests/Infrastructure.UnitTests/Services/BindleServiceTests.cs @@ -1,5 +1,6 @@ using Xunit; using Hippo.Infrastructure.Services; +using System.Collections.Generic; namespace Hippo.Infrastructure.UnitTests.Services; @@ -8,27 +9,14 @@ public class BindleServiceTests [Fact] public void SpinTomlShouldBeParsable() { - var parcel = @" -[trigger] -type = 'http' -base = '/' + var parcels = new List{ + "[trigger]\ntype = 'http'\nbase = '/'\n\n[config.object]\ndefault = 'teapot'\nrequired = false\nsecret = false\n\n[[component]]\nsource = 'c3b7bfec9f12cf0e9e763fcaaa8140ef099577cf7c84130c9c9d66e85cf6d416'\nid = 'spin_config_tinygo'\n\n[component.trigger]\nroute = '/...'\n\n[component.config]\nmessage = '''I'm a {{object}}'''\n", + "[trigger]\ntype = 'http'\nbase = '/'\n\n[[component]]\nsource = 'f2a469f6dddea6e53ac554d41eecad98358db280cfde5e44ea89f770682e9b4f'\nid = 'rust-outbound-http'\nallowedHttpHosts = ['https://some-random-api.ml']\n\n[component.trigger]\nroute = '/outbound'\n\n[[component]]\nsource = 'f2a469f6dddea6e53ac554d41eecad98358db280cfde5e44ea89f770682e9b4f'\nid = 'rust-outbound-http-wildcard'\nallowedHttpHosts = ['insecure:allow-all']\n\n[component.trigger]\nroute = '/wildcard'\n" + }; -[config.object] -default = 'teapot' -required = false -secret = false - -[[component]] -source = 'c3b7bfec9f12cf0e9e763fcaaa8140ef099577cf7c84130c9c9d66e85cf6d416' -id = 'spin_config_tinygo' - -[component.trigger] -route = '/...' - -[component.config] -message = '''I'm a {{object}}''' -"; - - var spinToml = BindleService.ParseSpinToml(parcel); + foreach (var parcel in parcels) + { + BindleService.ParseSpinToml(parcel); + } } }