move zmq port to config file for C# and python

This commit is contained in:
Alex Bezdieniezhnykh
2025-02-16 16:35:52 +02:00
parent 0d6ea4264f
commit 2ecbc9bfd4
17 changed files with 80 additions and 180 deletions
-9
View File
@@ -1,9 +0,0 @@
namespace Azaion.CommonSecurity.DTO;
public class ApiConfig
{
public string Url { get; set; } = null!;
public int RetryCount {get;set;}
public double TimeoutSeconds { get; set; }
public string ResourcesFolder { get; set; } = "";
}
+11
View File
@@ -0,0 +1,11 @@
namespace Azaion.CommonSecurity.DTO;
public class PythonConfig
{
public string ZeroMqHost { get; set; }
public int ZeroMqPort { get; set; }
public double OneTryTimeoutSeconds { get; set; }
public int RetryCount {get;set;}
public string ResourcesFolder { get; set; } = "";
}
+1 -1
View File
@@ -2,5 +2,5 @@
public class SecureAppConfig
{
public ApiConfig ApiConfig { get; set; } = null!;
public PythonConfig PythonConfig { get; set; } = null!;
}
-15
View File
@@ -1,4 +1,3 @@
using System.Security.Claims;
using MessagePack;
namespace Azaion.CommonSecurity.DTO;
@@ -9,18 +8,4 @@ public class User
[Key("i")] public string Id { get; set; } = "";
[Key("e")] public string Email { get; set; } = "";
[Key("r")]public RoleEnum Role { get; set; }
//For deserializing
public User(){}
public User(IEnumerable<Claim> claims)
{
var claimDict = claims.ToDictionary(x => x.Type, x => x.Value);
Id = claimDict[SecurityConstants.CLAIM_NAME_ID];
Email = claimDict[SecurityConstants.CLAIM_EMAIL];
if (!Enum.TryParse(claimDict[SecurityConstants.CLAIM_ROLE], out RoleEnum role))
role = RoleEnum.None;
Role = role;
}
}