Bundle: redb-route / tests/redb.Route.Tests.Ldap (tests.redb.Route.Tests.Ldap.txt), 14 files Snapshot: development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Index: https://redbase.app/src/dev-2026-12-06/redb-route/_index.txt ==== Path: redb-route/tests/redb.Route.Tests.Ldap/LdapBuilderTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapBuilderTests.cs ---- using redb.Route.Core; using redb.Route.Expressions; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapBuilderTests { // ── Factory methods ───────────────────────────────────────── [Theory] [InlineData("SEARCH")] [InlineData("COMPARE")] [InlineData("ADD")] [InlineData("MODIFY")] [InlineData("DELETE")] [InlineData("RENAME")] [InlineData("BIND")] [InlineData("WATCH")] public void Factory_StartsWithLdapScheme(string op) { var builder = op switch { "SEARCH" => LdapDsl.Search("dc=test"), "COMPARE" => LdapDsl.Compare("cn=alice,dc=test"), "ADD" => LdapDsl.Add("dc=test"), "MODIFY" => LdapDsl.Modify("cn=alice,dc=test"), "DELETE" => LdapDsl.Delete("cn=alice,dc=test"), "RENAME" => LdapDsl.Rename("cn=alice,dc=test"), "BIND" => LdapDsl.Bind("dc=test"), "WATCH" => LdapDsl.Watch("dc=test"), _ => throw new ArgumentException() }; builder.Build().Should().StartWith($"ldap:{op}:"); } // ── Connection params ─────────────────────────────────────── [Fact] public void Server_SetsParam() { var uri = LdapDsl.Search("dc=test").Server("dc.company.com").Build(); uri.Should().Contain("server=dc.company.com"); } [Fact] public void Port_SetsParam() { var uri = LdapDsl.Search("dc=test").Port(636).Build(); uri.Should().Contain("port=636"); } [Fact] public void Ssl_SetsParam() { var uri = LdapDsl.Search("dc=test").Ssl().Build(); uri.Should().Contain("ssl=true"); } [Fact] public void StartTls_SetsParam() { var uri = LdapDsl.Search("dc=test").StartTls().Build(); uri.Should().Contain("startTls=true"); } [Fact] public void ConnectionFactory_SetsParam() { var uri = LdapDsl.Search("dc=test").ConnectionFactory("myLdap").Build(); uri.Should().Contain("connectionFactory=myLdap"); } [Fact] public void ConnectTimeout_SetsParam() { var uri = LdapDsl.Search("dc=test").ConnectTimeout(3000).Build(); uri.Should().Contain("connectTimeout=3000"); } [Fact] public void OperationTimeout_SetsParam() { var uri = LdapDsl.Search("dc=test").OperationTimeout(10000).Build(); uri.Should().Contain("operationTimeout=10000"); } // ── Auth params ───────────────────────────────────────────── [Fact] public void BindDn_SetsParam() { var uri = LdapDsl.Search("dc=test").BindDn("cn=admin,dc=test").Build(); uri.Should().Contain("bindDn="); } [Fact] public void BindPassword_SetsParam() { var uri = LdapDsl.Search("dc=test").BindPassword("secret").Build(); uri.Should().Contain("bindPassword=secret"); } // ── Search params ─────────────────────────────────────────── [Fact] public void Filter_SetsParam() { var uri = LdapDsl.Search("dc=test").Filter("(objectClass=user)").Build(); uri.Should().Contain("filter="); } [Fact] public void Scope_SetsParam() { var uri = LdapDsl.Search("dc=test").Scope(LdapSearchScope.OneLevel).Build(); uri.Should().Contain("scope=onelevel"); } [Fact] public void Attributes_SetsParam() { var uri = LdapDsl.Search("dc=test").Attributes("cn", "mail", "uid").Build(); uri.Should().Contain("attributes="); uri.Should().Contain("cn"); } [Fact] public void PageSize_SetsParam() { var uri = LdapDsl.Search("dc=test").PageSize(100).Build(); uri.Should().Contain("pageSize=100"); } [Fact] public void SizeLimit_SetsParam() { var uri = LdapDsl.Search("dc=test").SizeLimit(1000).Build(); uri.Should().Contain("sizeLimit=1000"); } [Fact] public void TimeLimit_SetsParam() { var uri = LdapDsl.Search("dc=test").TimeLimit(30).Build(); uri.Should().Contain("timeLimit=30"); } // ── Consumer params ───────────────────────────────────────── [Fact] public void PollInterval_SetsParam() { var uri = LdapDsl.Watch("dc=test").PollInterval(30000).Build(); uri.Should().Contain("pollInterval=30000"); } [Fact] public void ChangeTracking_SetsParam() { var uri = LdapDsl.Watch("dc=test").ChangeTracking(LdapChangeTrackingMode.Usn).Build(); uri.Should().Contain("changeTrackingMode=usn"); } [Fact] public void InitialLoad_SetsParam() { var uri = LdapDsl.Watch("dc=test").InitialLoad().Build(); uri.Should().Contain("initialLoad=true"); } [Fact] public void DetectDeletions_SetsParam() { var uri = LdapDsl.Watch("dc=test").DetectDeletions().Build(); uri.Should().Contain("detectDeletions=true"); } [Fact] public void FullSyncInterval_SetsParam() { var uri = LdapDsl.Watch("dc=test").FullSyncInterval(20).Build(); uri.Should().Contain("fullSyncInterval=20"); } // ── Protocol params ───────────────────────────────────────── [Fact] public void ProtocolVersion_SetsParam() { var uri = LdapDsl.Search("dc=test").ProtocolVersion(2).Build(); uri.Should().Contain("protocolVersion=2"); } [Fact] public void Referrals_SetsParam() { var uri = LdapDsl.Search("dc=test").Referrals(false).Build(); uri.Should().Contain("followReferrals=false"); } // ── Pool params ───────────────────────────────────────────── [Fact] public void MaxConnections_SetsParam() { var uri = LdapDsl.Search("dc=test").MaxConnections(5).Build(); uri.Should().Contain("maxConnections=5"); } // ── SSL params ────────────────────────────────────────────── [Fact] public void SkipCertificateValidation_SetsParam() { var uri = LdapDsl.Search("dc=test").TrustAllCertificates().Build(); uri.Should().Contain("trustAllCertificates=true"); } [Fact] public void ClientCert_SetsParams() { var uri = LdapDsl.Search("dc=test").ClientCert("/path/to/cert.pfx", "certpass").Build(); uri.Should().Contain("clientCertPath="); uri.Should().Contain("clientCertPassword=certpass"); } // ── Conversion ────────────────────────────────────────────── [Fact] public void ImplicitConversion_ReturnsUri() { string uri = LdapDsl.Search("dc=test").Server("host").Ssl(); uri.Should().StartWith("ldap:SEARCH:dc=test?"); } [Fact] public void ToString_ReturnsSameAsBuild() { var builder = LdapDsl.Search("dc=test").Server("host").Filter("(cn=*)"); builder.ToString().Should().Be(builder.Build()); } // ── Full chain ────────────────────────────────────────────── [Fact] public void FullChain_Search_BuildsCorrectUri() { var uri = LdapDsl.Search("dc=redb,dc=test") .Server("dc.company.com") .Port(636) .Ssl() .BindDn("cn=admin,dc=redb,dc=test") .BindPassword("secret") .Filter("(objectClass=inetOrgPerson)") .Scope(LdapSearchScope.Subtree) .Attributes("cn", "mail", "uid") .PageSize(100) .Build(); uri.Should().StartWith("ldap:SEARCH:dc=redb,dc=test?"); uri.Should().Contain("server=dc.company.com"); uri.Should().Contain("port=636"); uri.Should().Contain("ssl=true"); uri.Should().Contain("pageSize=100"); uri.Should().Contain("scope=subtree"); } [Fact] public void FullChain_Watch_BuildsCorrectUri() { var uri = LdapDsl.Watch("ou=users,dc=redb,dc=test") .Server("dc.company.com") .Ssl() .PollInterval(30000) .ChangeTracking(LdapChangeTrackingMode.Usn) .InitialLoad() .Build(); uri.Should().StartWith("ldap:WATCH:ou=users,dc=redb,dc=test?"); uri.Should().Contain("pollInterval=30000"); uri.Should().Contain("changeTrackingMode=usn"); uri.Should().Contain("initialLoad=true"); } // ── Round-trip ────────────────────────────────────────────── [Fact] public void RoundTrip_ParseAndReconstruct() { var original = LdapDsl.Search("dc=test").Server("host").PageSize(100).Build(); var parsed = EndpointUriParser.Parse(original); parsed.Scheme.Should().Be("ldap"); parsed.RawParameters["server"].Should().Be("host"); parsed.RawParameters["pageSize"].Should().Be("100"); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapComponentTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapComponentTests.cs ---- using redb.Route.Core; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapComponentTests { private readonly LdapComponent _sut = new(); [Fact] public void Scheme_ReturnsLdap() { _sut.Scheme.Should().Be("ldap"); } [Fact] public void CreateEndpoint_ValidSearchUri_ReturnsLdapEndpoint() { var uri = EndpointUriParser.Parse("ldap:SEARCH:dc=redb,dc=test?server=localhost&bindDn=cn=admin,dc=redb,dc=test&bindPassword=admin"); var endpoint = _sut.CreateEndpoint(uri); endpoint.Should().BeOfType(); var ldap = (LdapEndpoint)endpoint; ldap.OperationType.Should().Be(LdapOperationType.SEARCH); ldap.BaseDn.Should().Be("dc=redb,dc=test"); } [Fact] public void CreateEndpoint_NullUri_Throws() { var act = () => _sut.CreateEndpoint(null!); act.Should().Throw(); } [Fact] public void CreateEndpoint_WatchUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:WATCH:ou=users,dc=redb,dc=test?server=localhost&bindDn=cn=admin,dc=redb,dc=test&bindPassword=admin"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.WATCH); endpoint.BaseDn.Should().Be("ou=users,dc=redb,dc=test"); } [Fact] public void CreateEndpoint_AddUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:ADD:ou=users,dc=redb,dc=test?server=localhost"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.ADD); endpoint.BaseDn.Should().Be("ou=users,dc=redb,dc=test"); } [Fact] public void CreateEndpoint_ModifyUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:MODIFY:cn=alice,ou=users,dc=redb,dc=test?server=localhost"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.MODIFY); } [Fact] public void CreateEndpoint_DeleteUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:DELETE:cn=alice,ou=users,dc=redb,dc=test?server=localhost"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.DELETE); } [Fact] public void CreateEndpoint_CompareUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:COMPARE:cn=alice,ou=users,dc=redb,dc=test?server=localhost"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.COMPARE); } [Fact] public void CreateEndpoint_RenameUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:RENAME:cn=alice,ou=users,dc=redb,dc=test?server=localhost"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.RENAME); } [Fact] public void CreateEndpoint_BindUri_ParsesCorrectly() { var uri = EndpointUriParser.Parse("ldap:BIND:dc=redb,dc=test?server=localhost"); var endpoint = (LdapEndpoint)_sut.CreateEndpoint(uri); endpoint.OperationType.Should().Be(LdapOperationType.BIND); } [Fact] public void CreateEndpoint_InvalidPort_Throws() { var uri = EndpointUriParser.Parse("ldap:SEARCH:dc=redb,dc=test?server=localhost&port=0"); var act = () => _sut.CreateEndpoint(uri); act.Should().Throw(); } [Fact] public void CreateEndpoint_NegativePageSize_Throws() { // PageSize == 0 is allowed (disables paged results); only negative values are invalid. var uri = EndpointUriParser.Parse("ldap:SEARCH:dc=redb,dc=test?server=localhost&pageSize=-1"); var act = () => _sut.CreateEndpoint(uri); act.Should().Throw(); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapConnectionFactoryTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapConnectionFactoryTests.cs ---- using redb.Route.Core; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; /// /// The named-connection-factory path: service credentials live in the registry, not in the /// endpoint URI, so they can never reach logs, telemetry, or the dashboard. /// public sealed class LdapConnectionFactoryTests { private static LdapComponent Wire(string name, LdapConnectionFactory factory) { var context = new RouteContext(); var component = new LdapComponent(); context.AddComponent(component); context.AddToRegistry(name, factory); return component; } [Fact] public void Factory_SuppliesCredentials_WhenUriCarriesNone() { var component = Wire("honest-ldap", new LdapConnectionFactory { Server = "ldap.corp.local", Port = 636, Ssl = true, BindDn = "cn=svc-reader,dc=corp,dc=local", BindPassword = "s3cr3tSvcPw", MaxConnections = 4 }); var uri = EndpointUriParser.Parse("ldap:SEARCH:dc=corp,dc=local?connectionFactory=honest-ldap"); var endpoint = (LdapEndpoint)component.CreateEndpoint(uri); endpoint.ResolvedFactory.Should().NotBeNull(); endpoint.EndpointOptions.Server.Should().Be("ldap.corp.local"); endpoint.EndpointOptions.Port.Should().Be(636); endpoint.EndpointOptions.Ssl.Should().BeTrue(); endpoint.EndpointOptions.BindDn.Should().Be("cn=svc-reader,dc=corp,dc=local"); endpoint.EndpointOptions.BindPassword.Should().Be("s3cr3tSvcPw"); endpoint.EndpointOptions.MaxConnections.Should().Be(4); // The whole point: the secret exists nowhere in the URI, masked or not. uri.ToUriString().Should().NotContain("s3cr3tSvcPw"); uri.ToString().Should().NotContain("s3cr3tSvcPw"); } [Fact] public void ExplicitUriValue_WinsOverFactory() { var component = Wire("f", new LdapConnectionFactory { Server = "from-factory", BindDn = "cn=factory", Port = 636 }); var uri = EndpointUriParser.Parse( "ldap:SEARCH:dc=corp?connectionFactory=f&server=from-uri&bindDn=cn=uri"); var endpoint = (LdapEndpoint)component.CreateEndpoint(uri); endpoint.EndpointOptions.Server.Should().Be("from-uri"); endpoint.EndpointOptions.BindDn.Should().Be("cn=uri"); // untouched by the URI → still comes from the factory endpoint.EndpointOptions.Port.Should().Be(636); } [Fact] public void MissingFactory_FailsLoud() { var context = new RouteContext(); var component = new LdapComponent(); context.AddComponent(component); var uri = EndpointUriParser.Parse("ldap:SEARCH:dc=corp?connectionFactory=absent&server=direct"); var act = () => component.CreateEndpoint(uri); // A typo in connectionFactory must fail loud, not fall back silently act.Should().Throw() .Which.Message.Should().Contain("absent"); } [Fact] public void NoFactoryConfigured_LeavesUriOptionsUntouched() { // Component without a Context at all — the factory branch must be skipped safely. var component = new LdapComponent(); var uri = EndpointUriParser.Parse("ldap:SEARCH:dc=corp?server=plain&bindDn=cn=x&bindPassword=p"); var endpoint = (LdapEndpoint)component.CreateEndpoint(uri); endpoint.ResolvedFactory.Should().BeNull(); endpoint.EndpointOptions.Server.Should().Be("plain"); endpoint.EndpointOptions.BindDn.Should().Be("cn=x"); endpoint.EndpointOptions.BindPassword.Should().Be("p"); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapConsumerTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapConsumerTests.cs ---- using redb.Route.Abstractions; using redb.Route.Core; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapConsumerTests { private readonly LdapComponent _component = new(); private LdapEndpoint CreateEndpoint(string uriStr) { var uri = EndpointUriParser.Parse(uriStr); return (LdapEndpoint)_component.CreateEndpoint(uri); } [Fact] public void Ctor_NullEndpoint_Throws() { var opts = new LdapEndpointOptions(); var proc = Substitute.For(); var act = () => new LdapConsumer(null!, proc, opts); act.Should().Throw(); } [Fact] public void Ctor_NullProcessor_Throws() { var ep = CreateEndpoint("ldap:WATCH:dc=redb,dc=test?server=localhost"); var opts = new LdapEndpointOptions(); var act = () => new LdapConsumer(ep, null!, opts); act.Should().Throw(); } [Fact] public void Ctor_NullOptions_Throws() { var ep = CreateEndpoint("ldap:WATCH:dc=redb,dc=test?server=localhost"); var proc = Substitute.For(); var act = () => new LdapConsumer(ep, proc, null!); act.Should().Throw(); } [Fact] public void ProcessedCount_InitiallyZero() { var ep = CreateEndpoint("ldap:WATCH:dc=redb,dc=test?server=localhost"); var proc = Substitute.For(); var opts = new LdapEndpointOptions(); var consumer = new LdapConsumer(ep, proc, opts); consumer.ProcessedCount.Should().Be(0); } [Fact] public async Task Stop_BeforeStart_DoesNotThrow() { var ep = CreateEndpoint("ldap:WATCH:dc=redb,dc=test?server=localhost"); var proc = Substitute.For(); var opts = new LdapEndpointOptions(); var consumer = new LdapConsumer(ep, proc, opts); var act = () => consumer.Stop(); await act.Should().NotThrowAsync(); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapEndpointOptionsTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapEndpointOptionsTests.cs ---- using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapEndpointOptionsTests { [Fact] public void Defaults_AreReasonable() { var opts = new LdapEndpointOptions(); opts.Server.Should().Be("localhost"); opts.Port.Should().Be(389); opts.Ssl.Should().BeFalse(); opts.StartTls.Should().BeFalse(); opts.ConnectionFactory.Should().BeNull(); opts.ConnectTimeout.Should().Be(5000); opts.OperationTimeout.Should().Be(30000); opts.BindDn.Should().BeNull(); opts.BindPassword.Should().BeNull(); opts.Filter.Should().BeNull(); opts.Scope.Should().Be("subtree"); opts.Attributes.Should().BeNull(); opts.PageSize.Should().Be(500); opts.SizeLimit.Should().Be(0); opts.TimeLimit.Should().Be(0); opts.PollInterval.Should().Be(60000); opts.ChangeTrackingMode.Should().Be("modifyTimestamp"); opts.InitialLoad.Should().BeFalse(); opts.DetectDeletions.Should().BeFalse(); opts.FullSyncInterval.Should().Be(10); opts.ProtocolVersion.Should().Be(3); opts.FollowReferrals.Should().BeTrue(); opts.MaxConnections.Should().Be(10); opts.TrustAllCertificates.Should().BeFalse(); opts.ClientCertPath.Should().BeNull(); opts.ClientCertPassword.Should().BeNull(); } // ── Validate ── [Fact] public void Validate_ValidOptions_DoesNotThrow() { var opts = new LdapEndpointOptions(); var act = () => opts.Validate(); act.Should().NotThrow(); } [Fact] public void Validate_EmptyServer_Throws() { var opts = new LdapEndpointOptions { Server = "" }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*server*"); } [Fact] public void Validate_WhitespaceServer_Throws() { var opts = new LdapEndpointOptions { Server = " " }; var act = () => opts.Validate(); act.Should().Throw(); } [Fact] public void Validate_ZeroPort_Throws() { var opts = new LdapEndpointOptions { Port = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*Port*"); } [Fact] public void Validate_NegativePort_Throws() { var opts = new LdapEndpointOptions { Port = -1 }; var act = () => opts.Validate(); act.Should().Throw(); } [Fact] public void Validate_PortTooHigh_Throws() { var opts = new LdapEndpointOptions { Port = 70000 }; var act = () => opts.Validate(); act.Should().Throw(); } [Fact] public void Validate_ZeroPageSize_IsAllowed() { // PageSize == 0 is a documented sentinel meaning "paged results disabled". var opts = new LdapEndpointOptions { PageSize = 0 }; var act = () => opts.Validate(); act.Should().NotThrow(); } [Fact] public void Validate_NegativePageSize_Throws() { var opts = new LdapEndpointOptions { PageSize = -5 }; var act = () => opts.Validate(); act.Should().Throw(); } [Fact] public void Validate_ZeroMaxConnections_Throws() { var opts = new LdapEndpointOptions { MaxConnections = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*MaxConnections*"); } [Fact] public void Validate_ZeroConnectTimeout_Throws() { var opts = new LdapEndpointOptions { ConnectTimeout = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*ConnectTimeout*"); } [Fact] public void Validate_ZeroOperationTimeout_Throws() { var opts = new LdapEndpointOptions { OperationTimeout = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*OperationTimeout*"); } [Fact] public void Validate_ZeroPollInterval_Throws() { var opts = new LdapEndpointOptions { PollInterval = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*PollInterval*"); } [Fact] public void Validate_ZeroFullSyncInterval_Throws() { var opts = new LdapEndpointOptions { FullSyncInterval = 0 }; var act = () => opts.Validate(); act.Should().Throw().WithMessage("*FullSyncInterval*"); } // ── ParseScope ── [Theory] [InlineData("base", LdapSearchScope.Base)] [InlineData("onelevel", LdapSearchScope.OneLevel)] [InlineData("one", LdapSearchScope.OneLevel)] [InlineData("subtree", LdapSearchScope.Subtree)] [InlineData("sub", LdapSearchScope.Subtree)] [InlineData("SUBTREE", LdapSearchScope.Subtree)] [InlineData("unknown", LdapSearchScope.Subtree)] [InlineData(null, LdapSearchScope.Subtree)] public void ParseScope_ReturnsExpected(string? scope, LdapSearchScope expected) { var opts = new LdapEndpointOptions { Scope = scope! }; opts.ParseScope().Should().Be(expected); } // ── ParseAttributes ── [Fact] public void ParseAttributes_Null_ReturnsNull() { var opts = new LdapEndpointOptions { Attributes = null }; opts.ParseAttributes().Should().BeNull(); } [Fact] public void ParseAttributes_Empty_ReturnsNull() { var opts = new LdapEndpointOptions { Attributes = "" }; opts.ParseAttributes().Should().BeNull(); } [Fact] public void ParseAttributes_Csv_SplitsCorrectly() { var opts = new LdapEndpointOptions { Attributes = "cn, mail, sAMAccountName" }; opts.ParseAttributes().Should().BeEquivalentTo(new[] { "cn", "mail", "sAMAccountName" }); } // ── ParseChangeTrackingMode ── [Theory] [InlineData("modifyTimestamp", LdapChangeTrackingMode.ModifyTimestamp)] [InlineData("modifytimestamp", LdapChangeTrackingMode.ModifyTimestamp)] [InlineData("usn", LdapChangeTrackingMode.Usn)] [InlineData("persistent", LdapChangeTrackingMode.Persistent)] [InlineData("unknown", LdapChangeTrackingMode.ModifyTimestamp)] public void ParseChangeTrackingMode_ReturnsExpected(string mode, LdapChangeTrackingMode expected) { var opts = new LdapEndpointOptions { ChangeTrackingMode = mode }; opts.ParseChangeTrackingMode().Should().Be(expected); } // ── EffectivePort ── [Fact] public void EffectivePort_NonSsl_ReturnsPort() { var opts = new LdapEndpointOptions { Port = 389, Ssl = false }; opts.EffectivePort.Should().Be(389); } [Fact] public void EffectivePort_SslWithDefaultPort_Returns636() { var opts = new LdapEndpointOptions { Port = 389, Ssl = true }; opts.EffectivePort.Should().Be(636); } [Fact] public void EffectivePort_SslWithCustomPort_ReturnsCustomPort() { var opts = new LdapEndpointOptions { Port = 3636, Ssl = true }; opts.EffectivePort.Should().Be(3636); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapEndpointTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapEndpointTests.cs ---- using redb.Route.Abstractions; using redb.Route.Core; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapEndpointTests { private readonly LdapComponent _component = new(); private LdapEndpoint CreateEndpoint(string uriStr) { var uri = EndpointUriParser.Parse(uriStr); return (LdapEndpoint)_component.CreateEndpoint(uri); } [Fact] public void OperationType_ExtractedFromPath() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); ep.OperationType.Should().Be(LdapOperationType.SEARCH); } [Fact] public void BaseDn_ExtractedFromPath() { var ep = CreateEndpoint("ldap:SEARCH:ou=users,dc=redb,dc=test?server=localhost"); ep.BaseDn.Should().Be("ou=users,dc=redb,dc=test"); } [Fact] public void CreateProducer_ReturnsLdapProducer() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); ep.CreateProducer().Should().BeOfType(); } [Fact] public void CreateConsumer_Watch_ReturnsLdapConsumer() { var ep = CreateEndpoint("ldap:WATCH:dc=redb,dc=test?server=localhost"); var processor = Substitute.For(); ep.CreateConsumer(processor).Should().BeOfType(); } [Fact] public void CreateConsumer_NonWatch_Throws() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); var processor = Substitute.For(); var act = () => ep.CreateConsumer(processor); act.Should().Throw().WithMessage("*WATCH*"); } [Fact] public void Component_IsLdapComponent() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); ep.Component.Should().BeSameAs(_component); } [Fact] public void Dispose_CanBeCalledMultipleTimes() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); ep.Dispose(); var act = () => ep.Dispose(); act.Should().NotThrow(); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapEntryTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapEntryTests.cs ---- using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapEntryTests { [Fact] public void Defaults_AreEmpty() { var entry = new LdapEntry(); entry.Dn.Should().BeEmpty(); entry.Attributes.Should().BeEmpty(); entry.ChangeType.Should().BeNull(); } [Fact] public void GetString_ExistingAttribute_ReturnsValue() { var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["cn"] = "alice", ["mail"] = "alice@test.com" } }; entry.GetString("cn").Should().Be("alice"); entry.GetString("mail").Should().Be("alice@test.com"); } [Fact] public void GetString_MissingAttribute_ReturnsNull() { var entry = new LdapEntry { Dn = "cn=alice,dc=test" }; entry.GetString("nonexistent").Should().BeNull(); } [Fact] public void GetStringArray_MultiValuedAttribute_ReturnsArray() { var values = new[] { "group1", "group2", "group3" }; var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["memberOf"] = values } }; entry.GetStringArray("memberOf").Should().BeEquivalentTo(values); } [Fact] public void GetStringArray_SingleValuedAttribute_ReturnsNull() { var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["cn"] = "alice" } }; entry.GetStringArray("cn").Should().BeNull(); } [Fact] public void GetBytes_BinaryAttribute_ReturnsBytes() { var bytes = new byte[] { 0x01, 0x02, 0x03, 0xFF }; var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["objectGUID"] = bytes } }; entry.GetBytes("objectGUID").Should().BeEquivalentTo(bytes); } [Fact] public void GetBytes_NonBinaryAttribute_ReturnsNull() { var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["cn"] = "alice" } }; entry.GetBytes("cn").Should().BeNull(); } [Fact] public void GetBytes_MultiValuedBinary_ReturnsFirstElement() { var first = new byte[] { 0x01, 0x02 }; var second = new byte[] { 0x03, 0x04 }; var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["certs"] = new[] { first, second } } }; entry.GetBytes("certs").Should().BeEquivalentTo(first); } [Fact] public void GetBytesArray_MultiValuedBinary_ReturnsAll() { var first = new byte[] { 0x01, 0x02 }; var second = new byte[] { 0x03, 0x04 }; var multi = new[] { first, second }; var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["certs"] = multi } }; entry.GetBytesArray("certs").Should().HaveCount(2); } [Fact] public void GetBytesArray_SingleBinary_ReturnsNull() { var entry = new LdapEntry { Dn = "cn=alice,dc=test", Attributes = { ["objectGUID"] = new byte[] { 0x01 } } }; entry.GetBytesArray("objectGUID").Should().BeNull(); } [Fact] public void ChangeType_CanBeSet() { var entry = new LdapEntry { ChangeType = "modified" }; entry.ChangeType.Should().Be("modified"); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapHeadersTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapHeadersTests.cs ---- using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapHeadersTests { [Fact] public void Prefix_IsCorrect() { LdapHeaders.Prefix.Should().Be("redbLdap."); } [Theory] [InlineData(nameof(LdapHeaders.Dn), "redbLdap.Dn")] [InlineData(nameof(LdapHeaders.BaseDn), "redbLdap.BaseDn")] [InlineData(nameof(LdapHeaders.Filter), "redbLdap.Filter")] [InlineData(nameof(LdapHeaders.Timestamp), "redbLdap.Timestamp")] [InlineData(nameof(LdapHeaders.ResultCount), "redbLdap.ResultCount")] [InlineData(nameof(LdapHeaders.SearchTime), "redbLdap.SearchTime")] [InlineData(nameof(LdapHeaders.PageCookie), "redbLdap.PageCookie")] [InlineData(nameof(LdapHeaders.Server), "redbLdap.Server")] [InlineData(nameof(LdapHeaders.Port), "redbLdap.Port")] [InlineData(nameof(LdapHeaders.Ssl), "redbLdap.Ssl")] [InlineData(nameof(LdapHeaders.Scope), "redbLdap.Scope")] [InlineData(nameof(LdapHeaders.ModCount), "redbLdap.ModCount")] [InlineData(nameof(LdapHeaders.Deleted), "redbLdap.Deleted")] [InlineData(nameof(LdapHeaders.AuthDn), "redbLdap.AuthDn")] [InlineData(nameof(LdapHeaders.AuthPassword), "redbLdap.AuthPassword")] [InlineData(nameof(LdapHeaders.BindResult), "redbLdap.BindResult")] [InlineData(nameof(LdapHeaders.CompareAttribute), "redbLdap.CompareAttribute")] [InlineData(nameof(LdapHeaders.CompareValue), "redbLdap.CompareValue")] [InlineData(nameof(LdapHeaders.CompareResult), "redbLdap.CompareResult")] [InlineData(nameof(LdapHeaders.NewRdn), "redbLdap.NewRdn")] [InlineData(nameof(LdapHeaders.NewParentDn), "redbLdap.NewParentDn")] [InlineData(nameof(LdapHeaders.OldDn), "redbLdap.OldDn")] [InlineData(nameof(LdapHeaders.NewDn), "redbLdap.NewDn")] [InlineData(nameof(LdapHeaders.ChangeType), "redbLdap.ChangeType")] [InlineData(nameof(LdapHeaders.ChangeMarker), "redbLdap.ChangeMarker")] public void Headers_HaveCorrectPrefix(string fieldName, string expected) { var value = typeof(LdapHeaders).GetField(fieldName)!.GetValue(null) as string; value.Should().Be(expected); value.Should().StartWith(LdapHeaders.Prefix); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapIntegrationTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapIntegrationTests.cs ---- using redb.Route.Abstractions; using redb.Route.Core; using redb.Route.Ldap; using Xunit.Abstractions; namespace redb.Route.Tests.Ldap; /// /// Integration tests for the LDAP connector against a real OpenLDAP instance. /// Expects OpenLDAP at localhost:389 with seed data from docker-compose. /// /// Admin DN: cn=admin,dc=redb,dc=test /// Password: admin /// Test data: 5 users in ou=users, 2 groups in ou=groups /// /// [Trait("Category", "Integration")] public sealed class LdapIntegrationTests { private const string Server = "localhost"; private const int Port = 389; private const string BindDn = "cn=admin,dc=redb,dc=test"; private const string BindPassword = "admin"; private const string BaseDn = "dc=redb,dc=test"; private const string UsersDn = "ou=users,dc=redb,dc=test"; private const string GroupsDn = "ou=groups,dc=redb,dc=test"; private readonly ITestOutputHelper _output; private readonly LdapComponent _component = new(); public LdapIntegrationTests(ITestOutputHelper output) { _output = output; } private LdapEndpoint CreateEndpoint(string uriStr) { var uri = EndpointUriParser.Parse(uriStr); return (LdapEndpoint)_component.CreateEndpoint(uri); } private string BuildSearchUri(string baseDn, string? filter = null, string? scope = null, string? attributes = null) { var uri = $"ldap:SEARCH:{baseDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; if (filter != null) uri += $"&filter={Uri.EscapeDataString(filter)}"; if (scope != null) uri += $"&scope={scope}"; if (attributes != null) uri += $"&attributes={attributes}"; return uri; } // ═══════════════════════════════════════════════════════════════ // Connection // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Connect_ValidCredentials_Succeeds() { using var ep = CreateEndpoint(BuildSearchUri(BaseDn, "(objectClass=*)")); var producer = (LdapProducer)ep.CreateProducer(); await producer.Start(); await producer.Stop(); _output.WriteLine("Successfully connected and disconnected from LDAP"); } // ═══════════════════════════════════════════════════════════════ // Search — Subtree // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_Subtree_AllUsers_Returns5() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(objectClass=inetOrgPerson)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(5); var dns = results.Select(e => e.Dn).ToList(); dns.Should().Contain(dn => dn.Contains("alice")); dns.Should().Contain(dn => dn.Contains("bob")); dns.Should().Contain(dn => dn.Contains("charlie")); dns.Should().Contain(dn => dn.Contains("diana")); dns.Should().Contain(dn => dn.Contains("eve")); _output.WriteLine($"Found {results.Count} users:"); foreach (var entry in results) _output.WriteLine($" {entry.Dn} — mail={entry.GetString("mail")}"); } [Fact] public async Task Search_Subtree_Groups_Returns2() { using var ep = CreateEndpoint(BuildSearchUri(GroupsDn, "(objectClass=groupOfNames)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(2); var cns = results.Select(e => e.GetString("cn")).ToList(); cns.Should().Contain("developers"); cns.Should().Contain("admins"); _output.WriteLine($"Found {results.Count} groups: {string.Join(", ", cns)}"); } // ═══════════════════════════════════════════════════════════════ // Search — Scope: OneLevel // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_OneLevel_BaseDn_ReturnsOUs() { using var ep = CreateEndpoint(BuildSearchUri(BaseDn, "(objectClass=organizationalUnit)", "onelevel")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(2); _output.WriteLine($"Found {results.Count} OUs at one level: {string.Join(", ", results.Select(e => e.Dn))}"); } // ═══════════════════════════════════════════════════════════════ // Search — Scope: Base // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_Base_SpecificUser_ReturnsSingleEntry() { var aliceDn = "cn=alice,ou=users,dc=redb,dc=test"; using var ep = CreateEndpoint(BuildSearchUri(aliceDn, "(objectClass=*)", "base")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(1); results[0].Dn.Should().Contain("alice"); results[0].GetString("mail").Should().Be("alice@redb.test"); _output.WriteLine($"Base search returned: {results[0].Dn}"); } // ═══════════════════════════════════════════════════════════════ // Search — Attribute filtering // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_SpecificAttributes_ReturnsOnlyRequested() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(cn=alice)", "subtree", "cn,mail")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(1); var alice = results[0]; alice.GetString("cn").Should().Be("alice"); alice.GetString("mail").Should().Be("alice@redb.test"); // sn was not requested — should not be present alice.GetString("sn").Should().BeNull(); _output.WriteLine($"Filtered attributes: cn={alice.GetString("cn")}, mail={alice.GetString("mail")}"); } // ═══════════════════════════════════════════════════════════════ // Search — LDAP filter // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_FilterByMail_ReturnsMatchingEntries() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(mail=bob@redb.test)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(1); results[0].GetString("cn").Should().Be("bob"); _output.WriteLine($"Filter by mail found: {results[0].Dn}"); } [Fact] public async Task Search_FilterByWildcard_ReturnsMultiple() { // Users with "a" in cn: alice, charlie, diana using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(cn=*a*)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().BeGreaterThanOrEqualTo(2); _output.WriteLine($"Wildcard filter (cn=*a*) found {results.Count} entries"); } [Fact] public async Task Search_NoMatches_ReturnsEmptyList() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(cn=nonexistent_user_12345)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(0); _output.WriteLine("Empty result set — correct"); } // ═══════════════════════════════════════════════════════════════ // Exchange headers // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_SetsExchangeHeaders() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(objectClass=inetOrgPerson)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); exchange.In.Headers.Should().ContainKey(LdapHeaders.ResultCount); exchange.In.Headers.Should().ContainKey(LdapHeaders.SearchTime); exchange.In.Headers.Should().ContainKey(LdapHeaders.BaseDn); exchange.In.Headers.Should().ContainKey(LdapHeaders.Filter); var resultCount = (int)exchange.In.Headers[LdapHeaders.ResultCount]; resultCount.Should().Be(5); var searchTime = (long)exchange.In.Headers[LdapHeaders.SearchTime]; searchTime.Should().BeGreaterThanOrEqualTo(0); _output.WriteLine($"ResultCount={resultCount}, SearchTime={searchTime}ms"); } // ═══════════════════════════════════════════════════════════════ // Connection pool // ═══════════════════════════════════════════════════════════════ [Fact] public async Task ConnectionPool_MultipleSearches_ReuseConnections() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(objectClass=inetOrgPerson)", "subtree") + "&maxConnections=2"); var producer = (LdapProducer)ep.CreateProducer(); await producer.Start(); // Run 5 sequential searches — should reuse pooled connections for (var i = 0; i < 5; i++) { var exchange = new Exchange(new Message($"search-{i}")); await producer.Process(exchange); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(5); } await producer.Stop(); _output.WriteLine("5 sequential searches completed successfully with connection pool"); } // ═══════════════════════════════════════════════════════════════ // Consumer (WATCH) — ModifyTimestamp // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Watch_InitialLoad_DeliversAllEntries() { var watchUri = $"ldap:WATCH:{UsersDn}?server={Server}&port={Port}" + $"&bindDn={BindDn}&bindPassword={BindPassword}" + $"&filter=(objectClass=inetOrgPerson)&initialLoad=true&pollInterval=1000"; using var ep = CreateEndpoint(watchUri); var received = new List(); var tcs = new TaskCompletionSource(); var processor = Substitute.For(); processor.Process(Arg.Any(), Arg.Any()) .Returns(callInfo => { var ex = callInfo.Arg(); if (ex.In.Body is LdapEntry entry) { lock (received) received.Add(entry); _output.WriteLine($" Received: {entry.Dn} ({entry.ChangeType})"); if (received.Count >= 5) tcs.TrySetResult(true); } return Task.CompletedTask; }); var consumer = (LdapConsumer)ep.CreateConsumer(processor); await consumer.Start(); // Wait for initial load to deliver all 5 users (or timeout) var completed = await Task.WhenAny(tcs.Task, Task.Delay(15_000)); await consumer.Stop(); completed.Should().Be(tcs.Task, "all 5 users should be delivered within 15s"); received.Count.Should().BeGreaterThanOrEqualTo(5); _output.WriteLine($"Watch delivered {received.Count} entries on initial load"); } // ═══════════════════════════════════════════════════════════════ // DSL → Producer round-trip // ═══════════════════════════════════════════════════════════════ [Fact] public async Task DslSearch_EndToEnd_Works() { string uri = LdapDsl.Search(UsersDn) .Server(Server) .Port(Port) .BindDn(BindDn) .BindPassword(BindPassword) .Filter("(objectClass=inetOrgPerson)") .Scope(LdapSearchScope.Subtree) .Attributes("cn", "mail") .PageSize(100); using var ep = CreateEndpoint(uri); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("dsl-search")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); var results = exchange.In.Body as List; results.Should().NotBeNull(); results!.Count.Should().Be(5); _output.WriteLine($"DSL round-trip search returned {results.Count} entries"); } // ═══════════════════════════════════════════════════════════════ // Search — Server/Port/Ssl/Scope headers // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Search_SetsServerPortSslScopeHeaders() { using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(objectClass=inetOrgPerson)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("headers-check")); await producer.Start(); await producer.Process(exchange); await producer.Stop(); exchange.In.Headers.Should().ContainKey(LdapHeaders.Server); exchange.In.Headers.Should().ContainKey(LdapHeaders.Port); exchange.In.Headers.Should().ContainKey(LdapHeaders.Ssl); exchange.In.Headers.Should().ContainKey(LdapHeaders.Scope); exchange.In.Headers[LdapHeaders.Server].Should().Be(Server); ((int)exchange.In.Headers[LdapHeaders.Port]).Should().Be(Port); ((bool)exchange.In.Headers[LdapHeaders.Ssl]).Should().BeFalse(); _output.WriteLine($"Server={exchange.In.Headers[LdapHeaders.Server]}, " + $"Port={exchange.In.Headers[LdapHeaders.Port]}, " + $"Ssl={exchange.In.Headers[LdapHeaders.Ssl]}, " + $"Scope={exchange.In.Headers[LdapHeaders.Scope]}"); } // ═══════════════════════════════════════════════════════════════ // BIND — User authentication // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Bind_ValidCredentials_ReturnsTrue() { var bindUri = $"ldap:BIND:{BaseDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var ep = CreateEndpoint(bindUri); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("bind")); exchange.In.Headers[LdapHeaders.AuthDn] = "cn=alice,ou=users,dc=redb,dc=test"; exchange.In.Headers[LdapHeaders.AuthPassword] = "alice123"; await producer.Start(); await producer.Process(exchange); await producer.Stop(); ((bool)exchange.In.Body).Should().BeTrue(); ((int)exchange.In.Headers[LdapHeaders.BindResult]).Should().Be(0); // Password must be cleared from headers exchange.In.Headers.Should().NotContainKey(LdapHeaders.AuthPassword); _output.WriteLine("BIND alice with correct password → success"); } [Fact] public async Task Bind_WrongPassword_ReturnsFalse() { var bindUri = $"ldap:BIND:{BaseDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var ep = CreateEndpoint(bindUri); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("bind")); exchange.In.Headers[LdapHeaders.AuthDn] = "cn=alice,ou=users,dc=redb,dc=test"; exchange.In.Headers[LdapHeaders.AuthPassword] = "wrong_password"; await producer.Start(); await producer.Process(exchange); await producer.Stop(); ((bool)exchange.In.Body).Should().BeFalse(); ((int)exchange.In.Headers[LdapHeaders.BindResult]).Should().NotBe(0); exchange.In.Headers.Should().NotContainKey(LdapHeaders.AuthPassword); _output.WriteLine($"BIND alice with wrong password → failed, code={exchange.In.Headers[LdapHeaders.BindResult]}"); } [Fact] public async Task Bind_InvalidDn_ReturnsFalse() { var bindUri = $"ldap:BIND:{BaseDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var ep = CreateEndpoint(bindUri); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("bind")); exchange.In.Headers[LdapHeaders.AuthDn] = "cn=nonexistent,dc=redb,dc=test"; exchange.In.Headers[LdapHeaders.AuthPassword] = "whatever"; await producer.Start(); await producer.Process(exchange); await producer.Stop(); ((bool)exchange.In.Body).Should().BeFalse(); exchange.In.Headers.Should().NotContainKey(LdapHeaders.AuthPassword); _output.WriteLine("BIND nonexistent user → failed as expected"); } // ═══════════════════════════════════════════════════════════════ // ADD + DELETE — Create and remove entries // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Add_Delete_RoundTrip() { var testDn = "cn=testuser,ou=users,dc=redb,dc=test"; // ADD var addUri = $"ldap:ADD:{UsersDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var addEp = CreateEndpoint(addUri); var addProducer = (LdapProducer)addEp.CreateProducer(); var addExchange = new Exchange(new Message("add")); addExchange.In.Headers[LdapHeaders.Dn] = testDn; addExchange.In.Body = new Dictionary { ["objectClass"] = new[] { "inetOrgPerson", "organizationalPerson", "person", "top" }, ["cn"] = "testuser", ["sn"] = "User", ["uid"] = "testuser", ["mail"] = "testuser@redb.test", ["userPassword"] = "test123" }; await addProducer.Start(); await addProducer.Process(addExchange); await addProducer.Stop(); ((string)addExchange.In.Body).Should().Be(testDn); _output.WriteLine($"ADD created: {testDn}"); // Verify via SEARCH using var searchEp = CreateEndpoint(BuildSearchUri(UsersDn, "(cn=testuser)", "subtree")); var searchProducer = (LdapProducer)searchEp.CreateProducer(); var searchExchange = new Exchange(new Message("verify-add")); await searchProducer.Start(); await searchProducer.Process(searchExchange); await searchProducer.Stop(); var found = searchExchange.In.Body as List; found.Should().NotBeNull(); found!.Count.Should().Be(1); found[0].GetString("mail").Should().Be("testuser@redb.test"); _output.WriteLine($"SEARCH verified: {found[0].Dn}"); // DELETE var deleteUri = $"ldap:DELETE:{testDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var deleteEp = CreateEndpoint(deleteUri); var deleteProducer = (LdapProducer)deleteEp.CreateProducer(); var deleteExchange = new Exchange(new Message("delete")); deleteExchange.In.Headers[LdapHeaders.Dn] = testDn; await deleteProducer.Start(); await deleteProducer.Process(deleteExchange); await deleteProducer.Stop(); ((string)deleteExchange.In.Body).Should().Be(testDn); ((bool)deleteExchange.In.Headers[LdapHeaders.Deleted]).Should().BeTrue(); _output.WriteLine($"DELETE removed: {testDn}"); // Verify deletion via SEARCH using var verifyEp = CreateEndpoint(BuildSearchUri(UsersDn, "(cn=testuser)", "subtree")); var verifyProducer = (LdapProducer)verifyEp.CreateProducer(); var verifyExchange = new Exchange(new Message("verify-delete")); await verifyProducer.Start(); await verifyProducer.Process(verifyExchange); await verifyProducer.Stop(); var after = verifyExchange.In.Body as List; after.Should().NotBeNull(); after!.Count.Should().Be(0); _output.WriteLine("Deletion verified — entry gone"); } // ═══════════════════════════════════════════════════════════════ // MODIFY — Change attributes // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Modify_ChangeAttribute_Succeeds() { var aliceDn = "cn=alice,ou=users,dc=redb,dc=test"; // MODIFY: set telephoneNumber var modifyUri = $"ldap:MODIFY:{aliceDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var modEp = CreateEndpoint(modifyUri); var modProducer = (LdapProducer)modEp.CreateProducer(); var modExchange = new Exchange(new Message("modify")); modExchange.In.Headers[LdapHeaders.Dn] = aliceDn; modExchange.In.Body = new Dictionary { ["telephoneNumber"] = "+7-999-123-4567" }; await modProducer.Start(); await modProducer.Process(modExchange); await modProducer.Stop(); ((string)modExchange.In.Body).Should().Be(aliceDn); ((int)modExchange.In.Headers[LdapHeaders.ModCount]).Should().Be(1); _output.WriteLine($"MODIFY set telephoneNumber on alice"); // Verify via SEARCH using var searchEp = CreateEndpoint(BuildSearchUri(aliceDn, "(objectClass=*)", "base", "telephoneNumber")); var searchProducer = (LdapProducer)searchEp.CreateProducer(); var searchExchange = new Exchange(new Message("verify-modify")); await searchProducer.Start(); await searchProducer.Process(searchExchange); await searchProducer.Stop(); var results = searchExchange.In.Body as List; results.Should().NotBeNull(); results![0].GetString("telephoneNumber").Should().Be("+7-999-123-4567"); _output.WriteLine($"Verified telephoneNumber={results[0].GetString("telephoneNumber")}"); // Restore: set back to original value using var restoreEp = CreateEndpoint(modifyUri); var restoreProducer = (LdapProducer)restoreEp.CreateProducer(); var restoreExchange = new Exchange(new Message("restore")); restoreExchange.In.Headers[LdapHeaders.Dn] = aliceDn; restoreExchange.In.Body = new Dictionary { ["telephoneNumber"] = "+1-555-0101" }; await restoreProducer.Start(); await restoreProducer.Process(restoreExchange); await restoreProducer.Stop(); _output.WriteLine("Restored alice telephoneNumber"); } // ═══════════════════════════════════════════════════════════════ // COMPARE — Attribute value comparison // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Compare_MatchingValue_ReturnsTrue() { var aliceDn = "cn=alice,ou=users,dc=redb,dc=test"; var compareUri = $"ldap:COMPARE:{aliceDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var ep = CreateEndpoint(compareUri); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("compare-match")); exchange.In.Headers[LdapHeaders.Dn] = aliceDn; exchange.In.Headers[LdapHeaders.CompareAttribute] = "mail"; exchange.In.Headers[LdapHeaders.CompareValue] = "alice@redb.test"; await producer.Start(); await producer.Process(exchange); await producer.Stop(); ((bool)exchange.In.Body).Should().BeTrue(); ((bool)exchange.In.Headers[LdapHeaders.CompareResult]).Should().BeTrue(); _output.WriteLine("COMPARE alice mail=alice@redb.test → true"); } [Fact] public async Task Compare_NonMatchingValue_ReturnsFalse() { var aliceDn = "cn=alice,ou=users,dc=redb,dc=test"; var compareUri = $"ldap:COMPARE:{aliceDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var ep = CreateEndpoint(compareUri); var producer = (LdapProducer)ep.CreateProducer(); var exchange = new Exchange(new Message("compare-no-match")); exchange.In.Headers[LdapHeaders.Dn] = aliceDn; exchange.In.Headers[LdapHeaders.CompareAttribute] = "mail"; exchange.In.Headers[LdapHeaders.CompareValue] = "wrong@redb.test"; await producer.Start(); await producer.Process(exchange); await producer.Stop(); ((bool)exchange.In.Body).Should().BeFalse(); ((bool)exchange.In.Headers[LdapHeaders.CompareResult]).Should().BeFalse(); _output.WriteLine("COMPARE alice mail=wrong@redb.test → false"); } // ═══════════════════════════════════════════════════════════════ // RENAME — Rename entry and move back // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Rename_ChangeRdn_Succeeds() { var originalDn = "cn=renametest,ou=users,dc=redb,dc=test"; var renamedDn = "cn=renametest-renamed,ou=users,dc=redb,dc=test"; // First create a temp entry var addUri = $"ldap:ADD:{UsersDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var addEp = CreateEndpoint(addUri); var addProducer = (LdapProducer)addEp.CreateProducer(); var addExchange = new Exchange(new Message("add-for-rename")); addExchange.In.Headers[LdapHeaders.Dn] = originalDn; addExchange.In.Body = new Dictionary { ["objectClass"] = new[] { "inetOrgPerson", "organizationalPerson", "person", "top" }, ["cn"] = "renametest", ["sn"] = "Test", ["uid"] = "renametest" }; await addProducer.Start(); await addProducer.Process(addExchange); await addProducer.Stop(); _output.WriteLine($"Created temp entry: {originalDn}"); // RENAME var renameUri = $"ldap:RENAME:{originalDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var renameEp = CreateEndpoint(renameUri); var renameProducer = (LdapProducer)renameEp.CreateProducer(); var renameExchange = new Exchange(new Message("rename")); renameExchange.In.Headers[LdapHeaders.Dn] = originalDn; renameExchange.In.Headers[LdapHeaders.NewRdn] = "cn=renametest-renamed"; await renameProducer.Start(); await renameProducer.Process(renameExchange); await renameProducer.Stop(); var newDn = (string)renameExchange.In.Body; newDn.Should().Be(renamedDn); ((string)renameExchange.In.Headers[LdapHeaders.OldDn]).Should().Be(originalDn); ((string)renameExchange.In.Headers[LdapHeaders.NewDn]).Should().Be(renamedDn); _output.WriteLine($"RENAME {originalDn} → {newDn}"); // Verify renamed entry exists using var searchEp = CreateEndpoint(BuildSearchUri(UsersDn, "(cn=renametest-renamed)", "subtree")); var searchProducer = (LdapProducer)searchEp.CreateProducer(); var searchExchange = new Exchange(new Message("verify-rename")); await searchProducer.Start(); await searchProducer.Process(searchExchange); await searchProducer.Stop(); var found = searchExchange.In.Body as List; found.Should().NotBeNull(); found!.Count.Should().Be(1); _output.WriteLine("Verified renamed entry exists"); // Cleanup: delete the renamed entry var deleteUri = $"ldap:DELETE:{renamedDn}?server={Server}&port={Port}&bindDn={BindDn}&bindPassword={BindPassword}"; using var deleteEp = CreateEndpoint(deleteUri); var deleteProducer = (LdapProducer)deleteEp.CreateProducer(); var deleteExchange = new Exchange(new Message("cleanup")); deleteExchange.In.Headers[LdapHeaders.Dn] = renamedDn; await deleteProducer.Start(); await deleteProducer.Process(deleteExchange); await deleteProducer.Stop(); _output.WriteLine("Cleanup: deleted renamed entry"); } // ═══════════════════════════════════════════════════════════════ // Statistics ownership (audit follow-up) // ═══════════════════════════════════════════════════════════════ [Fact] public async Task Statistics_AreOwnedByTheCore_NotSelfRecorded() { // Ownership audit: MessagesOut belongs to the core (ToProcessor for a routed .To(), // the ProducerTemplate for template sends) - self-recording per operation doubled // every routed number across all seven LDAP operations. using var ep = CreateEndpoint(BuildSearchUri(UsersDn, "(objectClass=inetOrgPerson)", "subtree")); var producer = (LdapProducer)ep.CreateProducer(); await producer.Start(); await producer.Process(new Exchange(new Message("search"))); await producer.Stop(); ep.MessagesOut.Should().Be(0, "MessagesOut is written by the core, the own write doubled it in the route"); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapOperationTypeTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapOperationTypeTests.cs ---- using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapOperationTypeTests { [Theory] [InlineData("SEARCH", LdapOperationType.SEARCH)] [InlineData("COMPARE", LdapOperationType.COMPARE)] [InlineData("ADD", LdapOperationType.ADD)] [InlineData("MODIFY", LdapOperationType.MODIFY)] [InlineData("DELETE", LdapOperationType.DELETE)] [InlineData("RENAME", LdapOperationType.RENAME)] [InlineData("BIND", LdapOperationType.BIND)] [InlineData("WATCH", LdapOperationType.WATCH)] public void AllOperationTypes_CanBeParsed(string name, LdapOperationType expected) { Enum.TryParse(name, ignoreCase: true, out var result).Should().BeTrue(); result.Should().Be(expected); } [Fact] public void TotalOperationCount_Is8() { Enum.GetValues().Length.Should().Be(8); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapProducerTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapProducerTests.cs ---- using redb.Route.Core; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; public sealed class LdapProducerTests { private readonly LdapComponent _component = new(); private LdapEndpoint CreateEndpoint(string uriStr) { var uri = EndpointUriParser.Parse(uriStr); return (LdapEndpoint)_component.CreateEndpoint(uri); } [Fact] public void Ctor_NullEndpoint_Throws() { var opts = new LdapEndpointOptions(); var act = () => new LdapProducer(null!, opts); act.Should().Throw(); } [Fact] public void Ctor_NullOptions_Throws() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); var act = () => new LdapProducer(ep, null!); act.Should().Throw(); } [Fact] public async Task Process_BeforeStart_Throws() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); var producer = new LdapProducer(ep, new LdapEndpointOptions()); var exchange = new Exchange(new Message("test")); var act = () => producer.Process(exchange); await act.Should().ThrowAsync().WithMessage("*not been started*"); } [Fact] public async Task Stop_BeforeStart_DoesNotThrow() { var ep = CreateEndpoint("ldap:SEARCH:dc=redb,dc=test?server=localhost"); var producer = new LdapProducer(ep, new LdapEndpointOptions()); var act = () => producer.Stop(); await act.Should().NotThrowAsync(); } } Path: redb-route/tests/redb.Route.Tests.Ldap/LdapTraceTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/LdapTraceTests.cs ---- using System.Diagnostics; using redb.Route.Abstractions; using redb.Route.Configuration; using redb.Route.Core; using redb.Route.Ldap; using redb.Route.Telemetry; using redb.Route.Tests.Telemetry; namespace redb.Route.Tests.Ldap; /// /// A directory entry carries no trace context: the WATCH consumer opens a root span per routed entry, never a child of /// the activity the poll loop inherited from whoever started it, and none for a poll that finds nothing. A failed /// route marks it red. The producer is a Client span, red when the operation fails. EnableTelemetry=false /// opens none of these spans. The tests only read the seeded ou=users entries; a marker in the requested /// attributes keeps each test's endpoint apart. Expects OpenLDAP at localhost:389 (cn=admin,dc=redb,dc=test / admin). /// [Trait("Category", "Integration")] public sealed class LdapTraceTests { private const string Connection = "server=localhost&port=389&bindDn=cn=admin,dc=redb,dc=test&bindPassword=admin"; private static readonly TimeSpan Wait = TimeSpan.FromSeconds(15); private readonly string _marker = $"trace{Guid.NewGuid():N}"; /// A WATCH endpoint; null takes every seeded user. private string WatchUri(string? filter = null) => $"ldap:WATCH:ou=users,dc=redb,dc=test?{Connection}" + $"&filter={filter ?? "(objectClass=inetOrgPerson)"}&attributes=cn,mail,{_marker}&initialLoad=true&pollInterval=300"; private RouteTelemetryProbe Spans(ActivityKind kind) => new(a => a.Kind == kind && RouteTelemetryProbe.Tag(a, RouteTelemetryProbe.EndpointTag)?.Contains(_marker, StringComparison.Ordinal) == true); private async Task StartConsumer(Action step, string? filter = null, bool telemetry = true) { var ctx = new RouteContext(options: new RouteEngineOptions { EnableTelemetry = telemetry }); ctx.AddComponent(new LdapComponent()); ctx.AddRoutes(r => r.From(WatchUri(filter)).Process(step)); using (new Activity("host startup").SetIdFormat(ActivityIdFormat.W3C).Start()) await ctx.Start(); return ctx; } private static async Task Until(Func done) { var deadline = DateTime.UtcNow + Wait; while (!done() && DateTime.UtcNow < deadline) await Task.Delay(100); } [Fact] public async Task Each_entry_opens_a_root_span_even_under_an_ambient_activity() { using var probe = Spans(ActivityKind.Consumer); await using (await StartConsumer(_ => { })) await Until(() => probe.Activities.Count >= 5); probe.Activities.Should().HaveCountGreaterThanOrEqualTo(5, "one span per routed entry of the initial load"); probe.Activities.Should().OnlyContain(a => a.ParentSpanId == default(ActivitySpanId), "an entry carries no context, so its span starts a trace rather than joining the host's"); } [Fact] public async Task A_poll_that_finds_nothing_opens_no_span() { using var probe = Spans(ActivityKind.Consumer); // A filter nothing matches: every poll, the initial load included, comes back empty. await using (await StartConsumer(_ => { }, filter: $"(cn={_marker})")) await Task.Delay(1500); probe.Activities.Should().BeEmpty(); } [Fact] public async Task A_failed_route_marks_the_span_red() { using var probe = Spans(ActivityKind.Consumer); await using (await StartConsumer(_ => throw new InvalidOperationException("route failed"))) await Until(() => probe.Activities.Count >= 1); probe.Activities.Should().NotBeEmpty().And.OnlyContain(a => a.Status == ActivityStatusCode.Error); } [Fact] public async Task Tracing_off_opens_no_span() { using var probe = new RouteTelemetryProbe(a => RouteTelemetryProbe.Tag(a, RouteTelemetryProbe.EndpointTag)?.Contains(_marker, StringComparison.Ordinal) == true); var routed = new TaskCompletionSource(); await using (await StartConsumer(_ => routed.TrySetResult(), telemetry: false)) (await Task.WhenAny(routed.Task, Task.Delay(Wait))).Should().Be(routed.Task); probe.Activities.Should().BeEmpty(); } [Theory] [InlineData(true)] [InlineData(false)] public async Task A_failed_operation_marks_the_client_span_red_and_tracing_off_opens_none(bool telemetry) { using var probe = Spans(ActivityKind.Client); await using var ctx = new RouteContext(options: new RouteEngineOptions { EnableTelemetry = telemetry }); ctx.AddComponent(new LdapComponent()); await ctx.Start(); using var template = new ProducerTemplate(ctx); template.Start(); var act = () => template.SendAsync( $"ldap:DELETE:cn={_marker},ou=users,dc=redb,dc=test?{Connection}", new Exchange(new Message(null))); await act.Should().ThrowAsync("the entry does not exist"); if (telemetry) probe.Activities.Should().ContainSingle().Which.Status.Should().Be(ActivityStatusCode.Error); else probe.Activities.Should().BeEmpty(); } } Path: redb-route/tests/redb.Route.Tests.Ldap/RenamedTlsOptionTests.cs Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/RenamedTlsOptionTests.cs ---- using AwesomeAssertions; using redb.Route.Ldap; namespace redb.Route.Tests.Ldap; /// /// TLS options carry the names most connectors use: trustAllCertificates. The former name is refused with the new one named, not /// bound silently. /// public class RenamedTlsOptionTests { [Fact] public void The_former_name_is_refused_with_the_new_one() { var act = () => new LdapEndpointOptions().BindFromUri(new Dictionary { ["skipCertificateValidation"] = "true" }); act.Should().Throw().WithMessage("*'skipCertificateValidation' is renamed 'trustAllCertificates'*"); } [Fact] public void The_new_name_binds() => new LdapEndpointOptions().BindFromUri(new Dictionary { ["trustAllCertificates"] = "true" }); } Path: redb-route/tests/redb.Route.Tests.Ldap/redb.Route.Tests.Ldap.csproj Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route Page: https://redbase.app/src/dev-2026-12-06/redb-route/tests/redb.Route.Tests.Ldap/redb.Route.Tests.Ldap.csproj ----