Skip to content

Feature/ab#34582 tighten api security - #3102

Closed
JamesPasta wants to merge 26 commits into
devfrom
feature/AB#34582-TightenAPISecurity
Closed

JamesPasta wants to merge 26 commits into
devfrom
feature/AB#34582-TightenAPISecurity

Conversation

@JamesPasta

Copy link
Copy Markdown
Collaborator

No description provided.

@JamesPasta
JamesPasta marked this pull request as draft October 15, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Build blockers, missing tenant migrations, and permission mismatches prevent safe deployment and disrupt existing notification workflows.

7 open findings
What changed in this PR

This PR tightens security across Unity’s grant-management APIs and improves background processing, payment approvals, and notification consistency.

Changes:

  • Adds authorization checks, safer UI handling, and dependency updates.
  • Introduces shared worker auditing, message retries, and payment concurrency handling.
  • Moves approval mutations into commands and adds template locking, tests, and documentation updates.
File Description
documentation/​payments/​payments-web-ui.md Documents read-only approval preview.
documentation/​payments/​payments-roadmap.md Removes the addressed GET-mutation issue.
documentation/​payments/​payments-overview.md Updates approval-slot lifecycle documentation.
documentation/​payments/​payments-approval-workflow.md Documents command-driven approval slots.
documentation/​notifications/​notifications-scheduled-notifications.md Explains template locking.
applications/​Unity.GrantManager/​yarn.lock Locks solution-level DOMPurify dependencies.
applications/​Unity.GrantManager/​test/​Unity.GrantManager.Application.Tests/​Notifications/​ScheduledNotificationTemplateLockTests.cs Tests template-reference protection.
applications/​Unity.GrantManager/​test/​Unity.GrantManager.Application.Tests/​GrantsPortal/​ApplicantUpdateEmailRecoveryWorkerTests.cs Supplies worker audit dependencies.
applications/​Unity.GrantManager/​test/​Unity.GrantManager.Application.Tests/​Applicants/​BackgroundWorkers/​FiscalYearEndRolloverWorkerTests.cs Tests separate tenant audit logs.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​Views/​Shared/​Components/​ApplicantOrganizationInfo/​ApplicantOrganizationInfoController.cs Adds organization-info authorization.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​Views/​Shared/​Components/​ApplicantContacts/​ApplicantContactsController.cs Adds contacts authorization.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​Views/​Shared/​Components/​ApplicantAddresses/​ApplicantAddressesController.cs Adds addresses authorization.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​Unity.GrantManager.Web.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​Pages/​ApplicationForms/​TokenModal.js Simplifies clipboard writes.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​GrantManagerWebModule.cs Enables bundle minification.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Web/​Controllers/​FormNotificationsApiController.cs Adds notification endpoint permissions.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.HttpApi/​Unity.GrantManager.HttpApi.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.HttpApi.Client/​Unity.GrantManager.HttpApi.Client.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.EntityFrameworkCore/​Unity.GrantManager.EntityFrameworkCore.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.EntityFrameworkCore/​Migrations/​HostMigrations/​20261013120000_AddQuartzMisfireOriginalFireTime.cs Adds Quartz misfire timestamp column.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.EntityFrameworkCore/​EntityFrameworkCore/​GrantTenantDbContext.cs Configures schedule-template relationship.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.EntityFrameworkCore/​EntityFrameworkCore/​EntityFrameworkCoreTenantDatabasePurger.cs Changes connection-builder construction syntax.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Domain/​Unity.GrantManager.Domain.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Domain.Shared/​Unity.GrantManager.Domain.Shared.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.DbMigrator/​Unity.GrantManager.DbMigrator.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.DbMigrator/​DbMigratorHostedService.cs Simplifies application disposal scope.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Unity.GrantManager.Application.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Notifications/​AutomatedNotificationAppService.cs Adds permissions and transactional template locking.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Messaging/​OutboxWorkerBase.cs Adopts shared worker execution context.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Messaging/​InboxWorkerBase.cs Adds tenant-scoped handler auditing.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Integrations/​Endpoints/​EndpointManagementAppService.cs Restricts endpoint administration.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Intakes/​BackgroundWorkers/​IntakeSyncWorker.cs Adds tenant audit scopes.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​History/​HistoryAppService.cs Requires authenticated access.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​History/​AuditLogCleanupWorker.cs Adopts tenant-scoped worker auditing.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​HealthChecks/​BackgroundWorkers/​DataHealthCheckWorker.cs Adds tenant audit scopes.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​GrantsPortal/​Notifications/​ApplicantUpdateEmailRecoveryWorker.cs Adds tenant-scoped recovery auditing.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​GrantsPortal/​GrantsPortalMessageCleanupWorker.cs Adopts shared worker execution context.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​GrantManagerApplicationModule.cs Registers background-execution authorization.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Events/​DateBasedScheduledNotificationJob.cs Adds tenant-scoped notification auditing.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Applicants/​BackgroundWorkers/​FiscalYearEndRolloverWorker.cs Adds tenant-scoped rollover auditing.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application/​Applicants/​BackgroundWorkers/​ApplicantTenantMapReconciliationWorker.cs Adopts shared worker execution context.
applications/​Unity.GrantManager/​src/​Unity.GrantManager.Application.Contracts/​Unity.GrantManager.Application.Contracts.csproj Adds XML cryptography dependency pin.
applications/​Unity.GrantManager/​package.json Adds solution-level DOMPurify dependency.
applications/​Unity.GrantManager/​modules/​Unity.Theme.UX2/​src/​Unity.Theme.UX2/​Unity.AspNetCore.Mvc.UI.Theme.UX2.csproj Adds theme embedding and Razor inputs.
applications/​Unity.GrantManager/​modules/​Unity.Theme.UX2/​src/​Unity.Theme.UX2/​Themes/​UX2/​Layouts/​Empty.cshtml Adds development browser refresh.
applications/​Unity.GrantManager/​modules/​Unity.Theme.UX2/​src/​Unity.Theme.UX2/​Themes/​UX2/​Layouts/​Application.cshtml Adds development browser refresh.
applications/​Unity.GrantManager/​modules/​Unity.Theme.UX2/​src/​Unity.Theme.UX2/​Themes/​UX2/​Layouts/​Account.cshtml Adds development browser refresh.
applications/​Unity.GrantManager/​modules/​Unity.Theme.UX2/​src/​Unity.Theme.UX2/​Themes/​UX2/​Components/​Topbar/​Default.cshtml HTML-encodes badge claims.
applications/​Unity.GrantManager/​modules/​Unity.Theme.UX2/​src/​Unity.Theme.UX2/​Themes/​UX2/​Components/​Toolbar/​UserMenu/​Default.cshtml Uses current tenant availability.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​Utils/​UnityQuartzBackgroundWorkerBase.cs Centralizes worker identity and auditing.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​Utils/​BackgroundJobContext.cs Separates execution and audit scopes.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​Utils/​BackgroundExecutionAuthorizationHandler.cs Authorizes trusted background execution.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​Unity.SharedKernel.csproj Adds Quartz and cryptography references.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​MessageBrokers.RabbitMQ/​QueueConsumerHandler.cs Adds bounded retries and isolates audit failures.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​MessageBrokers.RabbitMQ/​QueueChannelProvider.cs Implements delayed retry publishing.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​MessageBrokers.RabbitMQ/​Interfaces/​IQueueChannelProvider.cs Defines retry-publishing contract.
applications/​Unity.GrantManager/​modules/​Unity.SharedKernel/​MessageBrokers.RabbitMQ/​Constants/​QueueingConstants.cs Defines retry limits and delays.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​test/​Unity.Payments.Application.Tests/​PaymentRequests/​CasPaymentRequestCoordinatorTests.cs Tests concurrency retries and stale results.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​test/​Unity.Payments.Application.Tests/​Domain/​PaymentRequests/​PaymentRequest_Constructor_Tests.cs Tests Level 3 slot management.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Web/​Pages/​PaymentApprovals/​UpdatePaymentRequestStatus.cshtml.cs Removes mutations during modal rendering.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Application/​PaymentRequests/​CasPaymentRequestCoordinator.cs Adds concurrency-aware CAS updates.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Application/​PaymentRequests/​BackgroundJobWorkers/​ReconciliationProducer.cs Adopts shared worker execution context.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Application/​PaymentRequests/​BackgroundJobWorkers/​FinancialSummaryNotifier.cs Exposes per-tenant notification execution.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Application/​PaymentRequests/​BackgroundJobWorkers/​FinancialNotificationSummaryWorker.cs Wraps tenant notifications in audit scopes.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Application/​Domain/​Services/​PaymentsManager.cs Updates approval slots during commands.
applications/​Unity.GrantManager/​modules/​Unity.Payments/​src/​Unity.Payments.Application/​Domain/​PaymentRequests/​PaymentRequest.cs Adds Level 3 slot management.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​test/​Unity.Notifications.EntityFrameworkCore.Tests/​TemplateLockRepositoryTests.cs Tests active tenant-template lookup.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​test/​Unity.Notifications.Application.Tests/​TemplatesServiceTests.cs Supplies new service dependencies.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​test/​Unity.Notifications.Application.Tests/​ScheduledNotificationHelperTests.cs Tests decline-rationale token rendering.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​src/​Unity.Notifications.Web/​Views/​Settings/​NotificationsSettingGroup/​Default.js Stops deletion when preflight fails.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​src/​Unity.Notifications.Web/​Pages/​Notifications/​Index.js Corrects table reload references.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​src/​Unity.Notifications.EntityFrameworkCore/​Repositories/​TemplatesRepository.cs Implements transactional template locking.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​src/​Unity.Notifications.EntityFrameworkCore/​EntityFrameworkCore/​NotificationsDbContextModelCreatingExtensions.cs Changes template-variable type default.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​src/​Unity.Notifications.Domain/​Templates/​ITemplatesRepository.cs Adds active-template locking contract.
applications/​Unity.GrantManager/​modules/​Unity.Notifications/​src/​Unity.Notifications.Application/​Templates/​TemplatesService.cs Adds permissions and protected deletion.
applications/​Unity.GrantManager/​modules/​Unity.Flex/​src/​Unity.Flex.Web/​Views/​Shared/​Components/​QuestionSelectListWidget/​QuestionSelectListViewModel.cs Makes property hiding explicit.
applications/​Unity.GrantManager/​modules/​Unity.Flex/​src/​Unity.Flex.Web/​Pages/​Components/​DataGrid/​DataGridWriteService.cs Makes row deletion publicly callable.
applications/​Unity.GrantManager/​modules/​Unity.AI/​src/​Unity.AI.Application/​Unity.AI.Application.csproj Updates ImageSharp dependency.
applications/​Unity.GrantManager/​global.json Pins the .NET SDK.
applications/​Unity.GrantManager/​common.props Updates shared cryptography pin and warning suppression.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread applications/Unity.GrantManager/package.json Outdated
Comment on lines +490 to +492
b.HasIndex(x => x.EmailTemplateId);
// Foreign key constraint prevents concurrent template deletion races.
b.HasOne<EmailTemplate>().WithMany().HasForeignKey(x => x.EmailTemplateId).IsRequired().OnDelete(DeleteBehavior.Restrict);
return Ok(new List<RecipientDto>());
}

[Authorize(GrantManagerPermissions.NotificationScheduler.Default)]
@github-actions

Copy link
Copy Markdown

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 1461
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@github-actions

Copy link
Copy Markdown

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 1461
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 1461
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@JamesPasta JamesPasta closed this Oct 16, 2026
@JamesPasta
JamesPasta deleted the feature/AB#34582-TightenAPISecurity branch October 16, 2026 17:49

This branch had an error being deployed

1 failed deployment
dev — 5f3cf7c6 Deployed Oct 16, 2026 by JamesPasta via SonarCloud #2332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants