public class AwsSecretsManagerConnectionPlugin2 extends AwsSecretsManagerConnectionPlugin
AwsSecretsManagerConnectionPlugin.
This plugin reuses all of the credential fetching, caching, parsing, and error handling of the original plugin, and only changes the cache-refresh strategy:
At most one in-flight refresh exists per (secretId, region) key
(pendingRefreshes), which prevents a thundering herd of Secrets Manager calls when many
connections are opened concurrently with an expired cache.
Both plugins share the same credential cache (the StorageService), so credentials
cached by one are visible to the other.
| Modifier and Type | Field and Description |
|---|---|
protected static long |
MIN_EXPIRATION_TIME_SECONDS |
ENDPOINT_PROPERTY, fetchCredentialsCounter, pluginService, REGION_PROPERTY, regionUtils, secret, SECRET_ID_PROPERTY, secretExpirationTime, SECRETS_MANAGER_EXPIRATION_SEC_PROPERTY, SECRETS_MANAGER_SECRET_PASSWORD_PROPERTY, SECRETS_MANAGER_SECRET_USERNAME_PROPERTY, servicesContainer, TELEMETRY_UPDATE_SECRETS| Constructor and Description |
|---|
AwsSecretsManagerConnectionPlugin2(FullServicesContainer servicesContainer,
java.util.Properties props) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
resolveSecretExpirationTime(long configuredExpirationTime)
Clamp the configured expiration time to a minimum to avoid excessively frequent background
refresh triggers.
|
protected boolean |
updateSecret(HostSpec hostSpec,
boolean forceReFetch)
SWR override of the inherited cache-refresh logic.
|
clearCache, connect, fetchAndStoreSecret, forceConnect, getSubscribedMethodsacceptsStrategy, execute, getHostSpecByStrategy, getHostSpecByStrategy, getSnapshotState, initHostProvider, notifyConnectionChanged, notifyNodeListChangedprotected static final long MIN_EXPIRATION_TIME_SECONDS
public AwsSecretsManagerConnectionPlugin2(FullServicesContainer servicesContainer, java.util.Properties props)
protected long resolveSecretExpirationTime(long configuredExpirationTime)
resolveSecretExpirationTime in class AwsSecretsManagerConnectionPluginconfiguredExpirationTime - the value configured via secretsManagerExpirationTimeSec.protected boolean updateSecret(HostSpec hostSpec, boolean forceReFetch) throws java.sql.SQLException
updateSecret in class AwsSecretsManagerConnectionPluginforceReFetch - when true (login-failure retry path) a synchronous fetch is always
performed; otherwise stale credentials are served immediately while a
background refresh runs.true only when credentials were freshly fetched from the service, matching the
contract of the superclass (a true result suppresses the login-failure retry).java.sql.SQLException