Repository navigation
[5066] integratre users with fk org - #1515
Draft
strongmindsaln wants to merge 74 commits into
Draft
strongmindsaln wants to merge 74 commits into
strongmindsaln wants to merge 74 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Production ingestion is not wired, and resolution bypasses established permission and user-deletion cleanup workflows.
Review effort: Balanced
Findings: 3
Open (3)
What changed in this PR
Adds durable FK Organisation user-deletion delivery from PubSub to KITOS, with authenticated ingestion and administrator-controlled resolution.
Changes:
- Adds PubSub outbox delivery, token authentication, retries, and persistence.
- Adds KITOS ingestion, review, resolution, and PubSub-user authorization.
- Adds PostgreSQL migrations and automated tests.
| File | Description |
|---|---|
Tests.Unit.Presentation.Web/Controllers/API/V2/IntegrationApiAuthenticationTest.cs |
Tests integration endpoint authentication. |
Tests.Unit.Presentation.Web/Controllers/API/V2/ExternalUserChangeIngestionControllerTest.cs |
Tests ingestion payload handling. |
Tests.Unit.Core.ApplicationServices/ApplicationServices/Users/UserWriteServiceTest.cs |
Tests PubSub-role administration. |
Tests.Unit.Core.ApplicationServices/ApplicationServices/Users/ExternalUserChangeResolutionServiceTest.cs |
Tests change resolution rules. |
Tests.Unit.Core.ApplicationServices/ApplicationServices/Users/ExternalUserChangeReadServiceTest.cs |
Tests filtering and authorization. |
Tests.Unit.Core.ApplicationServices/ApplicationServices/Users/ExternalUserChangeIngestionServiceTest.cs |
Tests ingestion and deduplication. |
Tests.Container/Tests/UserSyncPersistenceTest.cs |
Tests PostgreSQL persistence and concurrency. |
Tests.Container/Tests.Container.csproj |
Adds required project reference. |
PubSub.Test/Unit/Application.Api/UserChangeDeliveryTest.cs |
Tests delivery retries and outbox behaviour. |
PubSub.Test/Unit/Application.Api/KitosTokenProviderTest.cs |
Tests token caching and renewal. |
PubSub.Infrastructure.DataAccess/PubSubContext.cs |
Maps delivery records. |
PubSub.Infrastructure.DataAccess/Migrations/PubSubContextModelSnapshot.cs |
Updates PubSub schema snapshot. |
PubSub.Infrastructure.DataAccess/Migrations/20260928101510_AddUserChangeDeliveries.Designer.cs |
Defines migration target model. |
PubSub.Infrastructure.DataAccess/Migrations/20260928101510_AddUserChangeDeliveries.cs |
Creates the delivery table. |
PubSub.Core.DomainModel/UserSync/UserDeletionEvent.cs |
Defines normalized deletion events. |
PubSub.Core.DomainModel/UserSync/UserChangeDelivery.cs |
Defines durable delivery state. |
PubSub.Application.Api/UserSync/UserChangeOutbox.cs |
Persists deduplicated deliveries. |
PubSub.Application.Api/UserSync/UserChangeDeliveryWorker.cs |
Delivers queued changes to KITOS. |
PubSub.Application.Api/UserSync/TokenResponse.cs |
Models token responses. |
PubSub.Application.Api/UserSync/KitosTokenProvider.cs |
Acquires and caches KITOS tokens. |
PubSub.Application.Api/Program.cs |
Registers user-sync services. |
PubSub.Application.Api/Controllers/UserSyncStubController.cs |
Adds a non-production test publisher. |
Presentation.Web/Models/API/V2/Internal/Response/User/UserResponseDTO.cs |
Exposes PubSub-user status. |
Presentation.Web/Models/API/V2/Internal/Response/User/ExternalUserChangeResponse.cs |
Defines change responses. |
Presentation.Web/Models/API/V2/Internal/Request/User/BulkResolutionRequest.cs |
Defines bulk resolution requests. |
Presentation.Web/Models/API/V2/Integration/Request/ExternalUserChangePublication.cs |
Defines ingestion envelopes. |
Presentation.Web/Infrastructure/DI/KitosServiceRegistration.cs |
Registers change services and stores. |
Presentation.Web/Infrastructure/Attributes/RequirePubSubUserAttribute.cs |
Enforces current PubSub permissions. |
Presentation.Web/Infrastructure/Attributes/IntegrationApiAttribute.cs |
Configures hidden bearer-only APIs. |
Presentation.Web/Controllers/API/V2/Internal/Users/Mapping/UserResponseModelMapper.cs |
Maps PubSub-user status. |
Presentation.Web/Controllers/API/V2/Internal/Users/GlobalUserInternalV2Controller.cs |
Adds PubSub-user administration. |
Presentation.Web/Controllers/API/V2/Internal/Users/ExternalUserChangesInternalV2Controller.cs |
Adds review and resolution endpoints. |
Presentation.Web/Controllers/API/V2/Integration/IntegrationApiV2Controller.cs |
Adds the integration controller base. |
Presentation.Web/Controllers/API/V2/Integration/ExternalUserChangeIngestionController.cs |
Adds authenticated ingestion. |
Infrastructure.DataAccess/Repositories/ExternalUserChangeStore.cs |
Persists incoming changes. |
Infrastructure.DataAccess/Repositories/ExternalUserChangeResolutionTransaction.cs |
Provides transactional resolution. |
Infrastructure.DataAccess/Repositories/ExternalUserChangeReadStore.cs |
Provides change queries. |
Infrastructure.DataAccess/Migrations/EfCore/KitosContextModelSnapshot.cs |
Updates the KITOS schema snapshot. |
Infrastructure.DataAccess/Migrations/EfCore/20260928121710_AddPubSubUser.cs |
Adds the PubSub-user flag. |
Infrastructure.DataAccess/Migrations/EfCore/20260928101316_AddExternalUserChanges.cs |
Adds external-change persistence. |
Infrastructure.DataAccess/Mapping/UserMap.cs |
Maps the PubSub-user flag. |
Infrastructure.DataAccess/Mapping/ExternalUserChangeMap.cs |
Maps external changes and indexes. |
DeploymentScripts/TestUserSync.ps1 |
Adds a manual sync test script. |
Core.DomainServices/Users/IExternalUserChangeStore.cs |
Defines ingestion persistence. |
Core.DomainServices/Users/IExternalUserChangeResolutionTransaction.cs |
Defines resolution transactions. |
Core.DomainServices/Users/IExternalUserChangeReadStore.cs |
Defines read persistence. |
Core.DomainServices/Queries/User/QueryByPubSubUser.cs |
Filters PubSub users. |
Core.DomainModel/Users/ExternalUserChange.cs |
Defines external-change domain state. |
Core.DomainModel/User.cs |
Adds PubSub-user status. |
Core.ApplicationServices/Users/Write/UserWriteService.cs |
Adds PubSub-role updates. |
Core.ApplicationServices/Users/Write/IUserWriteService.cs |
Exposes PubSub-role updates. |
Core.ApplicationServices/Users/ExternalUserChangeResolutionService.cs |
Resolves deletion changes. |
Core.ApplicationServices/Users/ExternalUserChangeReadService.cs |
Reads and filters changes. |
Core.ApplicationServices/Users/ExternalUserChangeIngestionService.cs |
Validates and stores changes. |
Core.ApplicationServices/Model/Users/ExternalUserChangeListResult.cs |
Models paged results. |
Core.ApplicationServices/Model/Users/ExternalUserChangeListQuery.cs |
Models list queries. |
Core.ApplicationServices/Model/Users/ExternalUserChangeInput.cs |
Models ingestion input. |
Core.ApplicationServices/Model/Users/ExternalUserChangeBatchResult.cs |
Models batch outcomes. |
Files not reviewed (1)
- PubSub.Infrastructure.DataAccess/Migrations/20260928101510_AddUserChangeDeliveries.Designer.cs: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ds/kitos into feature/kitosudv-5066-fk-org-users
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…edfordeler-connection docs: add Beskedfordeler integration decision record
…om/Strongminds/kitos into feature/kitosudv-5066-fk-org-users
…t-integration [5066] kombit beskedfordeler integration
…om/Strongminds/kitos into feature/kitosudv-5066-fk-org-users
…om/Strongminds/kitos into feature/kitosudv-5066-fk-org-users
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

KITOS Pull request template
Description
Describe what was changed in this branch, and WHY it was changed.
Checklist
The following procedure dictates the steps needed before a Pull request can be merged into master.
Implement:
All requirements are implemented and unit tests are green
Merge master into branch / rebase with master:
Make sure you are testing your changes and how they co-exist with the latest version of master
Green on integration:
All integration tests are green on integration
Add a description
Under "Description" above, explain what was changed in this branch, and WHY it was changed
Database compatibility:
When database changes are included, both SQL Server and PostgreSQL versions have been updated, reviewed, and tested.
Warnings cleanup:
Files with changes should be checked for warnings. Any warnings found should be fixed