Skip to content

HIVE-28957: Enhance TestHiveMetaStoreAuthorizer #5819

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jjiang037
Copy link
Contributor

What changes were proposed in this pull request?

Enhance TestHiveMetaStoreAuthorizer to verify that the correct privilege objects are created for each operation and ensure the appropriate filter contexts are constructed and applied

Why are the changes needed?

Existing TestHiveMetaStoreAuthorizer uses DummyHiveAuthorizerFactory, which bypasses validation of the real HiveMetaStoreAuthorizer's filtering behavior.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Regression tests, unit tests

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the TestHiveMetaStoreAuthorizer tests to verify that proper privilege objects are generated and filter contexts are applied as expected. Key changes include switching from the DummyHiveAuthorizerFactory to a dedicated MockHiveAuthorizerFactory, adding additional authorization failure checks with explicit fail messages, and introducing a new mock filter hook (MockMetaStoreFilterHook) to validate ownership-based filtering in metadata operations.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/TestHiveMetaStoreAuthorizer.java Updated tests to use a mock authorizer, added privilege capture and ownership filtering tests, and modified configuration to use the new mock classes.
ql/src/test/org/apache/hadoop/hive/ql/security/authorization/plugin/metastore/MockMetaStoreFilterHook.java Introduced a mock filter hook implementation to verify that filtering logic based on ownership behaves as expected.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants