Skip to content

IRC: Optimize Credential Vending #3997

Open
singhpk234 wants to merge 2 commits intoapache:mainfrom
singhpk234:optimize/cred-vending
Open

IRC: Optimize Credential Vending #3997
singhpk234 wants to merge 2 commits intoapache:mainfrom
singhpk234:optimize/cred-vending

Conversation

@singhpk234
Copy link
Contributor

About the change

The /credentials endpoint currently performs a full table metadata read from object storage to vend credentials.
This is expensive and unnecessary — the table locations needed for credential vending are already available in the
entity's internal properties stored in the metastore.

This PR introduces an optimized credential vending path (loadCredentialsFromEntityProperties) that reads locations
directly from the metastore, avoiding the object storage round-trip. The optimization is gated behind the
OPTIMIZED_CREDENTIAL_VENDING feature flag (defaults to false). When disabled, the endpoint falls back to the existing
loadTableWithAccessDelegation path. When the entity lacks the required internal properties (e.g. tables created before
the property was stored), it also gracefully falls back.

co-author : @adutra

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) --later
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

Add an OPTIMIZED_CREDENTIAL_VENDING feature flag that allows the
loadCredentials endpoint to vend storage credentials using location
data stored in entity internal properties, bypassing the expensive
full table metadata read from object storage.

When the flag is enabled, the new loadCredentialsFromEntityProperties
path resolves the table's base and data locations directly from the
metastore and uses them to scope credentials. If the entity or its
location data is missing (e.g. external catalogs or pre-apache#3226 data),
it falls back transparently to the standard loadTableWithAccessDelegation
path.
- Add authz test for loadCredentialsFromEntityProperties verifying
  TABLE_READ_DATA and TABLE_WRITE_DATA privileges
- Add integration tests for /loadCredentials endpoint with optimized
  credential vending both enabled and disabled
- Add loadCredentials helper method to CatalogApi
- Remove Javadoc from private vendCredentials method
@sfc-gh-prsingh sfc-gh-prsingh force-pushed the optimize/cred-vending branch from eb5db50 to f802657 Compare March 14, 2026 08:19
@singhpk234 singhpk234 marked this pull request as ready for review March 18, 2026 14:56
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.

1 participant