Expose binary password to MqttConnectionValidatorContext.

This commit is contained in:
Christian Kratky
2019-05-27 19:57:36 +02:00
parent ccfe67e6a6
commit 2d03c267e4
4 changed files with 15 additions and 18 deletions
@@ -1,5 +1,4 @@
using System;
using System.Text;
using System.Threading.Tasks;
using IronPython.Runtime;
using Microsoft.Extensions.Logging;
@@ -23,12 +22,6 @@ namespace MQTTnet.Server.Mqtt
{
try
{
string passwordString = null;
if (context.Password != null)
{
passwordString = Encoding.UTF8.GetString(context.Password);
}
var pythonContext = new PythonDictionary
{
{ "client_id", context.ClientId },
@@ -36,7 +29,7 @@ namespace MQTTnet.Server.Mqtt
{ "is_secure_connection", context.IsSecureConnection },
{ "username", context.Username },
{ "password", context.Password },
{ "password_string", passwordString },
{ "raw_password", context.RawPassword },
{ "result", PythonConvert.Pythonfy(context.ReturnCode) }
};