Skip to content

RANGER-5729: Unable to import exported GDS policies via Service Manag… - #1125

Merged
dineshkumar-yadav merged 1 commit into
apache:masterfrom
Sanket-Shelar:RANGER-5729
Aug 10, 2026
Merged

RANGER-5729: Unable to import exported GDS policies via Service Manag…#1125
dineshkumar-yadav merged 1 commit into
apache:masterfrom
Sanket-Shelar:RANGER-5729

Conversation

@Sanket-Shelar

@Sanket-Shelar Sanket-Shelar commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

…er due to 403 Error

What changes were proposed in this pull request?

Governed Data Sharing (GDS) policies are designed to be managed exclusively through GDS APIs. However, they were inadvertently being included when exporting policies from the Report page. When users attempted to import these files back through the Service Manager, it resulted in a 403 error.

This patch resolves the issue by aligning the export and import behaviors:

Export Updates: GDS policies are now automatically excluded when exporting policies (JSON, CSV, or Excel).

Import Updates: If a user imports a legacy file that still contains GDS policies, the system will now safely skip the GDS policies (logging a helpful warning) rather than failing the entire import. This ensures that non-GDS policies, like Hive, continue to import successfully.

How was this patch tested?

Created both GDS objects (datashares, datasets, policies) and non-GDS policies (Hive).

Exported policies from the Report page and verified that GDS policies are no longer included in the file.

Imported the newly exported file via Service Manager and confirmed it succeeds without a 403 error.

Imported a legacy export file containing GDS policies to verify that non-GDS policies import correctly while GDS policies are cleanly skipped and logged.

}

private boolean isGdsPolicy(RangerPolicy policy) {
return EMBEDDED_SERVICEDEF_GDS_NAME.equals(policy.getServiceType()) || ServiceDBStore.GDS_SERVICE_NAME.equals(policy.getService());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must this condition look for service name match - ServiceDBStore.GDS_SERVICE_NAME.equals(policy.getService())? Why not only look for serviceType match?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added as an additional check, in case serviceType is not present. I have udpated the condition to only check for serviceType match.

@dineshkumar-yadav
dineshkumar-yadav merged commit 421db18 into apache:master Aug 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants