diff --git a/tests/DodoSSH.SystemTests/M1VerticalSliceTests.cs b/tests/DodoSSH.SystemTests/M1VerticalSliceTests.cs index b71bbdc..9f88548 100644 --- a/tests/DodoSSH.SystemTests/M1VerticalSliceTests.cs +++ b/tests/DodoSSH.SystemTests/M1VerticalSliceTests.cs @@ -61,21 +61,7 @@ public sealed class M1VerticalSliceTests(DevStack stack) : IClassFixture options with { RequireHttpsMetadata = false }); + using var connection = await SignInToTheStackAsync(browser); AssertDiscoveredFromTheServer(connection); @@ -127,6 +113,32 @@ public sealed class M1VerticalSliceTests(DevStack stack) : IClassFixtureSigns in against the Keycloak this suite started for itself. + /// + /// + /// The plaintext exemption is stated here rather than inherited from the shape of an address, and + /// saying it out loud is the point. allows an http authority + /// only when it is loopback — a sound rule, and not one this suite can lean on. Testcontainers + /// reports the host a caller can actually reach it at, so running these tests directly yields + /// localhost and passes, while running them inside a container yields the bridge gateway + /// 172.17.0.1 and is refused. + /// + /// + /// That refusal is the product being correct. 172.17.0.1 is genuinely not loopback, and a client + /// that quietly accepted plaintext metadata from a routable address would be a real weakness for + /// everybody who is not a test. So the exemption is claimed here, by the one caller that knows it + /// started the provider itself and that it lives for the length of one test, and the rule stays + /// exactly as strict for everyone else. + /// + /// + private Task SignInToTheStackAsync(ScriptedBrowser browser) => + ServerConnection.SignInAsync( + stack.ApiBaseUrl, + browser, + TimeProvider.System, + Token, + configureOidc: options => options with { RequireHttpsMetadata = false }); + /// /// The user typed one server URL. Everything about the identity provider — the authority, the client /// id, the scopes — came back from the server, which is the whole onboarding story.