Appearance
Changelog
Release history is defined by signed or reviewed v* tags and the corresponding release workflow run. The entries below record what a consumer must know to upgrade; the tag history remains the canonical list of everything that shipped.
Public API or behavior changes must update the relevant module documentation and the package catalog in the same pull request. Breaking changes require a major version and migration guidance.
Every pull request into develop that ships a feat, fix, perf or breaking change adds its entry under ## Unreleased at the top of this page; the PR gate checks it. A change no consumer sees opts out with a Changelog: none (<why>) commit footer. Preparing a release renames ## Unreleased to the version.
11.10.1
Fixed
- Object storage: an upload whose metadata carries
Cache-ControlorContent-Disposition(as the GrydAuth profile picture does) failed on Azure Blob Storage with400 InvalidMetadata, because Azure accepts only metadata names that are identifiers. The two keys, matched case-insensitively, now become the object's own HTTP headers on every provider:BlobHttpHeaderson Azure, the object headers on S3 (they were stored asx-amz-meta-*, which a CDN ignores) and the object fields on GCS (where the metadata was dropped). On Azure, any other name that is not an identifier is dropped with a warning instead of failing the upload. See Upload: object headers and metadata.
11.10.0
Added
- Advisory locks:
IAdvisoryLock(AcquireAsync,TryAcquireAsync),AdvisoryLockKey(For,ForPlatform) andAddGrydAdvisoryLocks<TContext>(), transaction-scoped PostgreSQL locks keyed by namespace, tenant and name. See Advisory locks. - Version token:
IVersioned,ApplyVersionedConcurrency(),VersionStamper,AddGrydVersionedEntities(),UseGrydVersionedEntitiesandExpectVersion<TEntity>. See Optimistic concurrency. - Append-only entities:
IAppendOnly,AppendOnlyGuard,AppendOnlyEntityException,AddGrydAppendOnlyEntities()andUseGrydAppendOnlyEntities. See IAppendOnly. - Tenant-created fact:
AuthTenantCreatedV1(kindauth.tenant.created, version 1) for root and child tenants, on theTenantLifecycleStreamstream, acknowledged byauth.acknowledge-tenant-created-v1. See Tenant-created fact. - Per-tenant recurring jobs:
IPerTenantRecurringJob, fed by the new core portIActiveTenantDirectoryandActiveTenant(read inside a system scope). See Listing active tenants and Per-tenant recurring jobs. - Audience notifications:
SendAudienceNotificationCommand,GrydNotificationsOptions.MaxAudienceRecipientsand the core portIUserAudienceResolverwithUserAudience,UserAudienceKindandAudienceMember. See Audiences.
Changed
- The core exception handler maps
DbUpdateConcurrencyExceptionto 409DB_CONCURRENCY_CONFLICT, the code GrydAuth already returns, and logs it as a warning (it was an unhandled 500). It covers stale versions, rows removed between read and write, and cross-tenant writes refused byProtectTenantWrites.
Upgrading
- Hosts that enforce outbox route admission must
AdmitRoutethe newauth.tenant.createdv1 kind in the same release. No migration is required.
11.9.0
Added
- Nested unit of work:
INestedUnitOfWork.ExecuteNestedAsyncruns an operation in a savepoint (or in its own transaction when none is open) and keeps or discards it byNestedOutcome, so an idempotent route can undo part of an act and still answer 2xx. Registered byAddGrydAuditablePersistence. See Idempotent act routes. TransactionBoundBuffer<T>, the structure for work tied to a transaction that follows savepoints.- After-commit effects:
IAfterCommitEffects,AddGrydAfterCommitEffects<TContext>()andUseGrydAfterCommitEffects, with theGryd.Infrastructure.AfterCommitmeter. See After-commit effects. [NotIdempotent("reason")]exempts a route, documented in OpenAPI asx-gryd-idempotency. The host fails to start when[Idempotent]and[NotIdempotent]meet at the same level or an option cannot work.- Per-route response limit:
[Idempotent(MaxStoredResponseBytes = n)]andMaxRouteStoredResponseBytes. The ceiling is the greater of it andMaxStoredResponseBytes, so hosts that raised the latter keep starting. - Subject of the key:
IIdempotencySubjectResolver,AddGrydIdempotencySubjectResolver<T>()andIdempotencySubjects.Derive. - Metrics of the filter: meter
Gryd.API.Idempotencywith thegryd.idempotency.requestscounter and thegryd.idempotency.claim.durationhistogram, exported by default byGryd.Observability.OpenTelemetry. - Stored response headers:
GrydIdempotencyOptions.ReplayedResponseHeaders(opt-inResponseHeaderscolumn). - Storage modes
Full,StatusOnlyandEncryptedper route (opt-inStorageModecolumn), withIdempotent-Replay-Degradedwhen a body cannot be decrypted.AddGrydIdempotencynow callsAddDataProtection(). - Settled refusals:
[Idempotent(Refusals = IdempotentRefusals.Store)],IdempotentRefusalResultandGrydBaseController.SettledRefusalstore a 409 or 422 business refusal (opt-inStoredRefusalsfeature, which replaces the status check of the table). The code travels in thecodeextension of theProblemDetails. IdempotencyHeaderslists the headers of the feature andExposedToBrowsers; the GrydAuth CORS policy exposes them.
Columns and the check need a migration in the product only when the matching feature is turned on; see Upgrading to 11.9.0.
Changed
- GrydAuth reads the session clock from the registered
TimeProvider: the instant a login (native, first-login or federated) begins the session, the issue time and expiry of each refresh token, the refresh token's lifetime validation and the session-ceiling check.AddApplicationGrydAuthServicesandAddInfrastructureGrydAuthServicesregisterTimeProvider.SystemwithTryAddSingleton, so nothing changes unless a host registers its own clock, which lets a test move a session past its ceiling without waiting for it. The affected services keep their constructors and gain an overload that takes the clock.
Fixed
- Audit: events of work undone by a rolled-back savepoint are no longer recorded. A savepoint failure used to skip the trail of a transaction that then committed; the transaction is now treated as aborted (PostgreSQL turns that commit into a rollback) until a
ROLLBACK TOsucceeds, which recovers the trail of the data that was committed.
11.8.0
Added
- GrydAuth resolves the effective permissions of many users of a tenant in one call.
IEffectivePermissionBatchReader.ResolveManyAsync(userIds, tenantId), registered byAddGrydAuthReadersand by the writable composition, returns one entry per distinct id with its permission names, direct or through a role, for up to 500 ids (MaxBatch) in a single query. A membership must be in force and the account active; an unknown id, another tenant's or one without a membership in force comes back with an empty set. It reads committed data at the call, without cache, and works in a Worker job under an explicit tenant frame. See Read-only readers.
11.7.0
Added
- GrydFiles reads the state of many files of a consumer scope in one call.
IFileStore<TScope>.GetManyAsync(fileIds, tenantId)returns, for up to 100 ids (FileStoreLimits.MaxFilesPerRead), whatGetAsyncanswers for each: state, rejection code, upload expiry, last verdict, retention, legal hold and the tombstone. One query, read from the database at the call; it works without a request (a Worker job), follows the order of the ids, and leaves out any id that does not exist, is another tenant's or another scope's, or was reserved and not yet confirmed. See Reading many files.
Fixed
- GrydAuth:
ITenantAdministratorReaderreturned an empty list for tenants with an administrator. It readupdate:tenants, which theAdminrole the module provisions does not hold, so the seeded administrator and every member with theAdminrole were left out. The criterion is now a permission of its own,receive:tenant-admin-notices, that designates who receives the warnings and opens no route; theAdminrole holds it. The rest of the rule is unchanged (members of the tenant only, an active, unlocked account and a membership in force; no group administrator nor platform operator). See Read-only readers. - The migration
AddTenantAdministratorNoticesPermissionadds the permission to every existing tenant and grants it to the tenant'sAdminrole. So that nobody warned before stops being warned, it also grants it to every role and every member that heldupdate:tenantsin the tenant. A custom role made by a tenant to administer it does not receive it otherwise: grant it explicitly. Holdingupdate:tenantsalone no longer makes a member an administrator for this reader.
11.6.0
Added
GrydFiles answers a consumer scope's health in one call.
IFileStore<TScope>.GetScopeHealthAsync(tenantId, infectedSince)counts the scope's files inFailed, in quarantine, condemned since a date and, of those, condemned after release. It works without a request (a Worker job) and never counts another scope or tenant. See Scope health.StoredFilekeeps the owner declared at confirmation (DeclaredOwnerScope,DeclaredOwnerKey) and the condemnation (CondemnedAt,CondemnedAfterRelease). The migrationFiles_ScopeHealthadds the columns, two partial indexes and backfills what the record still shows; a file condemned on its first scan before this version is not attributed to its scope.GrydAuth adds
ITenantAdministratorReader, registered byAddGrydAuthReadersand by the writable composition.ReadAsync(tenantId, afterUserId, limit)returns the user id and e-mail of each administrator of the tenant, in keyset pages: a member who holdsupdate:tenantsin it, directly or through any role, with an active, unlocked account and a membership in force. The criterion is the one that lets a session administer the organization, so a product no longer infers it from a permission or a role name of its own. Group administrators and platform operators are not returned. An empty list means the tenant has no administrator. See Read-only readers.GrydAuth adds
IRoleReaderandIRoleHolderReader, registered byAddGrydAuthReadersand by the writable composition.IRoleReader.GetAsync(tenantId, roleId)returns the role'sId, currentNameandIsSystem, ornullwhen it was removed, does not exist or belongs to another tenant.IRoleHolderReader.ReadAsync(tenantId, roleId, afterUserId, limit)returns the user id and e-mail of the members assigned the role, in keyset pages, under the same rule asITenantAdministratorReader: an active, unlocked account and a membership in force. A worker can now go from a role stored by id to its people. See Read-only readers.Gryd.API makes act routes idempotent with
[Idempotent]. The client sends anIdempotency-Keyheader; a repeat of the same request returns the stored response withIdempotent-Replayed: true, the same key with a different request is refused with 422IDEMPOTENCY_KEY_REUSED, and concurrent repeats wait for the first one. The record lives in the product's own context (modelBuilder.AddGrydIdempotencyRecords(schema)plus a migration) and commits in the same transaction as the act. Register withAddGrydIdempotency<TContext>(); published routes can accept the key as optional. See Idempotent act routes.GrydAuth adds verified user identity: one CPF per person per tenant, confirmed by a second person. The in-process
IUserIdentityReader.CheckIdentitiesAsync(userIds, tenantId)answers up to 500 users in one command with an opaque, tenant-boundPersonKeyand never the CPF. Each change publishes the factAuthUserIdentityChangedV1(auth.user-identity.changed, version 1) and an audit record in the same transaction. The permissionsverify:user-identityandreveal:user-identity-documentare granted to no default role. The routes areuser-identity-requests(create, list, get, approve, reject) anduser-identities/{userId}(status anddocument/reveal). The feature is opt-in: without theGrydAuth:Security:PersonKeysection creating, approving and revealing answer 503 (listing, reading, rejecting and the status keep working), the reader answersNotVerifiedand the release is a non-breaking minor. A host that buildsUnitOfWorkby hand or implementsIGrydAuthUnitOfWorkmust add the two new repositories (see Changed). See Verified user identity.
Changed
UnitOfWorktakes two more repositories (IUserIdentityRepository,IUserIdentityRequestRepository) in its public constructor, andIGrydAuthUnitOfWorkgains the matching two members, asTenantLinkRequestsdid. A host that resolves them through DI is not affected. Code that constructsUnitOfWorkby hand or implementsIGrydAuthUnitOfWorkoutside this repository must add the two repositories.
Fixed
SensitiveDataMasker.MaskCpfno longer emits a stray space (***.***. 789-**became***.***.789-**), and any text that does not have exactly 11 digits now gets the full mask***.***.***-**. The change reaches the Audit export of personal data (AuditExportPersonalData).
11.5.1
Security
- GrydCrud and GrydReports move AutoMapper from 16.1.1 to 16.3.0, which fixes two high-severity denial-of-service advisories: unbounded recursion that escapes
MaxDepth(GHSA-gpwp-5797-mjff) and unbounded recursion with constructor parameters (GHSA-6vhm-j9h7-f9gh). A consumer that pinned AutoMapper itself to clear the advisories can drop the pin. No public API or mapping behavior changes.
11.5.0
Added
- A domain failure can point at the request field it refuses.
Result.FieldFailure(field, message, code)andResult.FieldFailure(fieldErrors, code)(also onResult<T>) keep the rule's code, and so its HTTP status, and answererrorsas an object by field, the same shape asVALIDATION_ERROR. A failure without a field answers as before. See Erros por campo.
11.4.1
Added
- GrydNotifications renders the template in the locale a send asks for.
SendNotificationCommand,ScheduleNotificationCommand(through itsNotification) andSendEmailCommandtake an optionalLocale(up to 10 characters), passed to the existing 4-step template fallback. A send without it renders as before, and its operation hash does not change.
11.4.0
Added
- GrydNotifications records what an e-mail provider reports after the send, per recipient (
Delivered,TransientBounce,PermanentBounce), throughIEmailDeliveryFeedback. Each change is published after commit to the product'sIEmailDeliveryFeedbackHandlerby the durable delivery worker. Every e-mail carriesX-Gryd-Notification-Id, and the notification stores the provider's message id.GrydNotifications.Infrastructure.SendGridaddsMapGrydSendGridEventWebhook, a signed Event Webhook receiver. Apply the migrationAddEmailDeliveryFeedback. See Delivery feedback and ADR 0017. - GrydNotifications asks the product's
INotificationDeliveryPolicyimplementations before delivering, on every send path (/send,/schedule,/email,/pushand the in-app command). A policy decides per recipient and may suppress one with a product code. The suppression is stored on the recipient (userId,suppressionCode,suppressedAt) and counted ongryd.notifications.suppressed. Register a policy withAddGrydNotificationDeliveryPolicy<T>(). With none registered, nothing changes. Send commands acceptnotificationTypeandentityKey, andRecipientDtoacceptsuserId. A send that leaves them out keeps its operation hash. A send whose recipients are all suppressed ends with the new statusNotificationStatus.Suppressed. Direct push and in-app fail withNOTIFICATION_SUPPRESSED. A failing policy fails the send withNOTIFICATION_POLICY_UNAVAILABLE(503). Apply the migrationRecipientDeliveryPolicy: three nullable columns onnotifications.notification_recipients.INotificationTelemetry.RecordSuppressedhas a default implementation. See Delivery policy and ADR 0016. - GrydAuth keeps the governance contacts of a tenant: up to five people outside the organization, without an account, whom a product notifies about control acts. Only the platform reads and writes them, through
GETandPUT /api/v1/tenants/{tenantId}/governance-contacts?scope=globalwith the new platform-only permissionmanage:tenant-governance-contacts. A tenant administrator cannot reach them. ThePUTreplaces the whole list, only applies to a company tenant, and accepts an optionalIf-Match. Each change writes a masked audit line and the factauth.tenant-governance-contacts.changedV1, with the previous and the new list.ITenantGovernanceContactReaderreads them in process. Apply the migrationAddTenantGovernanceContacts. A host withRequireRouteAdmissionmust admit the new kind. See Governance contacts. - GrydNotifications closes the push contract.
PushErrorCodeslists the failure codes a provider returns, the reason recorded on the attempt and which ones are permanent; in durable delivery a permanent failure is dead-lettered.POST /api/v1/device-tokensandDELETE /api/v1/device-tokens/{id}register and remove the caller's own devices, under the session tenant, and registering again reactivates a token. The FCM provider honorsPush.MaxDeviceTokensPerMulticast,Push.AutoRemoveInvalidTokensandPush.DefaultTimeToLive, and sends aWebpushConfig. With push on and no provider the host warns at startup, and refuses to start with the newPush.RequireProvider = true. Apply the migrationDeviceTokensUniquePerTenant. See Push channel.
Changed
- The SMTP sender classifies a recipient refused during the conversation. A
5xxfails withEMAIL_RECIPIENT_REJECTED, reasonBounced, and is no longer retried; in durable mode it is dead-lettered instead of waiting for reconciliation. A4xxfails withEMAIL_RECIPIENT_DEFERREDand is retried.Bouncedjoins the defaultNonRetryableReasons. - The unique index of
device_tokensmoves from(Token, Platform)to(TenantId, Token, Platform). It is less strict than the old one, so the migration does not fail on existing rows. - The FCM provider's error codes change from
FCM_*toPUSH_*. They were not documented. - Because
Push.Enableddefaults totrue, a host without a push provider now logs a startup warning.
Fixed
- GrydNotifications resolves the platform template (no tenant) as the fallback of an organization when the host sets
OptionalTenantVisibilityMode.CurrentTenantOnly. The strict filter hid it, so steps 2 and 4 of the fallback never matched and a product had to copy its templates into every tenant. The store now reads the platform templates in a global-only query with the filter still on. Reads by id and the listing keep the host's visibility. No public API changes. See Platform templates under strict visibility. - The FCM provider no longer reports
Sentwhen no device of a multi-token send accepts it. - An FCM
InvalidArgumentcaused by a bad payload no longer deactivates every token of the batch: it fails withPUSH_INVALID_PAYLOAD. Only an unregistered token, or one of another sender, is deactivated. - A send to a single token now deactivates a dead token, like a multi-token send.
- The stale-token cleanup counts from the registration date, so a device that was never used is no longer deactivated on the first pass.
11.3.0
Added
- GrydAuth adds
ITenantReader, registered byAddGrydAuthReadersand by the writable composition.GetAsync(tenantId)returns the tenant'sIdandCreatedAtUtc, active or not, ornullwhen the tenant does not exist or was removed. Like the other Auth readers it requires an explicit frame of that tenant. A worker can now read when a tenant was created without the unit of work. See Read-only readers.
11.2.0
Added
- GrydReports streams a CSV straight into the response through
POST /reports/export, with no execution record, file or cache. Templates register withAddReportExport<TRecord, TParams>or, for an entity, withAddEntityExport<TEntity>. The request may pick thecolumns, andGET /reports/export/{templateId}describes the columns and filters. See Streaming export.
Fixed
- GrydFiles registers
CandidateScopesas scoped. As a singleton it took the scopedITenantAmbient, so a host with scope validation on (theDevelopmentdefault) failed to build with "Cannot consume scoped service ITenantAmbient from singleton CandidateScopes". Each job execution now records its cross-tenant selection with the auditor of its own scope. No public API changes.
11.1.0
Added
IAuditTrail<TUnitOfWork>andIPlatformAuditTrail<TUnitOfWork>stage an audit record in the act's transaction, with one delivery throughAddAuditSource. New packageGryd.Observability.EntityFrameworkCore. See Transactional audit trail.OutboxEnvelope.Unorderedbuilds a message that is its own stream.
Changed
- GrydFiles and the GrydAuth membership trail stage through that path. Pending messages of the older kinds are still delivered. Auth membership rows no longer record
producerId,consumerId,messageId,causationIdorcorrelationId.
11.0.1
Fixed
AuditableEntityStamperfillsDeletedBywhen the domain soft-deletes a tracked entity without an author. See Unit of work.
11.0.0
Contract changes (GrydAuth, Gryd.Infrastructure)
See Migrating to v11 for each change.
PlatformGrant.OfRolesis no longer public; useIPlatformAuthorizationCatalog.GrantOf.IRolePermissionComposer.ComposeFromCatalogTemplatesplits intoComposeNewFromCatalogTemplateandConvergeFromCatalogTemplate.AuthorizationCatalogContributiongainsRetiredPermissionsandRetiredRolePermissions.IUserRelationshipService, which had no caller, is removed.- Changing a user's roles or direct permissions now advances
UserTenant.AccessChangeSequence: a concurrent change to the same link fails with a concurrency conflict.RolesgainsAccessChangeSequence. - Outside Development, a host refuses to start while the seeded admin still has the public password.
GrydAuth.Infrastructureno longer bringsGrydAudit.API; a host that wants those routes references them.- The GrydJobs dashboard is read-only; retry, delete and trigger go through the API routes, which leave a trail.
Added
GrydAuth publishes
auth.user-role.changed,auth.user-permission.changedandauth.role-permission.changedthrough the outbox, andIPermissionHolderReaderanswers who holds a permission.AddPlatformCatalogContributor<T>lets host code add platform roles; the API never can. A catalog contribution can retire permissions, applied only by a reconciliation.ISystemService,ISystemServiceExecutorandAddSystemService<T>run tenantless routines limited to the global entities they declare. See Background tenancy.OutboxMessagingBuilder.DeclareRouteWithoutConsumerscompletes a kind that has no consumer by decision.AddGrydAuditablePersistence<TContext>andEfUnitOfWork<TContext>give any context soft delete, authorship and a unit of work, by opt-in.CurrencyCodevalidates ISO 4217 codes in circulation.IUserCultureReader, andIUserDirectoryReaderin the writable composition too.SetGrydHostRoleandAddGrydBackgroundLoop: a producer host enqueues and schedules without a job server or loops.GET /api/v1/tenants/{tenantId}/permissions/catalog?scope=returns the permission catalog of the organization named in the route, with the contract ofGET /permissions/catalog. Inglobalscope an admin screen can read the catalog of any organization (to grant a user a direct permission there);tenantreaches only the session's own organization. Reads needread:tenants.UserTenantAccessDto.permissionIdscarries the ids of each link's direct permissions (the same set aspermissions, by id), so the users screen inglobalscope can grant and revoke them per organization.ApplyGrydAuthMigrationsAsync(GrydAuthMigrationOptions)runs optional steps after the GrydAuth migrations.GrantSeedAdminConfiguredAppId = truegives the seeded admin (admin@local.com) access to the host'sJwtSettings:AppId, so the AppId a deploy pipeline injects works on the first login. The migration seed still binds only the framework's development AppId, because its data is fixed when the migration is generated. The grant is additive and idempotent, and never restores a revoked AppId. The overload without options is unchanged, and the templates turn the step on in Development.
Contract changes (GrydFiles 10.1.0)
GrydFiles brings the module to the specification v1.13 in release 10.1.0. v10.0.0 shipped without this work, and the maintainer chose a minor release because the module had no consumer in production; the contract breaks below are still breaking for a host that composes or consumes the module. The full guide, with every signature, migration and setting, is Migrating to v10.1.
- In-process ports bound to a scope.
IServerFileStoreis nowIServerFileStore<TScope>; a module registers withAddGrydFilesConsumer<TScope>(o => o.Handler<THandler>())— theIFileOutcomeHandleris mandatory — and usesIFileStore<TScope>. Confirming and reading carry theownerKey(CompleteUploadAsync(fileId, ownerKey),OpenReadAsync(fileId, tenantId, ownerKey)). No module permission is checked in process. See Registered consumers and The verdict contract. - Composition.
AddOutboxMessaging(o => o.AddGrydFilesOutbox(...))andAddOutboxWorker()deliver the audit trail and the verdicts after the commit; anIFileActorDirectorychecks the authors of an erasure. - Database.
Files_GF_02_RemoveDedupe,Files_GF_08_ActorAndOutboxandFiles_GF_15_LegalHoldHolders. The last refuses to apply while anystored_filesrow still has the oldLegalHoldbit on. - Storage. Two members on
IObjectStorageServiceandIObjectStorageProvider(GetSignedUploadHeaders,CopyAsync); uploads write under_transit/(expire that prefix after a day); the S3 adapter presigns with Signature V4 for the whole process. - HTTP.
GET /files/{id}/scan-attemptsis paginated;POST /files/{id}/rescanis new;PUT /files/{id}/retentiontakes areasonwithlegalHold, and the hold is per holder; a purge beforeretainUntilor of aPermanentfile needserasure: true; the reference routes refuse any scope not declared withManagedThroughHttpSurface(). Nine error codes are new. - A host that composes
AddGrydFileswithoutAddGrydFilesOutboxdoes not start (FilesOutboxRequirement, checked at start like the scan-engine requirement). The error names what to compose. A host that provides its own outbox ports (a test host with fakes) says so withUseHostOutbox()on the module builder. Thegryd-apiandgryd-moduletemplates compose the outbox and the worker withIncludeFiles. IFileAuditTrailgained two methods,ReleasedFileInfectedandReleasedObjectChanged: a host that implements the port itself implements them. A re-scan that condemns a released file writes a new audit action,stored_file.rescan_condemned(anUpdated, no purge reason,Cause=signatureorobject-changed; audit contract §6.3). Deploy the draining side first (see the upgrade order in the migration guide).IStoredFileLock.TryLockAsyncreads through the session's filter (the job takes it in the tenant of the record, RN-GF-08): a caller that locked a record outside its tenant now getsAbsent. The recurring sweeps select across tenants and treat each record in its own;FileSweepMetrics.MeterNameis public and a new counter,gryd_files.sweep.candidate_unreadable, reports a selected record that could not be read in its tenant.- Dedupe is gone from the first version:
CanonicalFileIdand its indexes were removed. - Dependent modules. GrydReports, GrydNotifications, GrydAudit.Export and GrydAudit.Integrity register as consumers; a notification refuses an attachment its sender did not upload.
Changed
EfCoreAuditStore(GrydAudit) stores each record under theAuditEntry.Idit receives and is idempotent by it: a repeatedSaveAsyncorSaveBatchAsyncof the same entry, including a concurrent one, leaves one row and does not throw.AuditLog.FromEntrykeeps the entry's id andAuditLog.BuildergainsWithId. No schema change; an entry built without an explicit id behaves as before.
Security
Consumer identity exports committed tenant permissions. The authenticated subject, original generation and tenant bind a primary snapshot, without cached fallback. Invalidated/ineligible evidence (including lockout) returns simple 401; unavailable reader evidence returns 503; a complete empty set remains 200. Existing validation statuses and membership checks remain. Composition change: manual construction of
ConsumerIdentityControllermust supplyICommittedCallerPermissionReaderinstead ofIEffectivePermissionResolver; normal Auth DI already supplies it. Roles/platform stay separate. See Remote identity consumer.Tenant grant ceilings use committed permissions bound to the authenticated generation. The shared guard refuses a revoked catalog grant even when Redis still holds an older set; it covers user grants and role composition, preserving the existing policy. Invalidated sessions return
401 SESSION_INVALIDATED, excess remains403 ROLE_ASSIGNMENT_ESCALATION_BLOCKED, and unavailable authority returns503 ROLE_GRANT_AUTHORITY_UNAVAILABLEwithout a cached fallback. Composition change: direct/manual hosts must provide the requiredICommittedCallerPermissionReaderandICurrentUserService; normalAddGrydAuthsupplies them. This snapshot does not fence a later write. See Authorization.POST /rolesapplies the anti-escalation ceiling to its initial permission list. A tenant administrator could create a role already carrying a catalog permission it did not hold, whichPUT /roles/{id}refused to add. Every route that widens a role now goes through one composer (IRolePermissionComposer), soPOST /roles,PUT /roles/{id}andPOST /roles/{roleId}/permissions/{permissionId}give the same answer, and an architecture test keeps any other type from callingRole.AssignPermission.Behavior change:
POST /roleswith a catalog permission the caller lacks answers403 ROLE_ASSIGNMENT_ESCALATION_BLOCKED, and the role is not created. Permissions the tenant invented stay free; aglobalscope and a platform authority keep their ceiling. Upgrade: a client that relied on the old behavior grants the permission to its caller first. A host that put permissions on a role in its own code callsIRolePermissionComposer;Role.AddPermissionwas removed (use the composer, orAssignPermissionin test fixtures). See Authorization.
Documentation
- Reconciled the package and template guides with current shipped capabilities, defaults and limitations. The template option contract check validates advertised option names only; it does not validate option values, execute shell commands or compile C# examples. No runtime behavior or released package version changes in this documentation update.
Contract changes: QueryKit custom lists
CustomListController<TRequest, TItem> now answers the platform's list envelope, the same PagedResult<T> every module list and the Gryd.UI CrudDataSource use. The old { data, meta } body left a Gryd.UI grid empty without an error, because the data source reads items. The sort map is now the only list of sortable fields. See Custom list endpoints.
HTTP
| Before | After |
|---|---|
200 body { "data": [...], "meta": { page, pageSize, totalCount, totalPages, hasNext, hasPrevious, sortBy, sortDirection } } | PagedResult<T>: { items, totalCount, pageNumber, pageSize, totalPages, hasNext, hasPrevious, scope }, with scope: null. The sort is no longer echoed |
sortDirection=Descending (the CRUD spelling Gryd.UI sends) sorted ascending, silently | asc/desc and Ascending/Descending are both read, case-insensitive; anything else stays ascending |
Unsupported sortBy: 400 VALIDATION_ERROR with an English detail that listed the fields | Same status and code; the catalog text (Details.SortFieldNotSupported) in the request culture, on detail and on errors.sortBy |
A field in the query's list but not in the sort map passed validation and was ignored; one in the sort map but not in the list got 400 | One list, the sort map's: what may be requested is what can be ordered. With no sort map, any sortBy is refused |
Rows sharing the sort value could move between LIMIT/OFFSET pages | QuerySortMap.SetTieBreaker(row => row.Id) orders ties by a unique key, ascending, and is the only ordering when no field applies |
.NET API
| Before | After |
|---|---|
A query subclass (ListInvoicesQuery : CustomListQuery<,>), as documented, failed at runtime: MediatR found no handler for the subclass | CustomListQuery<TRequest, TItem> is sealed and takes only the request; the controller builds it |
CustomListQuery(request, allowedSortFields), CustomListQuery.AllowedSortFields | Removed. The fields are the sort map's |
CustomListController.CreateQuery (abstract) | Removed; a derived controller declares only its route and constructor |
IQuerySpecBuilder<TRequest, TReadModel> | Extends IQuerySortFieldProvider<TRequest> (AllowedSortFields, IsSortFieldAllowed) and requires TRequest : IAggregateQueryRequest; DefaultQuerySpecBuilder forwards to the sort map |
sortBy validated in the controller and again in the handler | Only CustomListQueryHandlerBase, as Result.ValidationFailure on sortBy |
ProblemDetails translated a key in the flat errors list only | Per-field errors (Result.FieldErrors) are translated field by field too |
Consumers mapped CustomListQueryResult<TItem> by hand | CustomListQueryResult<TItem>.ToPagedResult() |
QueryMeta, QueryMetaFactory | [Obsolete]: no framework endpoint returns them |
Upgrade: a client that read data/meta reads items and the top-level paging fields. In the consumer: delete the query subclass and the CreateQuery override, move every sortable field into the sort map (the compiler points at each place), drop any request validator rule that repeats the sortable fields, remove any conversion of the body to PagedResult<T>, and add SetTieBreaker to every sort map whose fields are not unique. A custom IQuerySpecBuilder implements the two sort-field members.
Contract changes (Mudanças de contrato, 9.x)
The audit trail now has a readable HTTP contract, published as audit logs contract (the source of truth, §14 of that page lists exactly these rows). The API had no consumer, so it replaces the previous one in a minor release. The module is documented in GrydAudit.
HTTP
| Before | After |
|---|---|
GET /audit-logs/search | GET /audit-logs (the /search route no longer exists) |
Paged response AuditLogPagedResultDto (page, hasNextPage, hasPreviousPage) | The framework's PagedResult<T> (pageNumber, hasNext, hasPrevious, scope) |
pageSize above 100 was silently lowered to 100 | 400 VALIDATION_ERROR |
changeTypeDisplay (English) | Removed. The label comes from the catalog |
AuditLogSummaryDto in the list | AuditLogItem (§3.1) |
additionalData (JSON text) | metadata (object) |
details[].hasChanged | Removed (every exposed detail is a change). masked and truncated are added |
400 of the history route as plain text ("Entity type and ID are required.") | problem+json with VALIDATION_ERROR |
| A session with no tenant got an empty list | 403 TENANT_CONTEXT_REQUIRED |
Routes outside the scope model, authorized only by the read:audit-logs policy (403 MISSING_PERMISSION) | Scoped domain audit-logs (tenant only), announced in the session's capabilities; without the permission, 403 SCOPE_FORBIDDEN |
changeCount always 0 | The real value, without technical fields |
| Scalar filters | Repeatable (§2.3) |
Only the routes /{id}, /entity/..., /user/... and /search existed | New routes: catalog, facets, summary, entity/.../state, exports (create, follow, download), {id}/integrity and integrity-checks (create, read) |
No readable action, outcome or category; category with Authorization and MultiTenancy | action, outcome, actorType and category closed to security or data (§2.5) |
| No names: type and GUID | entityDisplayName, userDisplayName and systemActor, stored at the time of the event (§3.1) |
| Technical and sensitive fields with no handling in the detail (the sensitive field's row did not exist) | Technical fields hidden (§2.6); a sensitive field comes with masked: true and null values |
A logical deletion (IsDeleted) came out as *.updated, changeType = 2, with no visible field | changeType = 3 and {entity}.deleted (§2.5). The summary counts it, the changeType=Deleted filter finds it and the state carries deletedAt. A restoration stays *.updated |
Access-Control-Expose-Headers with ETag only | Also X-Audit-Search-Scope and Content-Disposition: a front on another origin reads the search scope and the export file name |
| New permission | export:audit-logs-personal-data, to export with the e-mail and IP unmasked (§9). The Admin role holds it by default (new tenants, and existing ones through a migration) |
Recording and host operation
| Before | After |
|---|---|
| The event was written before the business commit, and a failed operation left a record | Written only after the commit (and, in an explicit transaction, only on commit). A failure or rollback leaves no record. An error writing the trail after the commit does not throw: it is logged and counted in gryd_audit.recording.events_lost |
| An update of a session counter (last login, attempts) produced an organization-less "user updated" | No event (§6.3) |
Retention cleanup off by default; AuditLogCleanupService and AuditRetentionOptions only in the documentation | Cleanup on by default (Observability:Audit:EnableAutomaticCleanup=true, RetentionDays 365), platform events included. An existing host starts deleting trail older than 365 days when it upgrades. New options: CleanupBatchSize and CleanupInterval; CleanupSchedule is now used (GrydJobs job, once per cluster) |
| Export and integrity did not exist | Opt-in packages GrydAudit.Export and GrydAudit.Integrity, over GrydFiles, GrydJobs and GrydNotifications. Without them, 503 AUDIT_EXPORT_UNAVAILABLE and 503 AUDIT_INTEGRITY_UNAVAILABLE |
| No file profiles | The host declares gryd.audit-export (text/csv and application/pdf) and gryd.audit-integrity (application/json, retention Permanent); a host with the file module does not start without them |
.NET API
| Before | After |
|---|---|
SearchAuditLogsQuery, GetAuditLogsByEntityQuery, GetAuditLogsByUserQuery | ListAuditLogsQuery (list, history and activity) and GetAuditLogByIdQuery, which return Result<T> |
IAuditLogService, AuditPolicies | Removed. To record outside SaveChanges, use IAuditStore |
IAuditLogRepository.GetByEntityAsync, GetByUserAsync, CountAsync and AuditLogFilter | SearchAsync(AuditLogCriteria, AuditLogPaging) and GetByIdAsync |
Upgrade: a host that keeps its trail forever sets Observability:Audit:EnableAutomaticCleanup to false before upgrading. A host that wants the export or the proof adds AddGrydAuditExport() and AddGrydAuditIntegrity() and the file profiles, as in Getting Started.
Added
DELETE /api/v1/users/{id}/tenants/{tenantId}?scope=globaltakes a user out of ONE organization — the subtractive counterpart ofPOST /users/{id}/tenants. The link goes with its role and permission grants, the user and its other links stay, and a removed default passes to another active link (the rule of the tenant-scopeDELETE /users/{id}).delete:usersin a platform role; any other scope is a400 SCOPE_NOT_SUPPORTED. A user without the link answers404 USER_NOT_FOUND, the protected seed administrator400 USER_CANNOT_DELETE_ADMIN. Contract: user delete contract §9.GET /api/v1/users?scope=global&tenantId={id}lists the users linked to that organization, active or deactivated link (tenants[].isActivetells which, so the operator can reactivate it), withroleNamematched on that link — the operator sees who is in it without switching into it (the routeGET /tenants/{id}/usersit replaces was removed by ADR 0011). It combines with the other filters, sorting and paging; an unknown id is an empty page, never a 404. Inscope=tenantthe parameter is ignored without an error: the organization is always the session's. Contract: users list filters.The administrator of a group reads a company's roles.
GET /api/v1/tenants/{tenantId}/roles/lookup?scope=tenantnow answers for a company of the session's group when the caller holdsupdate:tenantsin the group tenant — the rule ofPOST /tenants/{tenantId}/members/bulk, so the screen can offer the role the bulk link takes without switching into the company. Search andidshydration are unchanged; every other organization, and the rest of the company's configuration, stays a 404. The scope model gainedITenantResourceReach, a module's opt-in exception to thetenantrule of an organization resource. Contract: role lookup.
Security
Tenant administrator can hand out business permissions. Granting a role or a permission to another person is capped only on the permissions the platform's catalog defines; a permission the tenant invented (
requisition:create) no longer has to be held by the administrator who delivers it. Granting to oneself stays capped on everything. Until now the administrator could compose the role but got403 ROLE_ASSIGNMENT_ESCALATION_BLOCKEDwhen delivering it.Adminrole gainssecurity:unlock-userandsecurity:view-user-info, in the seed and, by migrationGrantUserSecurityToAdmin, in every existing tenant.security:record-failed-loginandsecurity:reset-failed-attemptsare deliberately not granted.Remote consumer hosts no longer read every tenant's rows.
AddGrydAuthRemoteConsumer(andAddGrydAuthTokenValidator, which delegates to it) validated the session and emitted itstenant_idclaim, but nothing moved that claim into the ambient tenant. Every GrydDbContextthen saw no tenant and, withRequireTenantOnReadoff by default, its query filter returned the rows of all tenants.- New Core middleware
TenantSessionMiddleware(app.UseGrydTenantSession(),Gryd.API): after authentication, the session'stenant_idclaim — and only that claim — is the ambient tenant of the request, restored when the request ends. Headers, query strings and route values are ignored. - New
app.UseGrydAuthRemoteConsumer(), required in consumer mode afterUseAuthentication()and beforeUseAuthorization(). Placed before authentication it fails every request; left out, the host logs an error at startup. - Consumer mode now forces
MultiTenancy:RequireTenantOnRead=true: a read without a tenant returns no tenant-owned rows. A consumer host whoseMultiTenancyOptionsturn it off does not start.
Upgrade: consumer hosts add
app.UseGrydAuthRemoteConsumer();right afterapp.UseAuthentication();. Authority hosts (AddGrydAuth) are unchanged. See Remote consumer.- New Core middleware
GrydAudit reads only the session tenant's audit trail. Any authenticated user could read the audit trail of any organization, old and new values included:
GET /api/v1/audit-logs/searchtook the tenant from thetenantIdquery parameter and returned every tenant when it was omitted, and the other read routes did not filter by tenant at all.Every read is now restricted to the tenant of the session, by a query filter on
AuditDbContextthat readsITenantSession:- A log of another tenant answers
404, the same as one that does not exist. - Logs with no tenant (platform events) are visible to no tenant caller.
- With no tenant in session, nothing is visible.
- Writes are unchanged: entries keep the tenant they were recorded with.
Reading across tenants, and reading platform events, is not available in this release.
- A log of another tenant answers
New permission
read:audit-logsgates the GrydAudit read routes. It is a tenant permission in theAuditcategory. GrydAuth grants it to theAdminrole template;GroupAdminandVisitordo not receive it. TheAddAuditLogsReadPermissionmigration creates it in every existing tenant and grants it to every existingAdminrole.
Fixed
A soft-deleted row no longer blocks its own re-creation. Unique indexes counted soft-deleted rows, which the query filter hides. Code that cannot see the old row inserts a new one, and the database refused it. For example, taking a role away from a user's organization link and giving it back through
PUT /api/v1/users/{id}?scope=globalanswered409 DB_DUPLICATE_CONFLICT.ApplySoftDeleteFilters()now also restricts every unique index of anISoftDeletableentity to live rows ("IsDeleted" = false, AND-ed with the index's own filter). It leaves alone an index whose filter already namesIsDeleted. An index that must stay unique across the whole history (a token hash, a provider id, an idempotency key) opts out with.IncludesSoftDeletedRows(). Contract: soft delete filters.Each module ships a
SoftDeleteUniqueIndexesmigration that recreates the affected indexes:- GrydAuth: user roles, user permissions and role permissions.
- GrydFiles: file references and the content dedupe of stored files.
- GrydJobs: job schedules.
- GrydNotifications: templates and device tokens.
- GrydReports: report definitions. Registering a template again after its definition was deleted now works. A schedule's scheduler job id stays unique across deleted schedules.
Upgrade: a host DbContext that calls
ApplySoftDeleteFilters()gets the same change for its own entities. Its nextdotnet ef migrations addrecreates its unique indexes on soft-deletable entities as partial indexes. Review that migration, and mark with.IncludesSoftDeletedRows()any index that must keep counting deleted rows.
Breaking changes
tenantIdis no longer a parameter ofGET /api/v1/audit-logs/search. A value sent anyway is ignored by model binding.- Every
/api/v1/audit-logsroute requiresread:audit-logs. A caller without it gets403. Grant it to any role other thanAdminthat reads the trail. - Removed from the .NET API:
SearchAuditLogsQuery.TenantId,AuditLogFilter.TenantIdandIAuditLogRepository.GetByTenantAsync. Remove the argument; the tenant is the session's. - A host that composes GrydAudit without a registered
ITenantSessioncan no longer read audit logs. Register one (GrydAuth orAddGrydTenancydoes). - The tenant of a request comes only from the session's
tenant_idclaim (ADR 0011, D18), in the GrydAuth host too:UseGrydAuth()now ends withUseGrydTenantSession(), and the token processor no longer readsX-Tenant-IDor?tenantId=. A global (selector) token runs with no tenant.- Removed:
AddGrydMultiTenancy/UseGrydMultiTenancy,TenantResolutionMiddleware,ITenantResolverand its five resolvers,GrydAuthBuilder, and theMultiTenancyoptionsTenantHeaderName,TenantQueryParameter,TenantRouteParameter,TenantClaimType,ResolutionOrder,RequireTenantandIgnorePaths(with theTenantResolutionStrategyenum andPrimaryStrategy). - Upgrade: a host without GrydAuth calls
services.AddGrydTenancy()andapp.UseGrydTenantSession()afterapp.UseAuthentication(). Clients that chose a tenant with a header or query string switch tenant instead.
- Removed:
- Tenant isolation is fixed behaviour, not configuration (ADR 0011, D16, D19, D20).
- Reads fail closed everywhere: with no tenant in session an
IRequireTenantentity returns no row, and anIOptionalTenantone only its global rows (CurrentTenantOnly: none). TenantSaveChangesInterceptoris attached toGrydAuthDbContexttoo, and its four guards are always on: stamp a new required-tenant row with the session's tenant (refused without one), refuse a change ofTenantId, refuse a row of another tenant in a tenant session, refuse writes under a group scope. An optional-tenant row is never stamped implicitly.- On an endpoint that allows anonymous access the request has no tenant, even with a bearer token.
- Removed:
MultiTenancyOptions.IsEnabled,RequireTenantOnRead,AutoSetTenantIdOnCreate,PreventTenantIdModification,RequireTenantMatchOnWrite,AutoSetOptionalTenantIdOnCreate,ITenantQueryContext.RequireTenantOnRead, the "multi-tenancy disabled" login path, and the remote consumer's ownRequireTenantOnReadguard. The interceptor's constructor takes only the tenant context.MultiTenancyOptionsis validated when first resolved. - Upgrade: remove those keys from the
MultiTenancysection. Code that reads or writes another tenant's rows outside a request (jobs, provisioning, sweeps) runs with the tenant filter bypassed or under that tenant; a lookup that must span tenants crosses the filter withIgnoreQueryFilters()and restates the tenant and soft-delete predicates.
- Reads fail closed everywhere: with no tenant in session an
- Speculative tenancy code removed (ADR 0011, D22, D24).
- Removed: the database-per-tenant set (
ITenantCatalogStore,InMemoryTenantCatalogStore,ITenantConnectionStringResolver,TenantConnectionStringResolver,ITenantDbContextOptionsFactory,TenantDbContextOptionsFactory,ITenantDbContextProviderConfigurator,ITenantMigrationOrchestrator,TenantMigrationOrchestrator,ITenantMigrationRunner,MultiTenancyDatabaseOptions),RequireTenantTokenAttribute,RequireGlobalTokenAttributewith theGlobalTokenOnlyandTenantTokenOnlypolicies,AddGrydTenantInterceptor, andMultiTenancyOptions.DefaultTenantId.MultiTenancyOptionskeepsOptionalTenantVisibilityModeandMaxGroupScopeTenantsonly. - Every entity a Gryd DbContext maps with a
TenantIddeclaresIRequireTenantorIOptionalTenant(an architecture test enforces it;UserTenant,OutboxMessage,DeliveryResolutionandAuditLogare the justified exceptions). - Upgrade: attach the interceptor with
options.AddInterceptors(sp.GetRequiredService<TenantSaveChangesInterceptor>()); replace[RequireTenantToken]with[Authorize]and[RequireGlobalToken]with[AllowGlobalAndTenantToken].
- Removed: the database-per-tenant set (
- One scope model:
?scope=tenant|group|globalon one route per resource (ADR 0011; released together with the gryd.ui change). Frontend migration guide: scope model migration.- Reach is decided by
IScopeResolverand oneIScopeAuthorityper scope.globalis a platform role on the user (platform-operator,platform-support), carried as theplatform_permissionclaim and granted throughPOST/DELETE /api/v1/users/{id}/platform-roles/{key}; a platform session may have no tenant.grouprequires full coverage of the group (403 GROUP_SCOPE_INCOMPLETEwithmissingTenants). Scope errors:SCOPE_NOT_SUPPORTED,SCOPE_FORBIDDEN,GROUP_SCOPE_INCOMPLETE,TENANT_CONTEXT_REQUIRED,SCOPE_GROUP_UNAVAILABLE. - Removed routes: every
/api/v1/admin/*route (users, tenants, tenant-link-requests, identity-providers, security/secret-protection). Use the same resource route with?scope=. - Removed permissions and role:
admin:system(no permission is a wildcard any more),manage:all-users,manage:all-tenants,read:all-usersand theSystemAdminrole. The anti-escalation guard has no override by permission name. - Removed from the .NET API:
AuthorizationCatalogDefinitions.SystemAdminRoleName,SystemAdminPermission,ManageAllUsersPermission,ManageAllTenantsPermission,ReadAllUsersPermission,SystemAdminRoleSeedId,RolesFor,IsPlatformScoped,PermissionTemplate.Reach,RoleTemplate.Scope,PermissionReachandRoleProvisioningScope(every catalog role is provisioned in every tenant);[ScopeCapable],ScopedQueryParameters,ScopeInvalidException,AddGrydScopeContract,ScopeErrorCodes.Invalid/NotAuthorised(SCOPE_INVALID,SCOPE_NOT_AUTHORISED),TenantScopeModes.All/TryParseandLoggingConstants.Headers.TenantId. A route that is not a scoped endpoint still refuses any?scope=other thantenant, now with400 SCOPE_NOT_SUPPORTED(guardUnscopedRouteScopeGuard, registered byAddGrydApiVersioning()), instead ofSCOPE_INVALID. - The
tenant_idtag of the ASP.NET Core server span comes from the authenticated session, never from theX-Tenant-IDheader. - A write asks for the same permission in every scope. The writes of the group hierarchy (
POST /tenants/{id}/children,PUT/DELETE /tenants/{id}/group,POST /tenants/{id}/children/bulk) requiremanage:child-tenantsinglobaltoo, which theplatform-operatorrole now holds;ScopedEndpointAttribute.PlatformActionwas removed. - Reference module:
POST /api/v1/reference/sales-ordersis a scoped write that exists only in the tenant scope (OnlyIn) and requires the newcreate:sales-orderspermission. A platform session gets403 TENANT_CONTEXT_REQUIRED(was400 REFERENCE_TENANT_REQUIREDfrom the handler), and?scope=group|globalgets400 SCOPE_NOT_SUPPORTED. - An organization addressed by id that is out of reach or does not exist answers
404 TENANT_NOT_FOUNDin every scope, including its configuration routes (/tenants/{id}/mfa-policy,/statsand the like), which answeredRESOURCE_NOT_FOUNDin the tenant scope (ScopeErrorCodes.TenantNotFound). TelemetryBehaviortakes the tenant session as an optional dependency: a host that callsAddGrydObservabilityBehaviors()without tenancy (no GrydAuth, no consumer mode, noAddGrydTenancy()) composes the pipeline and its spans carry notenant.id. The two constructors became one,(activitySource, tenant = null, enrichers = null).- Renamed in the .NET API:
User.IsSystemAdmin()→User.IsSeedAdmin(),AuthorizationCatalogDefinitions.SystemAdminUserSeedId→SeedAdminUserId,AuthMessages.User.CannotDeleteSystemAdmin→CannotDeleteSeedAdmin(the wire codeUSER_CANNOT_DELETE_ADMINis unchanged). - Data migrations.
AddUserPlatformRolesturns every liveSystemAdminlink intoplatform-operator.RemoveLegacyPlatformGrantsthen deletes the four permissions (with their role and direct grants) in every tenant and theSystemAdminrole. Holders of those permissions through any other path are not converted: the migration raises one PostgreSQLWARNINGper user, tenant and permission — check the migration output or the server log and grant a platform role by hand where intended. Reverting the migration restores the catalog rows, not the grants.
- Reach is decided by
- HTTP contract for the frontend (ADR 0011). Every break below ships together with the gryd.ui release; there is no compatibility layer. Migration guide, with the route table, the session payload per persona and the scope selector: scope model migration.
- Routes removed (each replaced by the resource route with
?scope=):/api/v1/admin/users*. Use/users*./api/v1/admin/tenants*, including/{id}/roles,/roles/lookup,/mfa-policy,/login-policy,/domains*and/identity-providers*. Use/tenants*./api/v1/admin/tenant-link-requests*. Use/tenant-link-requests*, tenant scope only, without thetenantIdfilter./api/v1/admin/identity-providers/discovery/validate. Use/identity-providers/discovery/validate, with noscope./api/v1/admin/security/secret-protection/*. Use/security/secret-protection/*.GET/POST /tenants/{id}/users,DELETE /tenants/{id}/users/{userId},DELETE /tenants/{id}/users/bulkandGET /users/{userId}/permissions.
- New routes:
DELETE /users/bulk: tenant scope only,{ "userIds": [...] }, at most 100 ids, all or nothing.GET /platform-roles,GET /users/{id}/platform-roles, andPOST/DELETE /users/{id}/platform-roles/{key}. Self-revocation answers409 PLATFORM_ROLE_SELF_REVOCATION_CONFLICT, and revoking the last granter answers409 PLATFORM_ROLE_LAST_GRANTER_CONFLICT.GET /tenants/{groupId}/group-coverage.POST /tenants/{tenantId}/members/bulk. A full organization answers409 TENANT_CAPACITY_REACHEDwithmaxUsers,activeUsersandrequestedinerrors.
- Changed routes:
POST /tenantsisglobalonly and creates root organizations only.parentTenantIdleft the body; create a branch withPOST /tenants/{id}/children.DELETE /tenants/{id}isglobalonly.POST /users/{id}/tenantsisglobalonly and answers201withUserDto.DELETE /users/{id}?scope=tenantof the seed administrator answers400 USER_CANNOT_DELETE_ADMIN(it used to remove the link).GET /tenants/{id}returnsTenantDtoin both scopes.typeis a number, andmaxUsers,activeUserCount,domain,createdAtandupdatedAtare added.childrenandhierarchyfilter the children by reach.- The organization configuration reads (roles, MFA policy, login policy, domains, identity providers) require
read:tenants. - The four group-hierarchy writes require
manage:child-tenantsin both scopes, and their answers carrygroupCoverageImpact. GET /users/directoryrequiresread:user-directory;read:usersalone no longer opens it.
GET /auth/session:- Each
capabilities.<domain>is{ scopes, default, blocked? }.blockedis[{ scope, code: "GROUP_SCOPE_INCOMPLETE", missingTenants }]. fieldsis removed.- The
userDirectorykey is renamed touser-directory. platformRolesandplatformPermissionsare added.sessionKind(tenantorplatform) is added, always equal to the token'ssession_kindclaim, so the UI reads the kind of the session from the same response.usersandtenantsderiveglobalfrom the platform role, in any organization.- The token carries
session_kind(tenantorplatform) andplatform_permission.
- Each
- Login:
- A user with a platform role and no link gets a platform session (
tokenType: "Platform", notenant_id). - A user with neither gets
403 NO_TENANT_ACCESS. - The "standard token" is removed.
- A user with a platform role and no link gets a platform session (
- Error codes:
- Added:
SCOPE_NOT_SUPPORTED(400),SCOPE_FORBIDDEN(403),GROUP_SCOPE_INCOMPLETE(403, withmissingTenants),TENANT_CONTEXT_REQUIRED(403),NO_TENANT_ACCESS(403) andTENANT_NOT_FOUND(404, in every scope). - Removed:
SCOPE_INVALID,SCOPE_NOT_AUTHORISED,REFERENCE_TENANT_REQUIRED,USER_NOT_ASSIGNED,USER_LIST_EMPTYandNO_USERS_ASSIGNED. CROSS_TENANT_FORBIDDENis no longer returned by resource routes.
- Added:
- Permissions:
- Removed:
admin:system,manage:all-users,manage:all-tenantsandread:all-users. - New platform-only permissions:
grant:platform-roles,manage:secret-protection,manage:circuit-breakers(now required by the circuit-breaker reset, reset-all and test routes),manage:security-state,validate:oidc-discovery,upload:product-files,retain:product-filesandpurge:product-files. - New tenant permissions, on no default role:
release-hold:filesandpurge-permanent:files. - GrydNotifications accepts
manage:notificationsonly.
- Removed:
- Routes removed (each replaced by the resource route with
Apply the GrydAuth migrations (ApplyGrydAuthMigrationsAsync) when upgrading.
6.2.2
Fixed
GrydNotifications and GrydJobs no longer depend on another module to build their
DbContext. Both contexts resolve theTenantSaveChangesInterceptor, but neither module registered it: it came from GrydFiles, GrydReports orAddGrydMultiTenancy. A host with GrydAuth and none of those failed on the first context it created — at startup, when it applied the migrations — withNo service for type 'Gryd.Infrastructure.Tenancy.TenantSaveChangesInterceptor' has been registered.GrydFiles and GrydReports registered the interceptor but not the
MultiTenancyOptionsinstance it is built from. GrydAuth binds theMultiTenancysection only asIOptions<MultiTenancyOptions>, so the same host failed withUnable to resolve service for type '...MultiTenancyOptions'unless it registered that instance itself.Every module whose context uses the interceptor now registers it, and the options it is built from, through
TryAddGrydTenantSaveChangesInterceptor(Gryd.Infrastructure.Tenancy):- The options instance is read from
IOptions<MultiTenancyOptions>, so the interceptor sees the sameMultiTenancysection GrydAuth does. - Both registrations are
TryAdd. A host that callsAddGrydMultiTenancy, or registers the interceptor or aMultiTenancyOptionsinstance itself, keeps its own, in any order. - The interceptor still needs an
ITenantContext, which GrydAuth orAddGrydMultiTenancyprovides.
Hosts that worked around the problem with
services.TryAddScoped<TenantSaveChangesInterceptor>()can drop the workaround.- The options instance is read from
RequireTenantOnReadandOptionalTenantVisibilityModenow apply to requests and jobs.AddGrydMultiTenancystored them in an async-local while the host was being composed. Kestrel's request handling does not inherit that flow, so every request read the built-in defaults (false,CurrentTenantOrGlobal) whatever the host configured. A host composing GrydAuth alone had no way to set them at all.TenantDataFilterAccessornow keeps process-wide defaults. Async-local values stay as per-flow overrides, andReset()returns a flow to the defaults. The defaults are applied when the host starts, before it serves a request or runs a job, from the registeredMultiTenancyOptions: the instance given toAddGrydMultiTenancy, or theMultiTenancyconfiguration section on a host that uses GrydAuth alone. Code that runs beforeapp.Run(), such as migrations and seeding, still reads the built-in defaults.Behavior change: a host that sets
MultiTenancy:RequireTenantOnRead: true(or a visibility mode other thanCurrentTenantOrGlobal) now gets it. WithRequireTenantOnRead: true, a read of a tenant-scoped entity with no tenant in context returns no rows instead of the rows of every tenant. Check background jobs and anonymous endpoints that read such entities without a tenant: they must disable the filter (ITenantDataFilter.Disable()) or set the tenant explicitly.
No migration is needed to upgrade from 6.2.1.
6.2.1
Fixed
GrydNotifications no longer requires GrydFiles to start. Since 6.1.0 every host using the module had to register
AddGrydFiles— and with it object storage, a ClamAV engine and GrydJobs — and declare thegryd.notification-attachmentprofile, even if it never sent an e-mail attachment. A host without GrydFiles also failed at runtime: the notificationsDbContext, the send handlers and the SMTP provider all depended on GrydFiles services.GrydFiles is now optional, as SMTP is:
- Without
AddGrydFilesthe host starts with noGrydFiles,GrydStorageorGrydClamAvconfiguration. In-app, push and e-mail without attachments work as before. A send withAttachmentFileIdsis refused when the command arrives with422 NOTIFICATION_ATTACHMENT_DISABLED_UNPROCESSABLE, and a message that reaches a provider with attachments anyway fails with the same code. - With
AddGrydFilesnothing changes: the host refuses to start unless thegryd.notification-attachmentprofile is declared withScanRequired: true. - The presence of GrydFiles is read from the built container, so
AddGrydFilesmay be called before or afterAddGrydNotifications.
GrydNotifications itself never required GrydJobs or object storage: GrydJobs is used only by the optional
GrydNotifications.Schedulingpackage, and the notifications schema has no reference to the GrydFiles schema. GrydReports still requires GrydFiles and thegryd.reportprofile, since it stores every report it generates.No migration, configuration or code change is needed to upgrade from 6.2.0.
- Without
6.1.0 — upgrade notes
6.1.0 introduced GrydFiles (object storage, antivirus and retention for files) and moved the files of GrydReports and GrydNotifications into it. The release was published as a minor version, but it contains the breaking changes below. Upgrading from 6.0.x to any 6.1+ version requires all of them.
Database migrations were regenerated
The Initial migrations of GrydNotifications and GrydReports were regenerated under new ids, and the GrydNotifications DurableNotificationDelivery migration was folded into the new initial one. On a database created by 6.0.x, ApplyGrydNotificationsMigrationsAsync/MigrateAsync sees the new id as pending and fails with relation ... already exists.
| Module | 6.0.x history | 6.1+ history |
|---|---|---|
| GrydNotifications | 20260328180703_NotificationsInitialMigration, 20260910043154_DurableNotificationDelivery | 20260910223916_NotificationsInitialMigration |
| GrydReports | 20260328180720_ReportsInitialMigration | 20260910182750_ReportsInitialMigration |
The schema change behind the new ids is small, and can be applied by hand before the 6.1+ host starts. Each script takes the database from the 6.0.x schema to the 6.1+ one and records the new migration id; the result was checked against a database created from scratch by 6.1+.
GrydNotifications — attachments used to be bytes in the notifications database and are now references to GrydFiles. 6.0.x attachment rows cannot be converted and are deleted, so let pending e-mails with attachments drain before upgrading.
sql
BEGIN;
DELETE FROM notifications.notification_attachments;
ALTER TABLE notifications.notification_attachments DROP COLUMN "Content";
ALTER TABLE notifications.notification_attachments ADD COLUMN "StoredFileId" uuid NOT NULL;
CREATE INDEX "IX_notification_attachments_StoredFileId"
ON notifications.notification_attachments ("StoredFileId");
DELETE FROM notifications."__EFMigrationsHistory"
WHERE "MigrationId" IN ('20260328180703_NotificationsInitialMigration',
'20260910043154_DurableNotificationDelivery');
INSERT INTO notifications."__EFMigrationsHistory" ("MigrationId", "ProductVersion")
VALUES ('20260910223916_NotificationsInitialMigration', '10.0.10');
COMMIT;GrydReports — an execution now points at its file in GrydFiles instead of a storage URI. Reports generated by 6.0.x lose their download. The history table is the one your host configures for the ReportsDbContext; the design-time factory uses reports."__EFMigrationsHistory", as below.
sql
BEGIN;
ALTER TABLE reports.report_executions DROP COLUMN "FileUri";
ALTER TABLE reports.report_executions ADD COLUMN "StoredFileId" uuid NULL;
UPDATE reports."__EFMigrationsHistory"
SET "MigrationId" = '20260910182750_ReportsInitialMigration', "ProductVersion" = '10.0.10'
WHERE "MigrationId" = '20260328180720_ReportsInitialMigration';
COMMIT;A database with nothing worth keeping in these two schemas can instead drop them and let the 6.1+ migrations recreate them.
GrydReports storage moved to GrydFiles
GrydReportsOptions.LocalStoragePathwas removed, together withReportStorageOptions, theStorageProviderenum andIReportFileStore. There is no local-disk provider any more: files live in the object storage configured for GrydFiles (GrydStoragesection).- A host using GrydReports must register
AddGrydObjectStorage,AddGrydFilesand a scan engine (AddGrydFilesClamAv), and declare thegryd.reportprofile underGrydFiles:Profiles.
Report download contract changed
GET /api/v1/reports/{id}/download no longer streams the file. It answers 200 with a ReportDownloadDto — { "url": "...", "expiresAt": "..." } — and the client fetches the file from url, a short-lived presigned URL, straight from storage. A report whose file is still being verified answers 409 FILE_NOT_AVAILABLE_CONFLICT; ask again a moment later. In the report DTOs, FileUri and DownloadUrl were replaced by StoredFileId.
GrydNotifications attachments moved to GrydFiles
E-mail attachments are no longer bytes in the request: a file is uploaded through POST /files under the gryd.notification-attachment profile and sent by id in AttachmentFileIds (see Email with Attachments). From 6.1.0 to 6.2.0 this made GrydFiles mandatory for every GrydNotifications host; 6.2.1 makes it optional again.