Add whitelisting service + update the jwt valid audience
This commit is contained in:
79
src/Managing.Api/Models/PrivyWebhookDto.cs
Normal file
79
src/Managing.Api/Models/PrivyWebhookDto.cs
Normal 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user