Skip to content

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-Control or Content-Disposition (as the GrydAuth profile picture does) failed on Azure Blob Storage with 400 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: BlobHttpHeaders on Azure, the object headers on S3 (they were stored as x-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) and AddGrydAdvisoryLocks<TContext>(), transaction-scoped PostgreSQL locks keyed by namespace, tenant and name. See Advisory locks.
  • Version token: IVersioned, ApplyVersionedConcurrency(), VersionStamper, AddGrydVersionedEntities(), UseGrydVersionedEntities and ExpectVersion<TEntity>. See Optimistic concurrency.
  • Append-only entities: IAppendOnly, AppendOnlyGuard, AppendOnlyEntityException, AddGrydAppendOnlyEntities() and UseGrydAppendOnlyEntities. See IAppendOnly.
  • Tenant-created fact: AuthTenantCreatedV1 (kind auth.tenant.created, version 1) for root and child tenants, on the TenantLifecycleStream stream, acknowledged by auth.acknowledge-tenant-created-v1. See Tenant-created fact.
  • Per-tenant recurring jobs: IPerTenantRecurringJob, fed by the new core port IActiveTenantDirectory and ActiveTenant (read inside a system scope). See Listing active tenants and Per-tenant recurring jobs.
  • Audience notifications: SendAudienceNotificationCommand, GrydNotificationsOptions.MaxAudienceRecipients and the core port IUserAudienceResolver with UserAudience, UserAudienceKind and AudienceMember. See Audiences.

Changed ​

  • The core exception handler maps DbUpdateConcurrencyException to 409 DB_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 by ProtectTenantWrites.

Upgrading ​

  • Hosts that enforce outbox route admission must AdmitRoute the new auth.tenant.created v1 kind in the same release. No migration is required.

11.9.0 ​

Added ​

  • Nested unit of work: INestedUnitOfWork.ExecuteNestedAsync runs an operation in a savepoint (or in its own transaction when none is open) and keeps or discards it by NestedOutcome, so an idempotent route can undo part of an act and still answer 2xx. Registered by AddGrydAuditablePersistence. See Idempotent act routes.
  • TransactionBoundBuffer<T>, the structure for work tied to a transaction that follows savepoints.
  • After-commit effects: IAfterCommitEffects, AddGrydAfterCommitEffects<TContext>() and UseGrydAfterCommitEffects, with the Gryd.Infrastructure.AfterCommit meter. See After-commit effects.
  • [NotIdempotent("reason")] exempts a route, documented in OpenAPI as x-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)] and MaxRouteStoredResponseBytes. The ceiling is the greater of it and MaxStoredResponseBytes, so hosts that raised the latter keep starting.
  • Subject of the key: IIdempotencySubjectResolver, AddGrydIdempotencySubjectResolver<T>() and IdempotencySubjects.Derive.
  • Metrics of the filter: meter Gryd.API.Idempotency with the gryd.idempotency.requests counter and the gryd.idempotency.claim.duration histogram, exported by default by Gryd.Observability.OpenTelemetry.
  • Stored response headers: GrydIdempotencyOptions.ReplayedResponseHeaders (opt-in ResponseHeaders column).
  • Storage modes Full, StatusOnly and Encrypted per route (opt-in StorageMode column), with Idempotent-Replay-Degraded when a body cannot be decrypted. AddGrydIdempotency now calls AddDataProtection().
  • Settled refusals: [Idempotent(Refusals = IdempotentRefusals.Store)], IdempotentRefusalResult and GrydBaseController.SettledRefusal store a 409 or 422 business refusal (opt-in StoredRefusals feature, which replaces the status check of the table). The code travels in the code extension of the ProblemDetails.
  • IdempotencyHeaders lists the headers of the feature and ExposedToBrowsers; 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. AddApplicationGrydAuthServices and AddInfrastructureGrydAuthServices register TimeProvider.System with TryAddSingleton, 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 TO succeeds, 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 by AddGrydAuthReaders and 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), what GetAsync answers 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: ITenantAdministratorReader returned an empty list for tenants with an administrator. It read update:tenants, which the Admin role the module provisions does not hold, so the seeded administrator and every member with the Admin role 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; the Admin role 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 AddTenantAdministratorNoticesPermission adds the permission to every existing tenant and grants it to the tenant's Admin role. So that nobody warned before stops being warned, it also grants it to every role and every member that held update:tenants in the tenant. A custom role made by a tenant to administer it does not receive it otherwise: grant it explicitly. Holding update:tenants alone 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 in Failed, 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.

  • StoredFile keeps the owner declared at confirmation (DeclaredOwnerScope, DeclaredOwnerKey) and the condemnation (CondemnedAt, CondemnedAfterRelease). The migration Files_ScopeHealth adds 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 by AddGrydAuthReaders and 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 holds update:tenants in 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 IRoleReader and IRoleHolderReader, registered by AddGrydAuthReaders and by the writable composition. IRoleReader.GetAsync(tenantId, roleId) returns the role's Id, current Name and IsSystem, or null when 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 as ITenantAdministratorReader: 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 an Idempotency-Key header; a repeat of the same request returns the stored response with Idempotent-Replayed: true, the same key with a different request is refused with 422 IDEMPOTENCY_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 with AddGrydIdempotency<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-bound PersonKey and never the CPF. Each change publishes the fact AuthUserIdentityChangedV1 (auth.user-identity.changed, version 1) and an audit record in the same transaction. The permissions verify:user-identity and reveal:user-identity-document are granted to no default role. The routes are user-identity-requests (create, list, get, approve, reject) and user-identities/{userId} (status and document/reveal). The feature is opt-in: without the GrydAuth:Security:PersonKey section creating, approving and revealing answer 503 (listing, reading, rejecting and the status keep working), the reader answers NotVerified and the release is a non-breaking minor. A host that builds UnitOfWork by hand or implements IGrydAuthUnitOfWork must add the two new repositories (see Changed). See Verified user identity.

Changed ​

  • UnitOfWork takes two more repositories (IUserIdentityRepository, IUserIdentityRequestRepository) in its public constructor, and IGrydAuthUnitOfWork gains the matching two members, as TenantLinkRequests did. A host that resolves them through DI is not affected. Code that constructs UnitOfWork by hand or implements IGrydAuthUnitOfWork outside this repository must add the two repositories.

Fixed ​

  • SensitiveDataMasker.MaskCpf no 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) and Result.FieldFailure(fieldErrors, code) (also on Result<T>) keep the rule's code, and so its HTTP status, and answer errors as an object by field, the same shape as VALIDATION_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 its Notification) and SendEmailCommand take an optional Locale (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), through IEmailDeliveryFeedback. Each change is published after commit to the product's IEmailDeliveryFeedbackHandler by the durable delivery worker. Every e-mail carries X-Gryd-Notification-Id, and the notification stores the provider's message id. GrydNotifications.Infrastructure.SendGrid adds MapGrydSendGridEventWebhook, a signed Event Webhook receiver. Apply the migration AddEmailDeliveryFeedback. See Delivery feedback and ADR 0017.
  • GrydNotifications asks the product's INotificationDeliveryPolicy implementations before delivering, on every send path (/send, /schedule, /email, /push and 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 on gryd.notifications.suppressed. Register a policy with AddGrydNotificationDeliveryPolicy<T>(). With none registered, nothing changes. Send commands accept notificationType and entityKey, and RecipientDto accepts userId. A send that leaves them out keeps its operation hash. A send whose recipients are all suppressed ends with the new status NotificationStatus.Suppressed. Direct push and in-app fail with NOTIFICATION_SUPPRESSED. A failing policy fails the send with NOTIFICATION_POLICY_UNAVAILABLE (503). Apply the migration RecipientDeliveryPolicy: three nullable columns on notifications.notification_recipients. INotificationTelemetry.RecordSuppressed has 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 GET and PUT /api/v1/tenants/{tenantId}/governance-contacts?scope=global with the new platform-only permission manage:tenant-governance-contacts. A tenant administrator cannot reach them. The PUT replaces the whole list, only applies to a company tenant, and accepts an optional If-Match. Each change writes a masked audit line and the fact auth.tenant-governance-contacts.changed V1, with the previous and the new list. ITenantGovernanceContactReader reads them in process. Apply the migration AddTenantGovernanceContacts. A host with RequireRouteAdmission must admit the new kind. See Governance contacts.
  • GrydNotifications closes the push contract. PushErrorCodes lists 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-tokens and DELETE /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 honors Push.MaxDeviceTokensPerMulticast, Push.AutoRemoveInvalidTokens and Push.DefaultTimeToLive, and sends a WebpushConfig. With push on and no provider the host warns at startup, and refuses to start with the new Push.RequireProvider = true. Apply the migration DeviceTokensUniquePerTenant. See Push channel.

Changed ​

  • The SMTP sender classifies a recipient refused during the conversation. A 5xx fails with EMAIL_RECIPIENT_REJECTED, reason Bounced, and is no longer retried; in durable mode it is dead-lettered instead of waiting for reconciliation. A 4xx fails with EMAIL_RECIPIENT_DEFERRED and is retried. Bounced joins the default NonRetryableReasons.
  • The unique index of device_tokens moves 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_* to PUSH_*. They were not documented.
  • Because Push.Enabled defaults to true, 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 Sent when no device of a multi-token send accepts it.
  • An FCM InvalidArgument caused by a bad payload no longer deactivates every token of the batch: it fails with PUSH_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 by AddGrydAuthReaders and by the writable composition. GetAsync(tenantId) returns the tenant's Id and CreatedAtUtc, active or not, or null when 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 with AddReportExport<TRecord, TParams> or, for an entity, with AddEntityExport<TEntity>. The request may pick the columns, and GET /reports/export/{templateId} describes the columns and filters. See Streaming export.

Fixed ​

  • GrydFiles registers CandidateScopes as scoped. As a singleton it took the scoped ITenantAmbient, so a host with scope validation on (the Development default) 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> and IPlatformAuditTrail<TUnitOfWork> stage an audit record in the act's transaction, with one delivery through AddAuditSource. New package Gryd.Observability.EntityFrameworkCore. See Transactional audit trail.
  • OutboxEnvelope.Unordered builds 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, causationId or correlationId.

11.0.1 ​

Fixed ​

  • AuditableEntityStamper fills DeletedBy when 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.OfRoles is no longer public; use IPlatformAuthorizationCatalog.GrantOf.
  • IRolePermissionComposer.ComposeFromCatalogTemplate splits into ComposeNewFromCatalogTemplate and ConvergeFromCatalogTemplate.
  • AuthorizationCatalogContribution gains RetiredPermissions and RetiredRolePermissions.
  • 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. Roles gains AccessChangeSequence.
  • Outside Development, a host refuses to start while the seeded admin still has the public password.
  • GrydAuth.Infrastructure no longer brings GrydAudit.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.changed and auth.role-permission.changed through the outbox, and IPermissionHolderReader answers 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, ISystemServiceExecutor and AddSystemService<T> run tenantless routines limited to the global entities they declare. See Background tenancy.

  • OutboxMessagingBuilder.DeclareRouteWithoutConsumers completes a kind that has no consumer by decision.

  • AddGrydAuditablePersistence<TContext> and EfUnitOfWork<TContext> give any context soft delete, authorship and a unit of work, by opt-in.

  • CurrencyCode validates ISO 4217 codes in circulation.

  • IUserCultureReader, and IUserDirectoryReader in the writable composition too.

  • SetGrydHostRole and AddGrydBackgroundLoop: 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 of GET /permissions/catalog. In global scope an admin screen can read the catalog of any organization (to grant a user a direct permission there); tenant reaches only the session's own organization. Reads need read:tenants.

  • UserTenantAccessDto.permissionIds carries the ids of each link's direct permissions (the same set as permissions, by id), so the users screen in global scope can grant and revoke them per organization.

  • ApplyGrydAuthMigrationsAsync(GrydAuthMigrationOptions) runs optional steps after the GrydAuth migrations. GrantSeedAdminConfiguredAppId = true gives the seeded admin (admin@local.com) access to the host's JwtSettings: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. IServerFileStore is now IServerFileStore<TScope>; a module registers with AddGrydFilesConsumer<TScope>(o => o.Handler<THandler>()) — the IFileOutcomeHandler is mandatory — and uses IFileStore<TScope>. Confirming and reading carry the ownerKey (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(...)) and AddOutboxWorker() deliver the audit trail and the verdicts after the commit; an IFileActorDirectory checks the authors of an erasure.
  • Database. Files_GF_02_RemoveDedupe, Files_GF_08_ActorAndOutbox and Files_GF_15_LegalHoldHolders. The last refuses to apply while any stored_files row still has the old LegalHold bit on.
  • Storage. Two members on IObjectStorageService and IObjectStorageProvider (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-attempts is paginated; POST /files/{id}/rescan is new; PUT /files/{id}/retention takes a reason with legalHold, and the hold is per holder; a purge before retainUntil or of a Permanent file needs erasure: true; the reference routes refuse any scope not declared with ManagedThroughHttpSurface(). Nine error codes are new.
  • A host that composes AddGrydFiles without AddGrydFilesOutbox does 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 with UseHostOutbox() on the module builder. The gryd-api and gryd-module templates compose the outbox and the worker with IncludeFiles.
  • IFileAuditTrail gained two methods, ReleasedFileInfected and ReleasedObjectChanged: 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 (an Updated, no purge reason, Cause = signature or object-changed; audit contract §6.3). Deploy the draining side first (see the upgrade order in the migration guide).
  • IStoredFileLock.TryLockAsync reads 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 gets Absent. The recurring sweeps select across tenants and treat each record in its own; FileSweepMetrics.MeterName is 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: CanonicalFileId and 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 the AuditEntry.Id it receives and is idempotent by it: a repeated SaveAsync or SaveBatchAsync of the same entry, including a concurrent one, leaves one row and does not throw. AuditLog.FromEntry keeps the entry's id and AuditLog.Builder gains WithId. 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 ConsumerIdentityController must supply ICommittedCallerPermissionReader instead of IEffectivePermissionResolver; 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 remains 403 ROLE_ASSIGNMENT_ESCALATION_BLOCKED, and unavailable authority returns 503 ROLE_GRANT_AUTHORITY_UNAVAILABLE without a cached fallback. Composition change: direct/manual hosts must provide the required ICommittedCallerPermissionReader and ICurrentUserService; normal AddGrydAuth supplies them. This snapshot does not fence a later write. See Authorization.

  • POST /roles applies 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, which PUT /roles/{id} refused to add. Every route that widens a role now goes through one composer (IRolePermissionComposer), so POST /roles, PUT /roles/{id} and POST /roles/{roleId}/permissions/{permissionId} give the same answer, and an architecture test keeps any other type from calling Role.AssignPermission.

    Behavior change: POST /roles with a catalog permission the caller lacks answers 403 ROLE_ASSIGNMENT_ESCALATION_BLOCKED, and the role is not created. Permissions the tenant invented stay free; a global scope 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 calls IRolePermissionComposer; Role.AddPermission was removed (use the composer, or AssignPermission in 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

BeforeAfter
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, silentlyasc/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 fieldsSame 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 400One 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 pagesQuerySortMap.SetTieBreaker(row => row.Id) orders ties by a unique key, ascending, and is the only ordering when no field applies

.NET API

BeforeAfter
A query subclass (ListInvoicesQuery : CustomListQuery<,>), as documented, failed at runtime: MediatR found no handler for the subclassCustomListQuery<TRequest, TItem> is sealed and takes only the request; the controller builds it
CustomListQuery(request, allowedSortFields), CustomListQuery.AllowedSortFieldsRemoved. 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 handlerOnly CustomListQueryHandlerBase, as Result.ValidationFailure on sortBy
ProblemDetails translated a key in the flat errors list onlyPer-field errors (Result.FieldErrors) are translated field by field too
Consumers mapped CustomListQueryResult<TItem> by handCustomListQueryResult<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

BeforeAfter
GET /audit-logs/searchGET /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 100400 VALIDATION_ERROR
changeTypeDisplay (English)Removed. The label comes from the catalog
AuditLogSummaryDto in the listAuditLogItem (§3.1)
additionalData (JSON text)metadata (object)
details[].hasChangedRemoved (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 list403 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 0The real value, without technical fields
Scalar filtersRepeatable (§2.3)
Only the routes /{id}, /entity/..., /user/... and /search existedNew 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 MultiTenancyaction, outcome, actorType and category closed to security or data (§2.5)
No names: type and GUIDentityDisplayName, 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 fieldchangeType = 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 onlyAlso X-Audit-Search-Scope and Content-Disposition: a front on another origin reads the search scope and the export file name
New permissionexport: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

BeforeAfter
The event was written before the business commit, and a failed operation left a recordWritten 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 documentationCleanup 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 existOpt-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 profilesThe 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

BeforeAfter
SearchAuditLogsQuery, GetAuditLogsByEntityQuery, GetAuditLogsByUserQueryListAuditLogsQuery (list, history and activity) and GetAuditLogByIdQuery, which return Result<T>
IAuditLogService, AuditPoliciesRemoved. To record outside SaveChanges, use IAuditStore
IAuditLogRepository.GetByEntityAsync, GetByUserAsync, CountAsync and AuditLogFilterSearchAsync(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=global takes a user out of ONE organization — the subtractive counterpart of POST /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-scope DELETE /users/{id}). delete:users in a platform role; any other scope is a 400 SCOPE_NOT_SUPPORTED. A user without the link answers 404 USER_NOT_FOUND, the protected seed administrator 400 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[].isActive tells which, so the operator can reactivate it), with roleName matched on that link — the operator sees who is in it without switching into it (the route GET /tenants/{id}/users it 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. In scope=tenant the 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=tenant now answers for a company of the session's group when the caller holds update:tenants in the group tenant — the rule of POST /tenants/{tenantId}/members/bulk, so the screen can offer the role the bulk link takes without switching into the company. Search and ids hydration are unchanged; every other organization, and the rest of the company's configuration, stays a 404. The scope model gained ITenantResourceReach, a module's opt-in exception to the tenant rule 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 got 403 ROLE_ASSIGNMENT_ESCALATION_BLOCKED when delivering it.

  • Admin role gains security:unlock-user and security:view-user-info, in the seed and, by migration GrantUserSecurityToAdmin, in every existing tenant. security:record-failed-login and security:reset-failed-attempts are deliberately not granted.

  • Remote consumer hosts no longer read every tenant's rows. AddGrydAuthRemoteConsumer (and AddGrydAuthTokenValidator, which delegates to it) validated the session and emitted its tenant_id claim, but nothing moved that claim into the ambient tenant. Every Gryd DbContext then saw no tenant and, with RequireTenantOnRead off by default, its query filter returned the rows of all tenants.

    • New Core middleware TenantSessionMiddleware (app.UseGrydTenantSession(), Gryd.API): after authentication, the session's tenant_id claim — 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 after UseAuthentication() and before UseAuthorization(). 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 whose MultiTenancyOptions turn it off does not start.

    Upgrade: consumer hosts add app.UseGrydAuthRemoteConsumer(); right after app.UseAuthentication();. Authority hosts (AddGrydAuth) are unchanged. See Remote consumer.

  • 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/search took the tenant from the tenantId query 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 AuditDbContext that reads ITenantSession:

    • 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.

  • New permission read:audit-logs gates the GrydAudit read routes. It is a tenant permission in the Audit category. GrydAuth grants it to the Admin role template; GroupAdmin and Visitor do not receive it. The AddAuditLogsReadPermission migration creates it in every existing tenant and grants it to every existing Admin role.

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=global answered 409 DB_DUPLICATE_CONFLICT. ApplySoftDeleteFilters() now also restricts every unique index of an ISoftDeletable entity to live rows ("IsDeleted" = false, AND-ed with the index's own filter). It leaves alone an index whose filter already names IsDeleted. 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 SoftDeleteUniqueIndexes migration 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 next dotnet ef migrations add recreates 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 ​

  • tenantId is no longer a parameter of GET /api/v1/audit-logs/search. A value sent anyway is ignored by model binding.
  • Every /api/v1/audit-logs route requires read:audit-logs. A caller without it gets 403. Grant it to any role other than Admin that reads the trail.
  • Removed from the .NET API: SearchAuditLogsQuery.TenantId, AuditLogFilter.TenantId and IAuditLogRepository.GetByTenantAsync. Remove the argument; the tenant is the session's.
  • A host that composes GrydAudit without a registered ITenantSession can no longer read audit logs. Register one (GrydAuth or AddGrydTenancy does).
  • The tenant of a request comes only from the session's tenant_id claim (ADR 0011, D18), in the GrydAuth host too: UseGrydAuth() now ends with UseGrydTenantSession(), and the token processor no longer reads X-Tenant-ID or ?tenantId=. A global (selector) token runs with no tenant.
    • Removed: AddGrydMultiTenancy/UseGrydMultiTenancy, TenantResolutionMiddleware, ITenantResolver and its five resolvers, GrydAuthBuilder, and the MultiTenancy options TenantHeaderName, TenantQueryParameter, TenantRouteParameter, TenantClaimType, ResolutionOrder, RequireTenant and IgnorePaths (with the TenantResolutionStrategy enum and PrimaryStrategy).
    • Upgrade: a host without GrydAuth calls services.AddGrydTenancy() and app.UseGrydTenantSession() after app.UseAuthentication(). Clients that chose a tenant with a header or query string switch tenant instead.
  • Tenant isolation is fixed behaviour, not configuration (ADR 0011, D16, D19, D20).
    • Reads fail closed everywhere: with no tenant in session an IRequireTenant entity returns no row, and an IOptionalTenant one only its global rows (CurrentTenantOnly: none).
    • TenantSaveChangesInterceptor is attached to GrydAuthDbContext too, and its four guards are always on: stamp a new required-tenant row with the session's tenant (refused without one), refuse a change of TenantId, 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 own RequireTenantOnRead guard. The interceptor's constructor takes only the tenant context. MultiTenancyOptions is validated when first resolved.
    • Upgrade: remove those keys from the MultiTenancy section. 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 with IgnoreQueryFilters() and restates the tenant and soft-delete predicates.
  • 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, RequireGlobalTokenAttribute with the GlobalTokenOnly and TenantTokenOnly policies, AddGrydTenantInterceptor, and MultiTenancyOptions.DefaultTenantId. MultiTenancyOptions keeps OptionalTenantVisibilityMode and MaxGroupScopeTenants only.
    • Every entity a Gryd DbContext maps with a TenantId declares IRequireTenant or IOptionalTenant (an architecture test enforces it; UserTenant, OutboxMessage, DeliveryResolution and AuditLog are the justified exceptions).
    • Upgrade: attach the interceptor with options.AddInterceptors(sp.GetRequiredService<TenantSaveChangesInterceptor>()); replace [RequireTenantToken] with [Authorize] and [RequireGlobalToken] with [AllowGlobalAndTenantToken].
  • One scope model: ?scope=tenant|group|global on one route per resource (ADR 0011; released together with the gryd.ui change). Frontend migration guide: scope model migration.
    • Reach is decided by IScopeResolver and one IScopeAuthority per scope. global is a platform role on the user (platform-operator, platform-support), carried as the platform_permission claim and granted through POST/DELETE /api/v1/users/{id}/platform-roles/{key}; a platform session may have no tenant. group requires full coverage of the group (403 GROUP_SCOPE_INCOMPLETE with missingTenants). 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-users and the SystemAdmin role. 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, PermissionReach and RoleProvisioningScope (every catalog role is provisioned in every tenant); [ScopeCapable], ScopedQueryParameters, ScopeInvalidException, AddGrydScopeContract, ScopeErrorCodes.Invalid/NotAuthorised (SCOPE_INVALID, SCOPE_NOT_AUTHORISED), TenantScopeModes.All/TryParse and LoggingConstants.Headers.TenantId. A route that is not a scoped endpoint still refuses any ?scope= other than tenant, now with 400 SCOPE_NOT_SUPPORTED (guard UnscopedRouteScopeGuard, registered by AddGrydApiVersioning()), instead of SCOPE_INVALID.
    • The tenant_id tag of the ASP.NET Core server span comes from the authenticated session, never from the X-Tenant-ID header.
    • 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) require manage:child-tenants in global too, which the platform-operator role now holds; ScopedEndpointAttribute.PlatformAction was removed.
    • Reference module: POST /api/v1/reference/sales-orders is a scoped write that exists only in the tenant scope (OnlyIn) and requires the new create:sales-orders permission. A platform session gets 403 TENANT_CONTEXT_REQUIRED (was 400 REFERENCE_TENANT_REQUIRED from the handler), and ?scope=group|global gets 400 SCOPE_NOT_SUPPORTED.
    • An organization addressed by id that is out of reach or does not exist answers 404 TENANT_NOT_FOUND in every scope, including its configuration routes (/tenants/{id}/mfa-policy, /stats and the like), which answered RESOURCE_NOT_FOUND in the tenant scope (ScopeErrorCodes.TenantNotFound).
    • TelemetryBehavior takes the tenant session as an optional dependency: a host that calls AddGrydObservabilityBehaviors() without tenancy (no GrydAuth, no consumer mode, no AddGrydTenancy()) composes the pipeline and its spans carry no tenant.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 code USER_CANNOT_DELETE_ADMIN is unchanged).
    • Data migrations. AddUserPlatformRoles turns every live SystemAdmin link into platform-operator. RemoveLegacyPlatformGrants then deletes the four permissions (with their role and direct grants) in every tenant and the SystemAdmin role. Holders of those permissions through any other path are not converted: the migration raises one PostgreSQL WARNING per 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.
  • 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 the tenantId filter.
      • /api/v1/admin/identity-providers/discovery/validate. Use /identity-providers/discovery/validate, with no scope.
      • /api/v1/admin/security/secret-protection/*. Use /security/secret-protection/*.
      • GET/POST /tenants/{id}/users, DELETE /tenants/{id}/users/{userId}, DELETE /tenants/{id}/users/bulk and GET /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, and POST/DELETE /users/{id}/platform-roles/{key}. Self-revocation answers 409 PLATFORM_ROLE_SELF_REVOCATION_CONFLICT, and revoking the last granter answers 409 PLATFORM_ROLE_LAST_GRANTER_CONFLICT.
      • GET /tenants/{groupId}/group-coverage.
      • POST /tenants/{tenantId}/members/bulk. A full organization answers 409 TENANT_CAPACITY_REACHED with maxUsers, activeUsers and requested in errors.
    • Changed routes:
      • POST /tenants is global only and creates root organizations only. parentTenantId left the body; create a branch with POST /tenants/{id}/children.
      • DELETE /tenants/{id} is global only.
      • POST /users/{id}/tenants is global only and answers 201 with UserDto.
      • DELETE /users/{id}?scope=tenant of the seed administrator answers 400 USER_CANNOT_DELETE_ADMIN (it used to remove the link).
      • GET /tenants/{id} returns TenantDto in both scopes. type is a number, and maxUsers, activeUserCount, domain, createdAt and updatedAt are added.
      • children and hierarchy filter 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-tenants in both scopes, and their answers carry groupCoverageImpact.
      • GET /users/directory requires read:user-directory; read:users alone no longer opens it.
    • GET /auth/session:
      • Each capabilities.<domain> is { scopes, default, blocked? }. blocked is [{ scope, code: "GROUP_SCOPE_INCOMPLETE", missingTenants }].
      • fields is removed.
      • The userDirectory key is renamed to user-directory.
      • platformRoles and platformPermissions are added.
      • sessionKind (tenant or platform) is added, always equal to the token's session_kind claim, so the UI reads the kind of the session from the same response.
      • users and tenants derive global from the platform role, in any organization.
      • The token carries session_kind (tenant or platform) and platform_permission.
    • Login:
      • A user with a platform role and no link gets a platform session (tokenType: "Platform", no tenant_id).
      • A user with neither gets 403 NO_TENANT_ACCESS.
      • The "standard token" is removed.
    • Error codes:
      • Added: SCOPE_NOT_SUPPORTED (400), SCOPE_FORBIDDEN (403), GROUP_SCOPE_INCOMPLETE (403, with missingTenants), TENANT_CONTEXT_REQUIRED (403), NO_TENANT_ACCESS (403) and TENANT_NOT_FOUND (404, in every scope).
      • Removed: SCOPE_INVALID, SCOPE_NOT_AUTHORISED, REFERENCE_TENANT_REQUIRED, USER_NOT_ASSIGNED, USER_LIST_EMPTY and NO_USERS_ASSIGNED.
      • CROSS_TENANT_FORBIDDEN is no longer returned by resource routes.
    • Permissions:
      • Removed: admin:system, manage:all-users, manage:all-tenants and read: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-files and purge:product-files.
      • New tenant permissions, on no default role: release-hold:files and purge-permanent:files.
      • GrydNotifications accepts manage:notifications only.

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 the TenantSaveChangesInterceptor, but neither module registered it: it came from GrydFiles, GrydReports or AddGrydMultiTenancy. A host with GrydAuth and none of those failed on the first context it created — at startup, when it applied the migrations — with No service for type 'Gryd.Infrastructure.Tenancy.TenantSaveChangesInterceptor' has been registered.

    GrydFiles and GrydReports registered the interceptor but not the MultiTenancyOptions instance it is built from. GrydAuth binds the MultiTenancy section only as IOptions<MultiTenancyOptions>, so the same host failed with Unable 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 same MultiTenancy section GrydAuth does.
    • Both registrations are TryAdd. A host that calls AddGrydMultiTenancy, or registers the interceptor or a MultiTenancyOptions instance itself, keeps its own, in any order.
    • The interceptor still needs an ITenantContext, which GrydAuth or AddGrydMultiTenancy provides.

    Hosts that worked around the problem with services.TryAddScoped<TenantSaveChangesInterceptor>() can drop the workaround.

  • RequireTenantOnRead and OptionalTenantVisibilityMode now apply to requests and jobs.AddGrydMultiTenancy stored 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.

    TenantDataFilterAccessor now keeps process-wide defaults. Async-local values stay as per-flow overrides, and Reset() 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 registered MultiTenancyOptions: the instance given to AddGrydMultiTenancy, or the MultiTenancy configuration section on a host that uses GrydAuth alone. Code that runs before app.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 than CurrentTenantOrGlobal) now gets it. With RequireTenantOnRead: 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 the gryd.notification-attachment profile, even if it never sent an e-mail attachment. A host without GrydFiles also failed at runtime: the notifications DbContext, the send handlers and the SMTP provider all depended on GrydFiles services.

    GrydFiles is now optional, as SMTP is:

    • Without AddGrydFiles the host starts with no GrydFiles, GrydStorage or GrydClamAv configuration. In-app, push and e-mail without attachments work as before. A send with AttachmentFileIds is refused when the command arrives with 422 NOTIFICATION_ATTACHMENT_DISABLED_UNPROCESSABLE, and a message that reaches a provider with attachments anyway fails with the same code.
    • With AddGrydFiles nothing changes: the host refuses to start unless the gryd.notification-attachment profile is declared with ScanRequired: true.
    • The presence of GrydFiles is read from the built container, so AddGrydFiles may be called before or after AddGrydNotifications.

    GrydNotifications itself never required GrydJobs or object storage: GrydJobs is used only by the optional GrydNotifications.Scheduling package, and the notifications schema has no reference to the GrydFiles schema. GrydReports still requires GrydFiles and the gryd.report profile, since it stores every report it generates.

    No migration, configuration or code change is needed to upgrade from 6.2.0.

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.

Module6.0.x history6.1+ history
GrydNotifications20260328180703_NotificationsInitialMigration, 20260910043154_DurableNotificationDelivery20260910223916_NotificationsInitialMigration
GrydReports20260328180720_ReportsInitialMigration20260910182750_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.LocalStoragePath was removed, together with ReportStorageOptions, the StorageProvider enum and IReportFileStore. There is no local-disk provider any more: files live in the object storage configured for GrydFiles (GrydStorage section).
  • A host using GrydReports must register AddGrydObjectStorage, AddGrydFiles and a scan engine (AddGrydFilesClamAv), and declare the gryd.report profile under GrydFiles: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.

Updated at:

Released under the MIT License.