use of com.google.cloud.secretmanager.v1.SecretVersionName in project nomulus by google.
the class SqlCredentialStore method createOrUpdateCredential.
public void createOrUpdateCredential(SqlUser user, String password) {
SecretVersionName dataName = saveCredentialData(user, password);
saveLiveLabel(user, dataName);
}
use of com.google.cloud.secretmanager.v1.SecretVersionName in project spring-cloud-gcp by GoogleCloudPlatform.
the class SecretManagerPropertyUtilsTests method testNonSecret.
@Test
void testNonSecret() {
String property = "spring.cloud.datasource";
SecretVersionName secretIdentifier = SecretManagerPropertyUtils.getSecretVersionName(property, DEFAULT_PROJECT_ID_PROVIDER);
assertThat(secretIdentifier).isNull();
}
use of com.google.cloud.secretmanager.v1.SecretVersionName in project spring-cloud-gcp by GoogleCloudPlatform.
the class SecretManagerPropertyUtilsTests method testShortProperty_secretId.
@Test
void testShortProperty_secretId() {
String property = "sm://the-secret";
SecretVersionName secretIdentifier = SecretManagerPropertyUtils.getSecretVersionName(property, DEFAULT_PROJECT_ID_PROVIDER);
assertThat(secretIdentifier.getProject()).isEqualTo("defaultProject");
assertThat(secretIdentifier.getSecret()).isEqualTo("the-secret");
assertThat(secretIdentifier.getSecretVersion()).isEqualTo("latest");
}
use of com.google.cloud.secretmanager.v1.SecretVersionName in project spring-cloud-gcp by GoogleCloudPlatform.
the class SecretManagerTemplateTests method verifyDisableSecretVersionRequest.
private void verifyDisableSecretVersionRequest(String secretId, String version, String projectId) {
SecretVersionName secretVersionName = SecretVersionName.newBuilder().setProject(projectId).setSecret(secretId).setSecretVersion(version).build();
verify(this.client).disableSecretVersion(secretVersionName);
}
use of com.google.cloud.secretmanager.v1.SecretVersionName in project spring-cloud-gcp by GoogleCloudPlatform.
the class SecretManagerTemplateTests method verifyEnableSecretVersionRequest.
private void verifyEnableSecretVersionRequest(String secretId, String version, String projectId) {
SecretVersionName secretVersionName = SecretVersionName.newBuilder().setProject(projectId).setSecret(secretId).setSecretVersion(version).build();
verify(this.client).enableSecretVersion(secretVersionName);
}
Aggregations