Repository navigation
Add the Identity foundation - #2441
Merged
Merged
Conversation
Identity user store on EF Core with a SQLite and a PostgreSQL DbContext each carrying its own migrations, the first Identity migration for both, first-run administrator and user directory services, the user-or-agent initiator model, and dotnet-ef as a local tool. Refs #2440
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2440
What
The part of F-USR (#2428) that needs no screen, so it lands before the admin shell.
Initiator,UserInitiator,AgentInitiator,ICurrentInitiator) withClaimsInitiator.From(principal), where an agent credential claim always wins over a user id so an agent can never be recorded as a person.FluentCmsRoles.Administrator,Result/Result<T>/Error, and theIFirstRunSetupandIUserDirectoryservices.FluentCmsUserwith display name,FluentCmsRole, Guid keys, tables namedUsers,Roles, ...). TheDbContextis now an abstractIdentityDbContextwith a SQLite and a PostgreSQL subclass, each with its own migrations folder and a design-time factory, selected once at startup by the existing provider configuration. The first migration,Identity, for both providers.UserDirectory(create, list, disable through lockout) andFirstRunSetup.ICurrentInitiatorresolved from the request's claims in the web host; the stdio host has no initiator until F-MCP issues agent credentials.dotnet-efas a local tool in.config/dotnet-tools.json;CONTRIBUTING.mddocuments how to add a migration for both providers.Why
F-AUD (#2424) needs the principal model and sign-in needs the user store; neither needs a page. Landing the per-provider migration strategy now means the next epics add tables the same way.
Tests
Unit: claims mapping for a user, an agent beside a user id, and anonymous principals; result semantics. Integration: migrations apply on SQLite and on PostgreSQL in CI, the first administrator is created once and holds the Administrator role, users are created, listed and disabled, a weak password is rejected with Identity's error codes, and an unknown provider fails at startup. Both host modes still start, which now exercises the migrator with a real migration.
Checklist
v2