You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[AAP-51419] Fix remote object handling in RBAC assignments and resource sync
This commit addresses multiple issues with remote object support in RBAC:
1. **Fix prefetch_related issue with remote objects**: Update FederatedForeignKey
to properly handle remote objects that were incorrectly cached as None by
Django's prefetch_related mechanism. Remote objects are now recreated when
needed instead of returning None.
2. **Fix UUID serialization in resource sync**: Resolve TypeError in
ResourceAPIClient.sync_unassignment when syncing assignments with UUID
primary keys by converting pk values to strings for JSON serialization.
3. **Fix typo in RemoteObject error message**: Correct "Generlized" to
"Generalized" in RemoteObject.get_ct_from_type method.
4. **Add comprehensive test coverage**: New test suites covering:
- Remote object serialization behavior in assignment serializers
- Remote object handling in assignment view operations
- ResourceAPIClient remote object sync functionality
- UUID serialization fixes for various object types
- Integration tests validating end-to-end remote object workflows
These changes improve the reliability of remote object assignments and ensure
proper synchronization of permissions across distributed systems.
Co-Authored-By: Claude <[email protected]>
Signed-off-by: Fabricio Aguiar <[email protected]>
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
0 commit comments