IdentityShroud/IdentityShroud.Core/Model/Client.cs

30 lines
834 B
C#
Raw Normal View History

2026-02-20 17:35:38 +01:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using IdentityShroud.Core.Security;
2026-02-20 17:35:38 +01:00
using Microsoft.EntityFrameworkCore;
2026-02-06 19:58:01 +01:00
namespace IdentityShroud.Core.Model;
2026-02-20 17:35:38 +01:00
[Table("client")]
[Index(nameof(ClientId), IsUnique = true)]
2026-02-06 19:58:01 +01:00
public class Client
{
2026-02-20 17:35:38 +01:00
[Key]
2026-02-06 19:58:01 +01:00
public Guid Id { get; set; }
2026-02-20 17:35:38 +01:00
public Guid RealmId { get; set; }
[MaxLength(40)]
public required string ClientId { get; set; }
[MaxLength(80)]
public string? Name { get; set; }
[MaxLength(2048)]
public string? Description { get; set; }
2026-02-20 17:35:38 +01:00
[MaxLength(20)]
public string? SignatureAlgorithm { get; set; }
public bool AllowClientCredentialsFlow { get; set; } = false;
public required DateTime CreatedAt { get; set; }
public List<ClientSecret> Secrets { get; set; } = [];
2026-02-06 19:58:01 +01:00
}