Expose local endpoint in channel adapter (#2213)

* Expose local endpoint

* Update release notes
This commit is contained in:
Christian
2025-10-19 23:06:36 +02:00
committed by GitHub
parent 5ebc5fcb7e
commit e791d9aba4
14 changed files with 208 additions and 150 deletions
+21 -1
View File
@@ -14,8 +14,28 @@ namespace MQTTnet.Tests.Server;
// ReSharper disable InconsistentNaming
[TestClass]
public sealed class Security_Tests : BaseTestClass
public class Security_Tests : BaseTestClass
{
[TestMethod]
public async Task Deny_Connection()
{
using var testEnvironment = CreateTestEnvironment();
testEnvironment.IgnoreClientLogErrors = true;
var server = await testEnvironment.StartServer();
server.ValidatingConnectionAsync += e =>
{
e.ReasonCode = MqttConnectReasonCode.NotAuthorized;
return CompletedTask.Instance;
};
var client = testEnvironment.CreateClient();
var response = await client.ConnectAsync(testEnvironment.CreateDefaultClientOptions());
Assert.AreEqual(MqttClientConnectResultCode.NotAuthorized, response.ResultCode);
}
[TestMethod]
public async Task Do_Not_Affect_Authorized_Clients()
{