ACA-6528 Role Team assignment support EDA assignments with name - #205
rohitthakur2590 wants to merge 28 commits into
Conversation
ed2bede to
47c8191
Compare
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
| assignment_objects: | ||
| - name: "mco - preprod" | ||
| type: job_templates | ||
| organization: "Preprod" |
There was a problem hiding this comment.
calling it out, so here we see an example of the organization supporting lookup. Yeah that's probably fine.
AlanCoding
left a comment
There was a problem hiding this comment.
My hesitations here are all on the type handling. The rest of this particular patch is absolutely necessary and needs to get in. But those points are:
- Code DRY issue, just used a shared type mapping dict
_CONTENT_TYPE_ENDPOINT_MAPand - I think the "type" format inconsistency with the role_definition.content_type field is a real major issue, I would vote to make this new "type" match, but expect there might be controversy around it
… consistent with AAP api
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
rohitthakur2590
left a comment
There was a problem hiding this comment.
LGTM ! thank you @TheNova22
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
CasC NotificationThis PR touches areas that may affect the CasC collections (e.g. infra.aap_configuration). Detected changes in CasC-monitored areas:
Please tag the CasC collections team in this PR so they are aware of the change.
|
|
DVCS PR Check Results: Could not find JIRA key(s) in PR title, branch name, or commit messages |
Description
- What is being changed?
The following change expands role_team_assignment to support Controller, EDA, and Hub resources; fix role_definition permissions idempotency; fix user password change detection
plugins/action/base_action.py
plugins/action/role_definition.py
plugins/action/role_team_assignment.py
(API path for 19 supported resource types across Gateway, Controller, EDA, and Hub)
types
field since they have no integer id
plugins/action/user.py
plugins/modules/role_team_assignment.py
plugins/plugin_utils/api/v1/role_team_assignment.py
plugins/plugin_utils/platform/direct_client.py
- Why is this change needed?
Role assignment routing was broken for EDA projects (ACA-6206 / AAPRFE-2614). eda.project and awx.project share the suffix project, so suffix-based resolution mapped both to projects → /api/controller/v2/projects/. Assigning a role scoped to an EDA project silently targeted Controller, returning a wrong resource or a 404. Teams could not be granted access to EDA projects through CaC playbooks.
role_team_assignment only supported Gateway resources. Controller, EDA, and Hub resources had no routing, making cross-platform RBAC automation impossible.
role_definition reported spurious changes every run because the Gateway returns permissions alphabetically and the change detection was order-sensitive.
user triggered false-positive password updates because$encrypted$ was included in change detection even when update_secrets=false.
- How does this change address the issue?
_FULL_TYPE_OVERRIDES is checked before the suffix fallback in _get_expected_endpoint(). When content_type is exactly eda.project, it returns eda_projects and routes to /api/eda/v1/projects/. Controller projects
(awx.project) continue resolving via suffix to projects → /api/controller/v2/projects/ and are unaffected.
Full cross-platform support is added via _SERVICE_LOOKUP_PATH_MAP, covering all 19 resource types. Non-gateway resources use manager.search_api() with absolute paths; Hub Pulp resources extract IDs from prn
when no integer ID is present.
Permissions idempotency is fixed by _ORDER_INSENSITIVE_FIELDS — role_definition opts permissions in, so alphabetical reordering by the API no longer triggers a change.
The user password fix moves password out of change detection entirely and uses _should_update() override + _pre_execute_hook() to send it to the API only when update_secrets=True or when other fields are
already being patched.
Assisted By: Claude Code Sonet 4.6
Type of Change
Self-Review Checklist
meta/routing.yml)deprecated:block inDOCUMENTATIONwith removal versionSummary by CodeRabbit
New Features
update_secrets.Bug Fixes
Documentation