Passkeys: IP-literal RP test where only that rule can refuse

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Heimdall 2026-11-13 22:34:13 +00:00
commit 73f97ed160

View file

@ -951,10 +951,11 @@ public sealed class PasskeyTests
Assert.False(party.IsAvailable);
Assert.False(loud.IsAvailable);
foreach (var literal in new[] { "[::1]", "::1", "127.0.0.1" })
foreach (var (publicBase, literal) in new[] { ("https://[::1]", "[::1]"), ("https://[::1]", "::1"), ("https://127.0.0.1", "127.0.0.1") })
{
// The public URL and the expected host agree, so only the IP-literal rule can refuse them.
Assert.False(new PasskeyRelyingParty(
Microsoft.Extensions.Options.Options.Create(new Bifrost.Web.Configuration.BifrostHostOptions { PublicBaseUrl = "https://localhost", ExpectedHost = literal }),
Microsoft.Extensions.Options.Options.Create(new Bifrost.Web.Configuration.BifrostHostOptions { PublicBaseUrl = publicBase, ExpectedHost = literal }),
new Microsoft.Extensions.Logging.Abstractions.NullLogger<PasskeyRelyingParty>()).IsAvailable);
}