Skip to content

Conversation

@idotta
Copy link
Owner

@idotta idotta commented Jan 2, 2026

Note

Multi-tenant claim/validation alignment

  • Middleware now reads tenant claim type from IdmtOptions and validates token against TenantInfo.Identifier (not Id)
  • IdmtUserClaimsPrincipalFactory pulls tenant from store and writes the tenant claim as tenantInfo.Identifier
  • CurrentUserService sources TenantId from tenant context and adds TenantIdentifier (claim or context fallback)
  • RegisterUser resolves tenant once from context and uses it for creation/logging

Tests and utilities

  • New IdmtUserClaimsPrincipalFactoryTests and expanded CurrentUserServiceTests covering tenant identifier, custom claim types, and is_active
  • Updated API test factory to use IdmtMultiTenantStrategy.DefaultHeaderName
  • Minor unit test modernizations (collection expressions)

Written by Cursor Bugbot for commit 3ad54e0. This will update automatically on new commits. Configure here.

idotta added 4 commits January 2, 2026 12:51
- Updated RegisterUser to retrieve tenant ID from the current user service, ensuring user registration is context-aware.
- Modified ValidateBearerTokenTenantMiddleware to validate tenant claims against the current request's tenant identifier.
- Enhanced CurrentUserService to include TenantIdentifier for better tenant context handling.
- Updated IdmtUserClaimsPrincipalFactory to ensure tenant claims are correctly generated and tested.
- Improved unit tests for CurrentUserService and IdmtUserClaimsPrincipalFactory to cover new tenant handling logic.
@idotta idotta merged commit 7595f3d into main Jan 2, 2026
2 checks passed
@idotta idotta deleted the fix-5.0.2 branch January 2, 2026 19:09
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.

2 participants