-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support for new Polkit (versions >= 124) #1147
Conversation
ee5ae7c
to
ca99886
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1147 +/- ##
==========================================
- Coverage 91.55% 91.45% -0.10%
==========================================
Files 79 79
Lines 8961 9074 +113
==========================================
+ Hits 8204 8299 +95
- Misses 747 765 +18
Partials 10 10 ☔ View full report in Codecov by Sentry. |
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.
Great work!
It’s hard to check every single golden files, I did check most of them but I assume you did check all of them one by one :)
I have some nitpicks, but nothing really core to the changes. However, I see that in the policy manager tests testdata/existing-files
don’t contains pre-existings rules.d
content which should be ready to be overriden, shouldn’t that be the case or does the github diff is fooling me? I see also that you generate some files that should be as test fixtures IMHO. Finally, some idea on how to improve IMHO the code readability and logic.
But overall this looks really sweet, nice!
d0f97f8
to
aa6eb5a
Compare
3d06ce0
to
e55daf3
Compare
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.
We do have everything we need now. Well done!
The "new" polkit (version 124 and above) introduced a lot of changes in its behavior. This commit updates the privilege escalation policy manager to be able to correctly identify which polkit version is running in the client and apply the policy properly
This is likely the most senstive part of this update, since we need to ensure we properly parse the existing files so we don't damage the current admin structure of the client. Therefore, it deserves a unit test
e55daf3
to
8713c66
Compare
Now that we support the new polkit versions, we don't need to recommend this anymore.
We used to rely only on a single way of applying the privilege policy. Now, we have two ways of applying it based on the polkit version. The e2e tests validation needs to account for that.
The new Polkit introduced quite some changes, even syntax ones. Since then, users had to install an additional compatibility package to make the privilege escalation policy work.
This PR adds support for the new Polkit versions whilst still supporting clients that have the older versions and properly handling migration between versions as well.
UDENG-5318