Skip to content

Add MinIO coverage for AWS-shaped KMS vended credentials#4034

Open
castanhas98 wants to merge 2 commits intoapache:mainfrom
castanhas98:codex/minio-kms-edge-case-test
Open

Add MinIO coverage for AWS-shaped KMS vended credentials#4034
castanhas98 wants to merge 2 commits intoapache:mainfrom
castanhas98:codex/minio-kms-edge-case-test

Conversation

@castanhas98
Copy link

@castanhas98 castanhas98 commented Mar 20, 2026

Summary

This PR adds focused MinIO integration coverage for the AWS-shaped vended-credentials/KMS edge case.

It adds a matrix that varies region and roleArn independently with kmsUnavailable=false and verifies that only the region + roleArn case fails during loadTable, with the expected MinIO/KMS-scoping error.

It also adds a companion test showing that the same AWS-shaped configuration succeeds when kmsUnavailable=true, and refactors the test helper so the failing path still cleans up table state correctly.

Why this change is needed

The existing MinIO coverage exercised standard vended-credentials behavior, but it did not cover the AWS-shaped read-only KMS path that is triggered only when both region and roleArn are set while KMS remains enabled.

That path is important because Polaris will add the wildcard KMS ARN for read-only AWS-style access, and MinIO STS rejects that resource as invalid. This PR makes that edge case explicit and locks in the expected kmsUnavailable behavior.

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @castanhas98 ! Adding these tests sounds reasonable to me 👍 Just one minor comment.

includeRoleArn ? Optional.of(TEST_ROLE_ARN) : Optional.empty(),
Optional.of(false))) {
TableIdentifier id = createTableAndVerifyMetadata(restCatalog);
if (expectFailure) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind refactoring expected failures and successes into two separate test methods? I believe it would be easier for the reader to follow the test logic and analyse failures, should they occur.

Copy link
Author

Choose a reason for hiding this comment

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

Refactored this into separate success and failure tests so the expected behavior is easier to scan and diagnose. I also reran the targeted MinIO/KMS integration tests locally after the split. Thanks for the suggestion.

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Thanks, @castanhas98 !

I suppose we can merge on Mon if there are no other review concerns.

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Mar 21, 2026
@dimas-b
Copy link
Contributor

dimas-b commented Mar 21, 2026

@castanhas98 : please run spotless checks locally - I believe the first CI run failed because of that.

@castanhas98
Copy link
Author

@dimas-b Thanks for the review! I ran spotless on the previous commit, so we should be good on that front.

Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

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

Thanks @castanhas98 !

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