namespace ZB.MOM.WW.LmxProxy.Host.Security
{
///
/// Represents an API key with associated permissions
///
public class ApiKey
{
///
/// The API key value
///
public string Key { get; set; } = string.Empty;
///
/// Description of what this API key is used for
///
public string Description { get; set; } = string.Empty;
///
/// The role assigned to this API key
///
public ApiKeyRole Role { get; set; } = ApiKeyRole.ReadOnly;
///
/// Whether this API key is enabled
///
public bool Enabled { get; set; } = true;
///
/// Checks if the API key is valid
///
public bool IsValid() => Enabled;
}
///
/// API key roles
///
public enum ApiKeyRole
{
///
/// Can only read data
///
ReadOnly,
///
/// Can read and write data
///
ReadWrite
}
}