mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 11:45:43 +08:00
Expose binary password to MqttConnectionValidatorContext.
This commit is contained in:
@@ -5,11 +5,17 @@ namespace MQTTnet.Server
|
||||
{
|
||||
public class MqttConnectionValidatorContext
|
||||
{
|
||||
public MqttConnectionValidatorContext(string clientId, string username, byte[] password, MqttApplicationMessage willMessage, string endpoint, bool isSecureConnection)
|
||||
public MqttConnectionValidatorContext(
|
||||
string clientId,
|
||||
string username,
|
||||
byte[] password,
|
||||
MqttApplicationMessage willMessage,
|
||||
string endpoint,
|
||||
bool isSecureConnection)
|
||||
{
|
||||
ClientId = clientId;
|
||||
Username = username;
|
||||
Password = password;
|
||||
RawPassword = password;
|
||||
WillMessage = willMessage;
|
||||
Endpoint = endpoint;
|
||||
IsSecureConnection = isSecureConnection;
|
||||
@@ -19,7 +25,9 @@ namespace MQTTnet.Server
|
||||
|
||||
public string Username { get; }
|
||||
|
||||
public byte[] Password { get; }
|
||||
public string Password => Encoding.UTF8.GetString(RawPassword ?? new byte[0]);
|
||||
|
||||
public byte[] RawPassword { get; }
|
||||
|
||||
public MqttApplicationMessage WillMessage { get; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user