Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

fix pascal casing for AllowedHttpHosts #1132

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>? AllowedHTTPHosts { get; set; }
public List<string>? AllowedHttpHosts { get; set; }

/// Environment variables to be mapped inside the Wasm module at runtime.
public Dictionary<string, string>? Environment { get; set; }
Expand Down
30 changes: 9 additions & 21 deletions tests/Infrastructure.UnitTests/Services/BindleServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Xunit;
using Hippo.Infrastructure.Services;
using System.Collections.Generic;

namespace Hippo.Infrastructure.UnitTests.Services;

Expand All @@ -8,27 +9,14 @@ public class BindleServiceTests
[Fact]
public void SpinTomlShouldBeParsable()
{
var parcel = @"
[trigger]
type = 'http'
base = '/'
var parcels = new List<string>{
"[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);
}
}
}