50 lines
2.4 KiB
C#
50 lines
2.4 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace WebDrop.Api;
|
|
|
|
public sealed class PasskeyBeginRequest
|
|
{
|
|
[JsonPropertyName("username")] public required string Username { get; init; }
|
|
[JsonPropertyName("verifier")] public string? Verifier { get; init; }
|
|
}
|
|
public sealed class PasskeyOptionsBody
|
|
{
|
|
[JsonPropertyName("id")] public required string Id { get; init; }
|
|
[JsonPropertyName("options")] public required string Options { get; init; }
|
|
[JsonPropertyName("credentials")] public List<PasskeyInfoBody> Credentials { get; init; } = [];
|
|
[JsonPropertyName("prf_salt")] public string? PrfSalt { get; init; }
|
|
}
|
|
public sealed class PasskeyFinishRequest
|
|
{
|
|
[JsonPropertyName("username")] public required string Username { get; init; }
|
|
[JsonPropertyName("id")] public required string Id { get; init; }
|
|
[JsonPropertyName("credential")] public required string Credential { get; init; }
|
|
[JsonPropertyName("name")] public string? Name { get; init; }
|
|
[JsonPropertyName("key_envelope")] public string? KeyEnvelope { get; init; }
|
|
[JsonPropertyName("device_id")] public string? DeviceId { get; init; }
|
|
[JsonPropertyName("device_name")] public string? DeviceName { get; init; }
|
|
}
|
|
public sealed class PasskeyInfoBody
|
|
{
|
|
[JsonPropertyName("id")] public required string Id { get; init; }
|
|
[JsonPropertyName("name")] public required string Name { get; init; }
|
|
[JsonPropertyName("prf_salt")] public required string PrfSalt { get; init; }
|
|
[JsonPropertyName("can_recover")] public bool CanRecover { get; init; }
|
|
[JsonPropertyName("created_at")] public long CreatedAt { get; init; }
|
|
}
|
|
public sealed class PasskeySessionBody
|
|
{
|
|
[JsonPropertyName("username")] public required string Username { get; init; }
|
|
[JsonPropertyName("token")] public required string Token { get; init; }
|
|
[JsonPropertyName("credential_id")] public required string CredentialId { get; init; }
|
|
[JsonPropertyName("prf_salt")] public required string PrfSalt { get; init; }
|
|
[JsonPropertyName("key_envelope")] public string? KeyEnvelope { get; init; }
|
|
}
|
|
public sealed class PasskeyEnvelopeRequest
|
|
{
|
|
[JsonPropertyName("username")] public required string Username { get; init; }
|
|
[JsonPropertyName("id")] public required string Id { get; init; }
|
|
[JsonPropertyName("credential")] public required string Credential { get; init; }
|
|
[JsonPropertyName("key_envelope")] public required string KeyEnvelope { get; init; }
|
|
}
|