Add whitelisting service + update the jwt valid audience

This commit is contained in:
2025-11-07 19:38:33 +07:00
parent 5578d272fa
commit 21110cd771
17 changed files with 2575 additions and 7 deletions

View File

@@ -0,0 +1,79 @@
using System.Text.Json.Serialization;
namespace Managing.Api.Models;
/// <summary>
/// Privy webhook payload for wallet creation events.
/// </summary>
public class PrivyWebhookDto
{
[JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
[JsonPropertyName("user")]
public PrivyUserDto User { get; set; } = new();
[JsonPropertyName("wallet")]
public PrivyWalletDto Wallet { get; set; } = new();
}
/// <summary>
/// Privy user information from webhook.
/// </summary>
public class PrivyUserDto
{
[JsonPropertyName("created_at")]
public long CreatedAt { get; set; }
[JsonPropertyName("has_accepted_terms")]
public bool HasAcceptedTerms { get; set; }
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("is_guest")]
public bool IsGuest { get; set; }
[JsonPropertyName("linked_accounts")]
public List<PrivyLinkedAccountDto> LinkedAccounts { get; set; } = new();
[JsonPropertyName("mfa_methods")]
public List<object> MfaMethods { get; set; } = new();
}
/// <summary>
/// Privy linked account information from webhook.
/// </summary>
public class PrivyLinkedAccountDto
{
[JsonPropertyName("address")]
public string Address { get; set; } = string.Empty;
[JsonPropertyName("first_verified_at")]
public long? FirstVerifiedAt { get; set; }
[JsonPropertyName("latest_verified_at")]
public long? LatestVerifiedAt { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
[JsonPropertyName("verified_at")]
public long? VerifiedAt { get; set; }
}
/// <summary>
/// Privy wallet information from webhook.
/// </summary>
public class PrivyWalletDto
{
[JsonPropertyName("type")]
public string Type { get; set; } = string.Empty;
[JsonPropertyName("address")]
public string Address { get; set; } = string.Empty;
[JsonPropertyName("chain_type")]
public string ChainType { get; set; } = string.Empty;
}