Skip to content

[5066] integratre users with fk org - #1515

Draft
strongmindsaln wants to merge 74 commits into
masterfrom
feature/kitosudv-5066-fk-org-users
Draft

strongmindsaln wants to merge 74 commits into
masterfrom
feature/kitosudv-5066-fk-org-users

Conversation

@strongmindsaln

Copy link
Copy Markdown
Collaborator

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

Copilot AI balanced review requested due to automatic review settings September 29, 2026 10:46
@strongmindsaln
strongmindsaln marked this pull request as draft September 29, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 High severity

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.

strongmindsaln and others added 24 commits September 29, 2026 13:05
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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…edfordeler-connection

docs: add Beskedfordeler integration decision record
…t-integration

[5066] kombit beskedfordeler integration

This branch has not been deployed

No deployments
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