You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see the support is only for few db's and we should be able to read secrets only for those datasources, my use case is the credentials ( accessKey and secretKey) are injected into a vault sidecar, upon starting of the pod I want to read those and assign it to the quarkus properties, something like -
I have tried different approaches but couldn't read these values below is my sample credentials provider class.
@ApplicationScoped @unremovable @nAmed(value = "s3-credentials-provider")
public class S3CredentialsProvider implements CredentialsProvider {
private final Logger logger = LoggerFactory.getLogger(S3CredentialsProvider.class);
public static final String ACCESS_KEY = "accesskey";
public static final String SECRET_KEY = "secretkey";
/**
* Method to get credentials for the given provider.
*
* @param credentialsProviderName credentials provider name
* @return key/value pairs
*/
@SneakyThrows
public Map<String, String> getCredentials(String credentialsProviderName) {
VaultSidecarConfig.initialize();
var s3AccessKey = VaultSidecarConfig.getVaultSecretsMap().get(ACCESS_KEY).toString();
var s3SecretKey = VaultSidecarConfig.getVaultSecretsMap().get(SECRET_KEY).toString();
Map<String, String> properties = new HashMap<>();
properties.put("s3AccessKey", s3AccessKey);
properties.put("s3SecretKey", s3SecretKey);
return properties;
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I see the support is only for few db's and we should be able to read secrets only for those datasources, my use case is the credentials ( accessKey and secretKey) are injected into a vault sidecar, upon starting of the pod I want to read those and assign it to the quarkus properties, something like -
quarkus.s3.aws.credentials.static-provider.access-key-id=${s3AccessKey}
quarkus.s3.aws.credentials.static-provider.secret-access-key=${s3SecretKey}
I have tried different approaches but couldn't read these values below is my sample credentials provider class.
@ApplicationScoped
@unremovable
@nAmed(value = "s3-credentials-provider")
public class S3CredentialsProvider implements CredentialsProvider {
}
tried adding below properties -
#credentials provider
quarkus.datasource.credentials-provider=custom
quarkus.datasource.credentials-provider-name=s3-credentials-provider
but this did not help .. any other suggestions on how I can inject these or any other values from vault to the properties ?
Beta Was this translation helpful? Give feedback.
All reactions