-
Notifications
You must be signed in to change notification settings - Fork 74
[WIP] [AAP-48392] Models and APIs for tracking remote permissions in DAB RBAC #749
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
…1355) This is another version of #1353, but with the dependency changes reverted. That linked PR (draft) shows that this is effective. I expect tests will pass here (which current DAB) as well. But that PR shows that, if we merge this, it will make downstream tests for ansible/django-ansible-base#749 will pass. ---- Technical summary: There are 2 structural changes in DAB RBAC that require adjustment by the app: - the `post_migrate` signal will now run _once_ as opposed to run _for every app_ and to do that, it can only run when the post migrate signal is called for its own app (the "dab_rbac" app), but doing this mucks with the assumptions around what order post_migrate methods run in, so this often requires other post-migrate methods to call the methods to create DAB types and permissions to resolve the ordering problem - A DAB RBAC-specific content type app is introduced, and this is clearly not the same as the proper `ContentType` model, and this will error any queries that pass a content type object as a python object. To do that, we'll just use the variable from DAB RBAC for the content type, which will give the correct model for whatever version of DAB we are using.
Documenting the eda-server test failure I'm troubleshooting, log:
failure:
It tried to create at:
I might have ran into the indexing bug, because I set a pk value in migrations for the types, but the current pk index for new objects does not increment in some databases. This might be a good lead. Apparently this is called "sequence desynchronization" |
The higher-level error is that AwxToken is not a registered permission model So that suggests that |
12b210e
to
47de239
Compare
Add tests for new content type RBAC model
Type hinting compat with lower python versions
Fix flake8 and simpler type ct calc
Update on downstream tests:
with
This is a novel failure, due to adding |
|
DVCS PR Check Results: PR appears valid (JIRA key(s) found) |
Description
This modifies the RBAC app so that the models can store permissions for remote objects - objects that don't actually exist in the local server. To know which are which, a
service
field is added to our type-tracking model, which is also new as of this work. Importantly, permission evaluations can be done for both local items and remote items.Why? Just as we have synchronization to a "resource server" via the resource registry app, this allows you to appoint a single service to be the gatekeeper for RBAC. This still requires synchronization, making it different from other approaches. Several new endpoints under
/service-index/
are introduced to help facilitate that synchronization.EDITing some snapshots of the progress state
Fixes #80
Type of Change
Self-Review Checklist
Testing Instructions
Prerequisites
Steps to Test
Expected Results
Additional Context
Required Actions
Screenshots/Logs