2018-04-29 11:28:04 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-02-24 14:36:15 +01:00
|
|
|
|
using System.Collections.Immutable;
|
2018-04-29 11:28:04 +02:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2020-02-24 14:36:15 +01:00
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2018-04-29 11:28:04 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace BTCPayServer.Data
|
|
|
|
|
{
|
|
|
|
|
public class APIKeyData
|
|
|
|
|
{
|
|
|
|
|
[MaxLength(50)]
|
|
|
|
|
public string Id
|
|
|
|
|
{
|
2020-02-24 14:36:15 +01:00
|
|
|
|
get;
|
|
|
|
|
set;
|
2018-04-29 11:28:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-24 14:36:15 +01:00
|
|
|
|
[MaxLength(50)] public string StoreId { get; set; }
|
|
|
|
|
|
|
|
|
|
[MaxLength(50)] public string UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
public APIKeyType Type { get; set; } = APIKeyType.Legacy;
|
|
|
|
|
|
2020-04-02 08:59:20 +02:00
|
|
|
|
public byte[] Blob { get; set; }
|
2020-02-24 14:36:15 +01:00
|
|
|
|
public StoreData StoreData { get; set; }
|
|
|
|
|
public ApplicationUser User { get; set; }
|
2020-02-25 14:43:53 +01:00
|
|
|
|
public string Label { get; set; }
|
2020-02-24 14:36:15 +01:00
|
|
|
|
}
|
2018-07-19 12:31:17 +02:00
|
|
|
|
|
2020-04-02 08:59:20 +02:00
|
|
|
|
public class APIKeyBlob
|
|
|
|
|
{
|
|
|
|
|
public string[] Permissions { get; set; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-24 14:36:15 +01:00
|
|
|
|
public enum APIKeyType
|
|
|
|
|
{
|
|
|
|
|
Legacy,
|
|
|
|
|
Permanent
|
2018-04-29 11:28:04 +02:00
|
|
|
|
}
|
|
|
|
|
}
|