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

@@ -55,6 +55,7 @@ public class ManagingDbContext : DbContext
public DbSet<SynthMinersLeaderboardEntity> SynthMinersLeaderboards { get; set; }
public DbSet<SynthPredictionEntity> SynthPredictions { get; set; }
public DbSet<WhitelistAccountEntity> WhitelistAccounts { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -573,6 +574,29 @@ public class ManagingDbContext : DbContext
entity.HasIndex(e => e.CacheKey).IsUnique();
});
// Configure WhitelistAccount entity
modelBuilder.Entity<WhitelistAccountEntity>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.PrivyId).IsRequired().HasMaxLength(255);
entity.Property(e => e.PrivyCreationDate).IsRequired();
entity.Property(e => e.EmbeddedWallet).IsRequired().HasMaxLength(42);
entity.Property(e => e.ExternalEthereumAccount).HasMaxLength(42);
entity.Property(e => e.TwitterAccount).HasMaxLength(255);
entity.Property(e => e.IsWhitelisted)
.IsRequired()
.HasDefaultValue(false);
entity.Property(e => e.CreatedAt).IsRequired();
entity.Property(e => e.UpdatedAt);
// Create indexes for search performance
entity.HasIndex(e => e.PrivyId).IsUnique();
entity.HasIndex(e => e.EmbeddedWallet).IsUnique();
entity.HasIndex(e => e.ExternalEthereumAccount);
entity.HasIndex(e => e.TwitterAccount);
entity.HasIndex(e => e.CreatedAt);
});
// Configure AgentSummary entity
modelBuilder.Entity<AgentSummaryEntity>(entity =>
{