mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:56:30 +00:00
add ramdisk, load AI model to ramdisk and start recognition from it
rewrite zmq to DEALER and ROUTER add GET_USER command to get CurrentUser from Python all auth is on the python side inference run and validate annotations on python
This commit is contained in:
@@ -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; } = "";
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Azaion.CommonSecurity.DTO.Commands;
|
||||
|
||||
[MessagePackObject]
|
||||
public class FileCommand
|
||||
{
|
||||
[Key("CommandType")]
|
||||
public CommandType CommandType { get; set; }
|
||||
|
||||
[Key("Filename")]
|
||||
public string Filename { get; set; }
|
||||
|
||||
[Key("Data")]
|
||||
public byte[] Data { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public enum CommandType
|
||||
{
|
||||
None = 0,
|
||||
Inference = 1,
|
||||
Load = 2
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Azaion.CommonSecurity.DTO.Commands;
|
||||
|
||||
[MessagePackObject]
|
||||
public class RemoteCommand(CommandType commandType, string? filename = null, byte[]? data = null)
|
||||
{
|
||||
[Key("CommandType")]
|
||||
public CommandType CommandType { get; set; } = commandType;
|
||||
|
||||
[Key("Filename")]
|
||||
public string? Filename { get; set; } = filename;
|
||||
|
||||
[Key("Data")]
|
||||
public byte[]? Data { get; set; } = data;
|
||||
}
|
||||
|
||||
public enum CommandType
|
||||
{
|
||||
None = 0,
|
||||
Inference = 1,
|
||||
Load = 2,
|
||||
GetUser = 3
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Azaion.CommonSecurity.DTO;
|
||||
|
||||
public class SecureAppConfig
|
||||
{
|
||||
public ApiConfig ApiConfig { get; set; } = null!;
|
||||
}
|
||||
@@ -1,21 +1,11 @@
|
||||
using System.Security.Claims;
|
||||
using MessagePack;
|
||||
|
||||
namespace Azaion.CommonSecurity.DTO;
|
||||
|
||||
[MessagePackObject]
|
||||
public class User
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Email { get; set; }
|
||||
public RoleEnum Role { get; set; }
|
||||
|
||||
public User(IEnumerable<Claim> claims)
|
||||
{
|
||||
var claimDict = claims.ToDictionary(x => x.Type, x => x.Value);
|
||||
|
||||
Id = Guid.Parse(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;
|
||||
}
|
||||
[Key("i")]public string Id { get; set; }
|
||||
[Key("e")]public string Email { get; set; }
|
||||
[Key("r")]public RoleEnum Role { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user