-
Notifications
You must be signed in to change notification settings - Fork 81
[AAP-54064] Decoupling apps from ansible_base.rbac #869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
Other failures were a test bug that is resolved here, next is:
|
DVCS PR Check Results: PR appears valid (JIRA key(s) found) |
|
||
def to_internal_value(self, data): | ||
from ansible_base.rbac.models import DABPermission | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: RBAC Dependency Issue in Permission Slug Field
The LenientPermissionSlugListField.to_internal_value
method imports DABPermission
without checking if ansible_base.rbac
is installed. This causes an ImportError
when RBAC is unavailable, which is less clear than an explicit RuntimeError
. While RoleDefinitionType
includes an RBAC check, this field could be used independently and would fail.
|
Description
Re-raising #849
Type of Change
Note
Make RBAC optional by adding
is_rbac_installed()
and guarding RBAC-dependent logic across auth, routers, resource registry, sync, and tests.lib/utils/apps.py:is_rbac_installed()
and replace directINSTALLED_APPS
checks.authentication/utils/claims.py
):is_rbac_installed()
inReconcileUser
; makeRoleUserAssignmentsCache
RBAC-aware and gate content types/local prefixes.lib/routers/association_resource_router.py
):registry.py
: Dynamically includeshared.roledefinition
processor only when RBAC installed.rest_client.py
: Guard assignment sync/delete methods with RBAC checks, raisingRuntimeError
if absent.shared_types.py
: Lazy RBAC lookups;RoleDefinitionType
raises if RBAC missing and setscontent_type
field conditionally.tasks/sync.py
: Gate RBAC-dependent helpers and assignment sync; skip assignment sync when RBAC absent.StaticResourceAPIClient
: move mutablerouter
to instance in__init__
.test_app/resource_api.py
):RoleDefinition
resource only when RBAC installed.test_rbac_conditional.py
,test_sync_rbac_errors.py
); minor test updates/marks.Written by Cursor Bugbot for commit b6cd309. This will update automatically on new commits. Configure here.