Implement Auth service — login, register, sessions, account properties, OAuth stubs
- auth.proto: add account property CRUD messages + OAuthProvider enum + LoginWithOAuth (all OAuth providers disabled via Redis feature flags: oauth_<provider>_enabled) - SOR.Auth: full AuthGrpcHandler — password auth, session tokens (32-byte random, SHA-256 hash in Postgres, raw token in Redis with TTL), ValidateToken with Redis fast-path + Postgres slow-path fallback, Logout with dual revocation - AccountProperty entity: flexible key-value bag per account (snake_case keys, string values); upsert semantics; indexed on (AccountId, Key) - SOR.Auth/ServiceRegistration: registers Identity DbContext + UserManager + roles - SOR.Host/appsettings.json: add Postgres Default connection string - AddAccountProperties migration applied to pg-forge-01 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -232,6 +232,39 @@ namespace SOR.Database.Migrations.Identity
|
||||
b.ToTable("accounts", "identity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SOR.Database.Entities.Identity.AccountProperty", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("AccountId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTimeOffset>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Key")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTimeOffset>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
|
||||
b.HasIndex("AccountId", "Key")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("account_properties", "identity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SOR.Database.Entities.Identity.AccountSession", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
|
||||
Reference in New Issue
Block a user