Skip to content

Conversation

@tokoko
Copy link
Contributor

@tokoko tokoko commented Feb 8, 2026

  • Decouples credential vending from StorageCredentialCache by moving orchestration logic into StorageAccessConfigProvider
  • Adds buildCacheKey to PolarisStorageIntegrationProvider interface so each storage backend (AWS, GCP, Azure) controls which fields are included in its cache key (e.g., only AWS includes principal name and session tags). non-AWS backends no longer include principal name and session tags in cache key.
  • Remove getSubscopedCredsForEntity from PolarisMetaStoreManager implementations (AtomicOperation, Transactional, NoSql) — credential vending now goes through the standalone PolarisCredentialVendorImpl
  • Update PolarisCredentialVendor to accept PolarisEntity directly instead of entity IDs. This is to avoid having to rematerialize PolarisEntity that is already available.

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 keeping this refactoring going, @tokoko !

From my POV this PR is moving in the right direction. I've got just a couple of relatively minor comments.

}

@Override
public @Nonnull ScopedCredentialsResult getSubscopedCredsForEntity(
Copy link
Contributor

Choose a reason for hiding this comment

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

While I agree that this change makes sense in general, polaris-core is traditionally sensitive to API changes (despite the standing evolution guidelines).

I'd propose to keep this method for now, even if it will be unused in OSS code.

Copy link
Contributor

Choose a reason for hiding this comment

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

The NoSQL impl. can be replaced with a throw new UnsupportedOperationException(), but let's keep related code in polaris-core.

Supplier<StorageAccessConfig> loader) {
long maxCacheDurationMs = maxCacheDurationMs(realmConfig);
return cache
.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

The Supplier in this .get method in Caffeine is supposed to be fast, but I believe in our case it may hit network (e.g. STS), which is not desirable... It might be best to go back to LoadingCache, which allows loaders to be blocking.

key,
k -> {
LOGGER.atDebug().log("StorageCredentialCache::load");
StorageAccessConfig accessConfig = loader.get();
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, I think this should be something like loader.get(key). That is to ensure we produce StorageAccessConfig from exactly the same data that is used as the cache key, i.e. any change in key results in regeneration of StorageAccessConfig and any two StorageAccessConfig objects are logically equivalent if their keys match. WDYT?

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.

2 participants