RANGER-5687: Add feature flag to artifacts for RANGER-5628#1073
Conversation
… on resource policy, then flag is off, ui hangs (cherry picked from commit e25cdb00df8ca54a75bb998863ede76e8d52148f)
(cherry picked from commit d06e4049a352ee3caad45a561098a7031ada557f)
Move enableOzoneActionPolicy handling out of RangerInlinePolicyEvaluator into RangerOzoneAuthorizer, including legacy session-policy sanitization and a unit test for flag-off behavior with embedded grant actions.
…ges. Use ServiceDefUtil.getBooleanValue in plugin-ozone and security-admin per PR review, and revert agents-common ozone-specific additions.
|
hi @ramackri - thanks for helping address the comments by @mneethiraj. I tested these changes locally with Ozone and Ranger smoke tests and they look good to me. So if they look good to Ranger team and there are no more outstanding comments, please go ahead. Thanks! |
Rename enableOzoneActionPolicy to enableActionMatcherInPoliciesCondition and admin config to ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition. Non-ozone service defs always get false; ozone reads site config. Addresses PR review from fimugdha.
|
@fmorg-git, please ensure to add the feature flag in dev-support/ranger-docker and test it in docker based environments. |
On upgrade, sync enableActionMatcherInPoliciesCondition from admin config into ozone def_options only, alongside existing policyConditions updates for action-matches.
Wire RANGER_OZONE_ENABLE_ACTION_MATCHER into ranger-docker so admin setup reads the flag before J10065 runs, fix the def_options constant, and update patch unit tests after E2E validation on Mac with fresh Postgres installs.
@kumaab Addressed this |
|
hi all, something appears to be wrong. I just tried my Ozone/Ranger smoke tests with the feature flag set to true, but it is not working now (this used to work before). So something with the changes between the last time I said it was working and now seems to be different. I updated with the new name |
Stale def_options from an earlier J10065 run or the pre-rename enableOzoneActionPolicy option could override ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition, hiding action-matches in Admin UI and ozone authorizer even when the flag was set true. Admin config is now authoritative when serving the ozone service-def, and action-matches is restored from the embedded def when enabled but missing from DB.
| } | ||
|
|
||
| dbOzoneServiceDef.setPolicyConditions(embeddedPolicyConditions); | ||
| final boolean enableActionMatcherInPoliciesCondition = RangerAdminConfig.getInstance().getBoolean(RangerServiceDefService.PROP_ENABLE_ACTION_MATCHER_IN_POLICIES_CONDITION, false); |
There was a problem hiding this comment.
Are changes in PatchForOzoneServiceDefPolicyConditionUpdate_J10065.java necessary, given RangerServiceDefService.java handles service-def updates based on feature-flag while retrieving the service-def from the database? If no additional cases are handled here, I suggest reverting changes in PatchForOzoneServiceDefPolicyConditionUpdate_J10065.java.
There was a problem hiding this comment.
updated to revert - e220c42. Also updated the README.md accordingly.
The renamed enableActionMatcherInPoliciesCondition option and admin runtime overlay make enableOzoneActionPolicy obsolete for 3.0.
Done |
|
Fixed |
…IN_POLICIES_CONDITION to PROP_ENABLE_ACTION_MATCHER_IN_POLICIES_CONDITION_FOR_OZONE
mneethiraj
left a comment
There was a problem hiding this comment.
I suggest replacing changes in dev-support/ranger-docker with an update in Ranger admin setup processing of install.properties, to support configuration
FF_ENAB_OZONE_ACTION_MATCHES_CONDITION mapped to ranger.servicedef.ozone.enableActionMatcherInPoliciesCondition in the generated ranger-admin-site.xml.
updated - d4343e5 |
…ION_MATCHES_CONDITION
fimugdha
left a comment
There was a problem hiding this comment.
LGTM. Lets wait to get a review vote from @mneethiraj.
PR was not refreshed, we already have a vote from him. |
|
Thanks all for the review and merge. |
What changes were proposed in this pull request?
It was requested to add a feature flag for the work in RANGER-5628. This ticket adds it.
The flag is configured as follows in
ranger-admin-site.xml:This code is mostly generated with Cursor with some manual edits by me.
https://issues.apache.org/jira/browse/RANGER-5687
How was this patch tested?
smoke test locally with ozone and ranger with ranger flag off and on