99 lines
2.6 KiB
C#
99 lines
2.6 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace StellaOps.Authority.Bootstrap;
|
|
|
|
internal sealed record BootstrapUserRequest
|
|
{
|
|
public string? Provider { get; init; }
|
|
|
|
public string? InviteToken { get; init; }
|
|
|
|
[Required]
|
|
public string Username { get; init; } = string.Empty;
|
|
|
|
[Required]
|
|
public string Password { get; init; } = string.Empty;
|
|
|
|
public string? DisplayName { get; init; }
|
|
|
|
public string? Email { get; init; }
|
|
|
|
public bool RequirePasswordReset { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? Roles { get; init; }
|
|
|
|
public IReadOnlyDictionary<string, string?>? Attributes { get; init; }
|
|
}
|
|
|
|
internal sealed record BootstrapClientRequest
|
|
{
|
|
public string? Provider { get; init; }
|
|
|
|
public string? InviteToken { get; init; }
|
|
|
|
[Required]
|
|
public string ClientId { get; init; } = string.Empty;
|
|
|
|
public bool Confidential { get; init; } = true;
|
|
|
|
public string? DisplayName { get; init; }
|
|
|
|
public string? ClientSecret { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? AllowedGrantTypes { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? AllowedScopes { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? AllowedAudiences { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? RedirectUris { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? PostLogoutRedirectUris { get; init; }
|
|
|
|
public IReadOnlyDictionary<string, string?>? Properties { get; init; }
|
|
|
|
public IReadOnlyCollection<BootstrapClientCertificateBinding>? CertificateBindings { get; init; }
|
|
}
|
|
|
|
internal sealed record BootstrapInviteRequest
|
|
{
|
|
public string Type { get; init; } = BootstrapInviteTypes.User;
|
|
|
|
public string? Token { get; init; }
|
|
|
|
public string? Provider { get; init; }
|
|
|
|
public string? Target { get; init; }
|
|
|
|
public DateTimeOffset? ExpiresAt { get; init; }
|
|
|
|
public string? IssuedBy { get; init; }
|
|
|
|
public IReadOnlyDictionary<string, string?>? Metadata { get; init; }
|
|
}
|
|
|
|
internal sealed record BootstrapClientCertificateBinding
|
|
{
|
|
public string Thumbprint { get; init; } = string.Empty;
|
|
|
|
public string? SerialNumber { get; init; }
|
|
|
|
public string? Subject { get; init; }
|
|
|
|
public string? Issuer { get; init; }
|
|
|
|
public IReadOnlyCollection<string>? SubjectAlternativeNames { get; init; }
|
|
|
|
public DateTimeOffset? NotBefore { get; init; }
|
|
|
|
public DateTimeOffset? NotAfter { get; init; }
|
|
|
|
public string? Label { get; init; }
|
|
}
|
|
|
|
internal static class BootstrapInviteTypes
|
|
{
|
|
public const string User = "user";
|
|
public const string Client = "client";
|
|
}
|