Solhigson.Framework.Core
10.30.0
See the version list below for details.
dotnet add package Solhigson.Framework.Core --version 10.30.0
NuGet\Install-Package Solhigson.Framework.Core -Version 10.30.0
<PackageReference Include="Solhigson.Framework.Core" Version="10.30.0" />
<PackageVersion Include="Solhigson.Framework.Core" Version="10.30.0" />
<PackageReference Include="Solhigson.Framework.Core" />
paket add Solhigson.Framework.Core --version 10.30.0
#r "nuget: Solhigson.Framework.Core, 10.30.0"
#:package Solhigson.Framework.Core@10.30.0
#addin nuget:?package=Solhigson.Framework.Core&version=10.30.0
#tool nuget:?package=Solhigson.Framework.Core&version=10.30.0
Utility Library
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Autofac.Extensions.DependencyInjection (>= 10.0.0)
- Hangfire.AspNetCore (>= 1.8.22)
- Hangfire.Console (>= 1.4.3)
- Hangfire.Core (>= 1.8.22)
- Hangfire.InMemory (>= 1.0.0)
- Hangfire.PostgreSql (>= 1.20.13)
- Hangfire.SqlServer (>= 1.8.22)
- Mapster (>= 7.4.0)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 10.0.14)
- Microsoft.Data.SqlClient (>= 6.1.7)
- Microsoft.EntityFrameworkCore (>= 10.0.14)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.14)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.14)
- Microsoft.Extensions.Compliance.Redaction (>= 10.1.0)
- Microsoft.Extensions.Http.Polly (>= 10.0.14)
- Microsoft.Extensions.Identity.Stores (>= 10.0.14)
- Microsoft.Extensions.Telemetry (>= 10.1.0)
- Microsoft.Extensions.Telemetry.Abstractions (>= 10.1.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NewId (>= 4.0.1)
- Newtonsoft.Json (>= 13.0.4)
- NLog (>= 6.0.7)
- NLog.Extensions.Logging (>= 6.1.0)
- Npgsql (>= 10.0.3)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.20.1)
- OpenTelemetry.Extensions.Hosting (>= 1.20.1)
- Solhigson.Utilities (>= 10.2.0)
- StackExchange.Redis (>= 2.10.1)
- Swashbuckle.AspNetCore.Annotations (>= 10.3.1)
- Swashbuckle.AspNetCore.SwaggerGen (>= 10.3.1)
- Swashbuckle.AspNetCore.SwaggerUI (>= 10.3.1)
- System.Runtime.Caching (>= 10.0.14)
- System.Security.Cryptography.Pkcs (>= 10.0.14)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Solhigson.Framework.Core:
| Package | Downloads |
|---|---|
|
Solhigson.Admin
Admin screens for Solhigson apps as Razor components, rendered on the server. An app owns its routes; the package ships no page. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.31.0 | 97 | 11/22/2026 |
| 10.30.0 | 101 | 11/20/2026 |
| 10.29.0 | 103 | 11/19/2026 |
| 10.28.0 | 88 | 11/18/2026 |
| 10.27.0 | 112 | 11/17/2026 |
| 10.26.0 | 96 | 11/16/2026 |
| 10.25.0 | 94 | 11/16/2026 |
| 10.24.0 | 91 | 11/16/2026 |
| 10.23.0 | 91 | 11/15/2026 |
| 10.22.0 | 96 | 11/15/2026 |
| 10.21.0 | 95 | 11/14/2026 |
| 10.20.0 | 108 | 11/14/2026 |
| 10.19.0 | 97 | 11/12/2026 |
| 10.18.0 | 460 | 11/12/2026 |
| 10.17.0 | 94 | 11/11/2026 |
| 10.16.0 | 181 | 11/11/2026 |
| 10.15.0 | 210 | 11/7/2026 |
| 10.14.0 | 100 | 11/5/2026 |
| 10.13.0 | 102 | 11/4/2026 |
| 10.12.0 | 100 | 11/3/2026 |
10.30.0: the password flows (Solhigson.Framework.Identity). SolhigsonIdentityManager gains RequestPasswordResetAsync, IssuePasswordResetAsync, ResetPasswordAsync and ChangePasswordAsync. None throws but on the caller's cancellation: a step that throws answers Failed with one Error naming the method, the step and the exception's type, never its message. Every call adds one to the counter password on the meter Solhigson.Framework.Identity, tagged method (request_reset, issue_reset, reset, change) and outcome (PasswordDiagnostics.Text of the outcome, or cancelled), and the lines go under the logger name Solhigson.Framework.Identity.Password, naming a user by its id, never by an address, a token or a password. RequestPasswordResetAsync(email), for a page anyone can reach, answers a PasswordResetRequest: Outcome, the new enum PasswordResetOutcome (Send, NoSend, InvalidEmail, Failed), and, for Send only, UserId, Email (the address the store holds, the one the link is mailed to, never the one typed) and Token, Identity's reset token. The framework builds no link: the app builds its scheme and host from its own configured public address, never from the request's Host or forwarded headers. The address, trimmed, that is blank, longer than 256 characters or refused by EmailAddressAttribute answers InvalidEmail with nothing read. The users whose NormalizedEmail is the address normalized are read, two at most, in one query: none, or one not Enabled or with no address, answers NoSend; two answer NoSend with one Warning naming both, and neither is sent a link. A locked-out account is sent its link. A user is sent at most three links in a fixed hour from the first counted, counted in the ICounterStore: past three it answers NoSend with one Warning. A count the store answers unavailable, one not answered by 50 milliseconds before the floor's end, and no store registered each let the link go uncapped, the first two written once while they last, no store once per logger factory. Every request returns no sooner than 400 milliseconds after it was called, on the services' TimeProvider, TimeProvider.System when they hold none, but where the floor's own delay throws, which answers Failed at once. IssuePasswordResetAsync(userId), for an administrator sending a link to a known user, answers Send for an enabled user holding an address and NoSend otherwise, with no floor and no cap. ResetPasswordAsync(userId, token, newPassword) and ChangePasswordAsync(user, currentPassword, newPassword) answer a PasswordResult: Outcome, the new enum PasswordOutcome (None, never answered; Done, TokenNotValid, PasswordRefused, Failed, NoPassword, LockedOut, CurrentNotValid, PasswordUnchanged), Message (a PasswordMessages sentence, empty for Done), Errors (Identity's, for PasswordRefused), EndSessions, HadTwoFactor and StillLockedOut. A reset answers TokenNotValid, one sentence, alike in answer, not in time, for an id that does not parse, a missing or disabled user and a token Identity refuses, the token checked before anything of the account changes; PasswordRefused for a new password the app's password validators refuse, the breached-password check among them when registered; else one save through UserManager.ResetPasswordAsync sets the password, rotates the security stamp, so a token is used once, sets RequirePasswordChange false, and clears the lockout end and the failed count only for an account with two-factor off. Two-factor stays on, and an account with it on keeps its lockout, which StillLockedOut reports. A change answers NoPassword for an account with none; LockedOut for one locked before the call; CurrentNotValid for a wrong or blank current password, a wrong one counted toward lockout through SignInManager.CheckPasswordSignInAsync, and LockedOut for the one that locks the account; PasswordUnchanged for the current password again; PasswordRefused; else one save of the new hash, RequirePasswordChange false and a new security stamp, answered Done, and the request's own sign-in, when it is the user's, is refreshed so this device stays signed in. It answers Failed, nothing checked, for a disabled account and while the request's context holds a change not yet saved, which Identity's saves in the current-password check would commit. Done sets EndSessions (a change's: the user's other sessions), as does a Failed whose save could not be read back, since the password may be set. A reset and a change write only through Identity's EF UserStore, or a subclass, saving with each write, and answer Failed on any other store, or with none. Outside the new methods: UpdateLastLoginTimeAsync given no time stamps the manager's TimeProvider's now, not DateTime.UtcNow; and the account's context, which the wrong-code lockout and UnlockAsync's put-back write through, is the user store's own for any store derived from Identity's ten-parameter EF UserStore, the one AddEntityFrameworkStores registers, where 10.29.0 matched the four-parameter UserStore only and used the manager's context otherwise. Minor bump: every type and member is new, beside those two changes, but a consumer's own type named PasswordResetRequest, PasswordResetOutcome, PasswordResult, PasswordOutcome, PasswordMessages or PasswordDiagnostics, brought into a file by a using directive alongside Solhigson.Framework.Identity, is ambiguous there (CS0104) until the local copy is renamed or the use qualified or aliased. 10.29.0: the role screens' reads and a safer create (Solhigson.Framework.Identity). HeldPermission gains Removable, an init property: on HeldPermissionsAsync's answer it is true for a grant RemoveGrantsOutsideOfferAsync would remove, set from the same permission-group reconciler verdict the removal judges by, the one rule both read: a grant outside its group (OutsideGroup), one naming an undeclared permission that is no menu root, and one naming no stored permission (Missing). It is false for an offered grant, for a NoDeclaration grant the removal keeps (an undeclared menu root, or a name the store's collation matches to a declaration allowing the group), for a grant in an unknown group, and for every grant when no permission groups are registered; the removal judges each grant again when it runs, so a page counts what it would take from Removable, never from Class. RoleAdministration.PermissionsAsync(actingUserId) answers a PermissionCatalogue: every stored permission, enabled or not, in the role editor's order, the one OfferedPermissionsAsync gives an offer, as a CataloguedPermission (its id, name, description and parent id; the parent's name and description, joined in the store, null for a parent id naming no stored permission; the role groups its declaration allows, as GetAllowedGroupsAsync reads them, null when it has no valid declaration and for every permission when no permission groups are registered; and the roles holding a stored grant of it, each once as a CataloguedRole, its key as text and its name, ordered by name ordinally, a role stored with no name last by id, a grant naming no stored role naming none), with GroupsRegistered, whether the app registers permission groups. It refuses NoRules and ActorRefused as ListAsync does and otherwise answers any stored, enabled actor whatever it may grant, so the app gates who may view the permissions page. It makes three reads after the caller's load, whatever the number of permissions, grants or roles, an app's query filter on the roles applying, and is counted and logged under the method permissions, a catalogue answered writing no line. CreateAsync now refuses InTransaction, with no line, when the scope's context has a transaction open or an ambient one is, checked after MayCreateRoleAsync, as SetPermissionsAsync, RemoveGrantsOutsideOfferAsync and DeleteAsync refuse: the create commits its own, and its read back must see only a committed role. Once Identity's save has stored the role, the read back takes no token, so a caller that goes away after the save still gets Done, the create's Information line and a summary its audit can follow. Where a cancelled save throws an OperationCanceledException (SQLite, PostgreSQL), it is checked with no token: a role stored under its id answers Done, anything else rethrows the cancellation, and a check that throws answers Failed. On SQL Server EF wraps the cancellation in a DbUpdateException, which takes the name check with the caller's token: a cancelled caller's create is rethrown as a cancellation, though the role may be stored, and one whose request token fired while the caller's is live may answer IdentityFailed with DuplicateRoleName for the role it stored. A Failed create may also have stored the role: its Error under RoleAdministration names the role's id only once the role is known stored (the save returned, or a cancelled save's check found it) and the summary read failed, and names the role new otherwise, so the app looks the role up by name before treating a Failed or cancelled create as no role. A cancellation before the save is rethrown, as before. Minor bump: every member is new; a create inside a transaction now answers InTransaction, and one cancelled after its save Done, as is one whose save the cancellation interrupts where it throws as one. 10.28.0: role administration (Solhigson.Framework.Identity). RoleAdministration<TUser, TRole, TContext, TKey> is registered scoped by both AddSolhigsonIdentityManager overloads and answers through the app's IUserAdministrationRules, the registration user administration needs: with none, every call answers NoRules. Every method answers a UserAdministrationResult<T> with its payload in Value, never throws but on the caller's cancellation, reads the database for each call, never a cache, and is counted on role_administration, tagged method and outcome, and logged under RoleAdministration by ids, never a role's name (a create's Done line also names the stored group): an Error is a fault, a Warning an attempt outside reach. ListAsync answers every stored role as a RoleSummary (id, name, group, whether the group is a known one, the holders in every tenant past any query filter, the stored grants, whether the caller holds it, and CanEdit by CanEditRoleAsync's rule), ordered by group then name; GetAsync answers one role by its normalized name. Both, and HeldPermissionsAsync, answer any stored, enabled actor, holder counts in every tenant included, so the app gates who may view the role pages. CreateAsync trims the name and refuses InvalidName (blank, over MaxRoleNameLength, 64, a control or format character, a space other than U+0020 or two in a row, a lone surrogate or U+FFFD, a slash or a backslash, or text not in NFC), GroupNotFound, RoleExists, and GroupOutOfReach, with one Warning, unless the new IUserAdministrationRules.MayCreateRoleAsync answers true: it is given the actor, its roles, the trimmed name and the stored group's own name, and answers false by default, so an app that does not override it creates no role. An app whose rules or role checks work by role name refuses there a privileged name nobody has stored yet, or one a delete has freed. The role is created with no grant. OfferedPermissionsAsync answers the permission manager's offer for a role the caller may edit as OfferedPermission records, ordered by the top ancestor's menu index and name, then depth; Grantable is true when the caller's Grant answer is All, or when it holds the permission as a check with enforcement on sees it, so a grant its role's group does not admit never counts. HeldPermissionsAsync answers every stored grant of a role, whether or not the caller may edit it, as HeldPermission: Class is Offered or, by the permission-group reconciler, OutsideGroup, NoDeclaration, UnknownGroup or Missing, and Grantable holds only on a role the caller may edit. SetPermissionsAsync saves the whole posted set through SetRolePermissionsAsync in one transaction under the execution strategy, refusing InTransaction under an open transaction; Stale when the role's offered grants are not the page's loaded set, or the manager staged other rows than planned; PermissionOutOfReach, with one Warning, when an id to add is not grantable; and RoleOutOfReach, rolled back, when the Grant answer, asked again with the grants as written, no longer lets the caller edit the role. A rule that ranks roles by their grants reads them uncached through the scope's TContext. RemoveGrantsOutsideOfferAsync removes, through the tracker in one save, the grants the reconciler judges outside the role's group, undeclared and no menu root, or naming no stored permission: Revoked names them, and RolePermissionChange.RemovedMissingIds holds the ids of the last kind; with no permission groups registered it answers Unchanged. DeleteAsync deletes a role no user holds in any tenant, answering a RoleDeletion (the summary as it was, RemovedPermissionNames and RemovedMissingIds), or RoleInUse with the holder count; the role's claims go with it by Identity's cascade. It writes the role first, then counts its holders with a read that waits for an assignment in flight: FOR UPDATE on PostgreSQL, at READ COMMITTED, its default; READCOMMITTEDLOCK on SQL Server; the write lock on SQLite. On any other provider it answers Failed. A save, a removal or a delete that is done waits up to two seconds for every instance's cache to be told: CacheConfirmed false means another instance may honour the old grants until its cache recovers. No call ends a session, and a deleted role's name can be created again, which a live session carrying that role claim then matches. UserAdministrationResult<T> now takes any T, with User kept as an alias of Value, and the outcome enum gains InvalidName, GroupNotFound, RoleExists, GroupOutOfReach, PermissionOutOfReach, Stale and RoleInUse, each with its UserAdministrationMessages sentence and counter text. Minor bump: every member is new, UserAdministrationResult<T>'s change is compatible, and MayCreateRoleAsync has a default. 10.27.0: a host names the build it runs, in its logs and at its /api root (Solhigson.Framework.Web, and the package's build targets). The package now carries Solhigson.Framework.Core.targets under build/ and buildTransitive/, so the file reaches every project that references Core, directly or through another package, and it does nothing unless that project sets SolhigsonStampBuildTime to true. A project that sets it gets its UTC build time, to the minute, as the BuildTime AssemblyMetadata, written dd-MM-yyyy HH:mm through the invariant culture whatever the build machine's culture, calendar or time zone, and recompiles whenever the minute has changed, so a host sets the switch in each host project only. The new ServiceRelease reads a host's own assembly: ServiceRelease.Of(assembly), or Of<T>() for the assembly that defines T, a type of the host (never the entry assembly nor Core's own), answers one shared immutable instance per assembly, held no longer than the assembly, and never throws, an assembly whose attributes cannot be read answering as one that carries neither. Commit is the 40-hex-digit commit the SDK writes after the informational version's last +, null when there is none (a SourceRevisionId override that is not a commit, such as a date, or a build that saw no .git); Built is the BuildTime stamp, null when the project did not set the switch; Text is [Built], else the informational version's text after its first + in brackets, else [unknown], the form a version line shows. ServiceRelease.Answer<T>() is a host's /api answer, a successful ResponseInfo<ServiceRelease> with the message Ok, returned through HttpOk(); FailedAnswer<T>() is the failed envelope with the default failed message and code, still carrying the release, so a caller tells a host that is down from one running an old commit, and goes out with a 5xx status, never through HttpOk(), which answers 200 whatever the envelope holds. The release serializes as {"built": ..., "commit": ...}, both written even when null and Text left out, under System.Text.Json and Newtonsoft alike, whatever the caller's naming, null or default-value handling; it has no public constructor, so it is written but not read back: a reader such as a monitor parses it into its own type or a JsonNode. Minor bump: every member is new and no existing behaviour changes, but a consumer's own type named ServiceRelease, brought into a file by a using directive alongside Solhigson.Framework.Web, is ambiguous there (CS0104) until the local copy is renamed or the use qualified or aliased. 10.26.0: an operator saves and resets declared settings by key and removes undeclared rows (Solhigson.Framework.Services, Solhigson.Framework.Infrastructure.ApplicationSettings). SolhigsonConfigurationService gains SaveDeclaredSettingAsync, ResetDeclaredSettingAsync and RemoveUndeclaredRowAsync, each answering the new SettingSaveResult: Outcome, the new enum SettingSaveOutcome (Saved, Unchanged, NotDeclared, NotEditable, ChangedElsewhere, Refused, Failed, NoDefault); Key; Message, which never quotes a value; PreviousShown and NewShown, the mask for a Secret, a row stored sensitive or a Personal value (a removal masks a row stored sensitive or under a secret-looking name, and gives any other raw); and CacheConfirmed. Each judges as ListDeclaredSettingsAsync does, against the configuration passed (pass ConfigurationWrapper.Configuration), so an editor reads the listing's Kind, Editable and Resettable and the calls hold to them: a save of a line not Editable answers NotEditable with its NotEditableReason, and a reset removes a row exactly when the listing's Resettable rule allows. A save (the key matched ignoring case and trailing white space) updates the one matched row or creates one under the key through UpdateApplicationSettingAsync or CreateApplicationSettingAsync and their rules; given the new SettingLoad (HadRow, RowValue) from a write-session listing, it answers ChangedElsewhere when the stored text changed since the load (a row holding the Default counting as none). A save of a Secret or of a row stored sensitive is last-write-wins, and a blank for either keeps the stored value, Refused when none is stored. A reset removes each matched row no read sees, and the row a read finds too when a Default or configuration answers without it; NoDefault when that row is its only one and neither answers. A removal takes only a row the listing names among UndeclaredRows, by exact name. A reset or a removal that would remove a row is Refused while the context holds an unsaved AppSetting edit. After Saved, CacheConfirmed is whether every instance's settings cache was told within two seconds; false, also inside an ambient System.Transactions scope, means other instances may serve the old value until their cache entry expires; null inside a transaction begun on the context, or with no cache provider. A Failed reset or removal whose SaveChanges EF did not wrap in its own transaction or savepoint may have removed its rows: do not commit after it. None checks who may edit or writes an audit row: the caller checks before it calls and writes the audit row from the result. Minor bump: every member is new, and two existing calls change their refusals: UpdateApplicationSettingAsync refuses a row the caller's context holds pending Added or Deleted; and each CreateApplicationSettingAsync and UpdateApplicationSettingAsync refusal that logs a Warning (a declaration's rule, the encryptor rule, the secret-name rule, an unsaved edit) now logs and answers the setting name, and the unsaved settings' names, with control and format characters, line and paragraph separators and lone surrogates removed and cut to 200 characters. 10.25.0: an Autofac host with OTLP log export on starts, the exporter refuses redirects, and the settings listing says what can be edited (Solhigson.Framework.Logging.Export, Solhigson.Framework.Infrastructure, Solhigson.Framework.Infrastructure.ApplicationSettings). OpenTelemetry.Exporter.OpenTelemetryProtocol and OpenTelemetry.Extensions.Hosting are pinned at 1.20.1, up from 1.15.3: from 10.18.0 to 10.24.0 a host built on Autofac with export on, an OTLP endpoint set over http/protobuf and an IHttpClientFactory registered failed at start with Autofac's DependencyResolutionException, and on 1.20.1 it builds and starts; a grpc host was not affected, since the SDK takes the factory's client only for http/protobuf. The exporter's clients refuse a redirect on every path: the SDK's own client, and the OtlpLogExporter, OtlpTraceExporter and OtlpMetricExporter clients a host's IHttpClientFactory gives it, whose primary handler has redirects turned off on that instance (a primary instance shared across clients has them off for every client sharing it; no other client of the host changes). An endpoint answering a redirect is an export failure, written as one SolhigsonLogExportFailed Warning through NLog when it is registered, so set the endpoint to its final address; a batch first exported while the host is disposed, to a redirecting endpoint, is lost with no Warning. A host's primary handler of a type the framework cannot make refuse redirects (one of another type, a DelegatingHandler around one included, or one that has already sent a request) is kept as the host set it, with its certificate checks, client certificates and proxy, and one Warning a process, SolhigsonLogExportRedirectsKept, names the client and the handler's type, never the endpoint or a header. SolhigsonAutofacModule registers ApiTraceMiddleware with PreserveExistingDefaults, so an Autofac host keeps an app's own ApiTraceMiddleware registration. The settings listing (SolhigsonConfigurationService.ListDeclaredSettingsAsync): each DeclaredSettingLine gains Kind, the new public enum SettingValueKind (Text, Switch, Int32, Int64, Decimal, Double, Duration, List), beside the Type text; HasRow and StoredSensitive; RowValue, the value of the row a read finds by the exact key, shown as Value is, also when configuration overrides it; Editable and NotEditableReason (read from configuration only, naming the source; a configuration value is set; several rows match; its row is under a name no read finds; secret and sensitive saves refused under the legacy encryptor); and Resettable and NotResettableReason. No reason quotes a value. A read of a Table setting takes the first row by id among those the database's comparison finds (ConfigurationWrapper), and the listing reports that same row. Minor bump: the package's OpenTelemetry floor rises to 1.20.1, so a consumer that pins any of OpenTelemetry, OpenTelemetry.Api, OpenTelemetry.Api.ProviderBuilderExtensions, OpenTelemetry.Exporter.OpenTelemetryProtocol or OpenTelemetry.Extensions.Hosting lower gets NU1605 at restore and raises those five to 1.20.1 or later; instrumentation packages version apart. Azure Monitor 1.3.0 is untested against 1.20.1. 10.24.0: the menu reads the admin kit needs (Solhigson.Framework.Dto, Solhigson.Framework.Identity). SolhigsonPermissionDto gains Enabled and Id, which the permission manager's menu reads (GetMenuPermissionsForRoleCachedAsync, each overload) fill from the stored permission, so a reader can drop a disabled parent's children and name a permission by its id. PermissionManager.RolesOf(ClaimsPrincipal?) answers the role read the [Permission] gate makes: every ClaimTypes.Role value that is not blank, in claim order, a role claimed twice listed twice, and none for no principal; VerifyPermissionAsync(permission, principal) and GetMenuPermissionsForRoleCachedAsync(principal) now read the roles through it, with the same answers as before. Minor bump: every member is new, and a consumer that serialises SolhigsonPermissionDto sees two more fields, Enabled and Id. 10.23.0: user administration (Solhigson.Framework.Identity). UserAdministration<TUser, TRole, TContext, TKey>, registered scoped by both AddSolhigsonIdentityManager overloads, applies an app's IUserAdministrationRules<TUser, TKey> to who administers whom. Minor bump: every type and member is new, and a host that registers no rules sees no change but two: the two-factor code counters' clearing (a right code at sign-in, TwoFactorManager.DisableAsync and ResetAsync, SolhigsonIdentityManager.UnlockAsync) now guards the reset of the code-attempt count kept in this process as it guards the store's, so a throw there writes the sign-in's "code attempt count not reset" Warning where it escaped before, every other line unchanged; and a refused or thrown write of an account (the name-based unlock's, two-factor's, the wrong-code lockout's) now also puts back the user's owned-type values (TrackedAccount.PutBack), a replaced owned reference or an owned item added or removed still not reverted. Rules: register one IUserAdministrationRules<TUser, TKey> (any lifetime), or every call that reads the rules answers NoRules with one Error (an email change answers EmailChangeOff first while it is off, and a write first refuses a store it cannot rely on). Scope (the users an actor may see, a tenant's say) has no default: an app with one tenant returns the users given. AdministrableRolesAsync answers AdministrableRoles.All or Only(names) for RoleUse.Reach (the roles a target may hold for the actor to reach it) and RoleUse.Grant (the roles the actor may give); ReachesUsersWithNoRole (false), RefuseRoleSet (null), MatchText (a normalized email or user name prefix, or the exact id) and DisplayName (the email) have defaults. AdministrableRolesAsync or Scope answering null, or any rule throwing, answers Failed, so a fault never widens reach. Roles are read from the database for each call, never from claims or a cache, and compared on normalized names: a stored role is in an Only answer when its stored normalized name and its name normalized now are both among the answer's. Result: UserAdministrationResult<TUser> (Outcome, User, Message, Errors, EndSessions, NeedsPasswordLink, Granted, Revoked, Disabled, PreviousEmail); the words a user reads are the app's. No method throws but on the caller's cancellation: a step that throws answers Failed. Reach (CanAdministerAsync(actingUserId, targetUserId)): NoRules; ActorRefused (one Warning) unless the actor is stored and Enabled both as loaded and as stored; NotFound (one Warning) for a target missing, outside Scope, or holding a role outside the Reach answer (no stored role needs ReachesUsersWithNoRole), one answer for all three so an id cannot be probed; else Done with the target. It holds for the rows as read: an app that changes a field Scope reads (a user's tenant) calls it again after its save, inside its transaction, and rolls back on a refusal. The re-check cannot be relied on to stop an actor moving itself: Scope reads the actor's own row, so after the move it passes inside the new tenant whenever the actor's Reach answer covers its own roles; the app refuses a change to a Scope field on the acting user's own row, comparing the loaded rows' keys, never the ids as passed. Enable and disable (SetEnabledAsync): a user store a write cannot rely on (anything but Identity's EF UserStore saving through the context with AutoSaveChanges on) answers Failed with one Error; then reach; NotOwn (one Warning) when the actor's loaded row's key is the loaded target's, never the ids as passed; Unchanged when Enabled as stored is already as asked (a disable so answered still sets EndSessions); a disable sets Enabled false and rotates the security stamp in one save and sets EndSessions; an enable sets NeedsPasswordLink for a user with no password hash. Create (CreateAsync(actingUserId, user, roleNames)), refused in order: the store, NoRules, ActorRefused, InTransaction (a transaction already open on the context, or an ambient one), EmptyRoleSet, RoleNotFound, RoleOutOfReach (a role outside Grant; one Warning), RoleSetRefused (the app's reason as the message), InvalidEmail, EmailInUse (one Warning naming no address; uniqueness is global, checked, not enforced), and unsaved changes of the app's own in the context (Failed, one Error). Then, in the context's execution strategy and one transaction, the user is created with no password and Enabled the negation of NewUserStartsDisabled (true by default, so it starts disabled), given its roles, and read back through the actor's Scope (a row it does not admit is NotFound); Done sets NeedsPasswordLink, for a reset link the app emails. Role change (SetRolesAsync(actingUserId, targetUserId, roleNames), the whole set): the store, reach on the target's current roles (so revoking needs no check of its own), NotOwn, InTransaction, EmptyRoleSet, RoleNotFound, RoleOutOfReach for a role to grant outside Grant, RoleSetRefused, Unchanged for the stored set, then pending changes; in one transaction the roles are added and removed and the stamp rotated, with Enabled set false when RoleChangeDisables is true (the default); Done sets EndSessions, Granted, Revoked, and Disabled only when this call disabled. Email change (ChangeEmailAsync(actingUserId, targetUserId, newEmail)): EmailChangeOff while AllowEmailChange is false (the default), before anything is read; the store, reach and NotOwn; InTransaction; RoleOutOfReach (one Warning) when the target holds any role outside the actor's Grant answer; InvalidEmail; Unchanged for the same address normalized; EmailInUse; pending changes. In one transaction one save sets the address, the user name too where it was the old address, EmailConfirmed false and a new stamp; Done sets EndSessions and PreviousEmail. Identity's email index is not unique, so only a unique index the app adds on NormalizedEmail stops two racing changes or creates storing one address. The transactional writes (create, role change, email change): a write crossing another change to the target answers IdentityFailed with ConcurrencyFailure and one Warning (a role row added past Identity included: role change reads the rows again first in its transaction, email change makes its reach admission again before its save and reads the rows and checks the grant again after it); after its save an email change reads the target back through Scope (NotFound); a create or a role change that wrote any row beyond what was asked answers Failed with one Error naming which. Every refusal or throw rolls back and puts the tracked state back, so a later save of the scope writes none of it; a commit that throws is read back by the concurrency stamp it wrote and answers Done when it landed. For every write a save Identity refuses is IdentityFailed with its codes in Errors and one Warning naming the step and the codes. Ending a lockout (UnlockAsync(actingUserId, targetUserId)): the store, reach and NotOwn (an actor ends its own only through the sign-in's rules); Unchanged when the target is not locked out as stored (lockout off, or no end strictly after now, now read from the injected TimeProvider, the test the list's LockedOut filter uses; under a clock other than the system's it can differ from Identity's IsLockedOutAsync, which the sign-in asks on the system clock); else LockoutEnd and AccessFailedCount are cleared in one save on the row the reach loaded, the stamp kept, and where two-factor is registered the code counters are cleared as the reset clears them; a counter reset that fails leaves it Done with one Warning. SolhigsonIdentityManager.UnlockAsync(userName) stays for a host verb. List (SearchAsync(actingUserId, UserSearch)): the users within reach by the same rule, narrowed by Text (through MatchText, only matches within reach kept), Role, Enabled, LockedOut, TwoFactorEnabled, NotSignedInSince and HasPassword; ordered by normalized user name then id, keyset-paged (UserPage: Rows of UserRow (User, Roles, HasPassword), NextCursor; PageSize 20, clamped to 1 to 100; a cursor that does not decode, or whose user is gone or out of reach, serves the first page); rows untracked, PasswordHash, SecurityStamp and ConcurrencyStamp set null; on SQLite LockedOut needs LockoutEnd mapped through a converter. Audit name lookup (ResolveDisplayNamesAsync(actingUserId, userIds)): UserNameLookup (Names, Failed) for AuditDisplay's resolvedName; the first 200 distinct ids, one query for the users the actor's Scope admits (the role rule does not apply), named by DisplayName; a refusal is no names, a throw no names with Failed true; a caller never passes an id a sign-in caller typed. Role edit (CanEditRoleAsync(actingUserId, roleName)): RoleNotFound (no line), RoleOutOfReach for a role outside Grant and NotOwn when the actor holds the role (one Warning each, naming the role's id, never its name), else Done; the editor calls it inside its write's transaction and again after its save. Grantable roles (GrantableRolesAsync(actingUserId)): the names of the stored roles the Grant answer allows, ordered ordinally, a role with no name or a stale normalized name left out; the writes still check every role. Options (UserAdministrationOptions, through services.Configure): NewUserStartsDisabled true, RoleChangeDisables true, AllowEmailChange false. Signals: lines under the logger name UserAdministration, each with the operation and both ids shaped (a lookup's, the count of ids), never an email, a name or a role's name. Error: NoRules, a user store a write cannot rely on, unsaved changes of the app's, rows written beyond what was asked, or a step that throws (the database, or the app's rules), naming the step and the exception's type, never its message. Warning: ActorRefused, NotFound, NotOwn, IdentityFailed, RoleOutOfReach, EmailInUse, and an unlock whose code counters were not all cleared. Information: each write done. A search, a lookup or a grantable-roles list answered writes no line. Every call adds one to the counter user_administration on the meter Solhigson.Framework.Identity, tagged method (can_administer, set_enabled, unlock, create, set_roles, change_email, search, resolve_display_names, can_edit_role, grantable_roles) and outcome (the outcome as UserAdministrationDiagnostics.Text writes it, or cancelled).