Commit 5478473c authored by Kishore Battula's avatar Kishore Battula
Browse files

Merge branch 'users/amaverma/testDPhanges' into 'master'

updating key names to make code work against opendes tenant

See merge request !33
parents 19553a15 e984a75f
Pipeline #12010 passed with stages
in 36 minutes and 3 seconds
......@@ -16,6 +16,9 @@ variables:
AZURE_BUILD_SUBDIR: provider/schema-azure
AZURE_TEST_SUBDIR: testing/schema-test-core
AZURE_SKIP_TEST: 'true'
AZURE_DEPLOYMENTS_SUBDIR: deployments/scripts/azure
AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=https;AccountName=${AZURE_BASE}data;AccountKey=${AZURE_STORAGE_KEY};EndpointSuffix=core.windows.net
AWS_BUILD_SUBDIR: provider/schema-aws/build-aws
AWS_TEST_SUBDIR: testing/schema-test-core
......
......@@ -65,46 +65,33 @@ spec:
key: ENV_KEYVAULT
- name: AZURE_TENANT_ID
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_TENANT_ID
secretKeyRef:
name: active-directory
key: tenantid
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: clientid
key: clientid
name: active-directory
key: principal-clientid
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: clientpassword
key: clientpassword
name: active-directory
key: principal-clientpassword
- name: aad_client_id
valueFrom:
secretKeyRef:
name: appid
key: appid
name: active-directory
key: application-appid
- name: appinsights_key
valueFrom:
secretKeyRef:
name: appinsights
name: central-logging
key: appinsights
- name: cosmosdb_account
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_COSMOSDB_HOST
- name: cosmosdb_key
valueFrom:
secretKeyRef:
name: cosmos
key: cosmos
- name: cosmosdb_database
value: osdu-db
- name: storage_account
valueFrom:
configMapKeyRef:
name: osdu-svc-properties
key: ENV_STORAGE_ACCOUNT
value: osdumvpdp1glabky7vdata
- name: entitlements_service_endpoint
value: http://entitlements-azure/entitlements/v1
- name: entitlements_service_api_key
......
......@@ -64,13 +64,13 @@ public class AzureBootstrapConfig {
@Bean
@Named("COSMOS_ENDPOINT")
public String cosmosEndpoint(SecretClient kv) {
return getKeyVaultSecret(kv, "cosmos-endpoint");
return getKeyVaultSecret(kv, "opendes-cosmos-endpoint");
}
@Bean
@Named("COSMOS_KEY")
public String cosmosKey(SecretClient kv) {
return getKeyVaultSecret(kv, "cosmos-primary-key");
return getKeyVaultSecret(kv, "opendes-cosmos-primary-key");
}
public String getKeyVaultSecret(SecretClient kv, String secretName) {
......
......@@ -24,8 +24,6 @@ azure.activedirectory.AppIdUri=api://${azure.activedirectory.client-id}
azure.activedirectory.session-stateless=true
# Azure CosmosDB configuration
azure.cosmosdb.uri=${cosmosdb_account}
azure.cosmosdb.key=${cosmosdb_key}
azure.cosmosdb.database=${cosmosdb_database}
# Azure Blob Storage configuration
......
......@@ -50,7 +50,7 @@ public class AzureBootstrapConfigTest {
// Test the the cosmosKey is returned correctly.
KeyVaultSecret secret = Mockito.mock(KeyVaultSecret.class);
doReturn("cosmos-key-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-primary-key");
doReturn(secret).when(kv).getSecret("opendes-cosmos-primary-key");
String secretValue = bootstrapConfig.cosmosKey(kv);
assertEquals("Secret value was incorrect", "cosmos-key-secret", secretValue);
......@@ -60,7 +60,7 @@ public class AzureBootstrapConfigTest {
public void config_returnsCorrectSecret_cosmosEndpoint() {
KeyVaultSecret secret = Mockito.mock(KeyVaultSecret.class);
doReturn("cosmos-endpoint-secret").when(secret).getValue();
doReturn(secret).when(kv).getSecret("cosmos-endpoint");
doReturn(secret).when(kv).getSecret("opendes-cosmos-endpoint");
String secretValue = bootstrapConfig.cosmosEndpoint(kv);
assertEquals("Secret value was incorrect", "cosmos-endpoint-secret", secretValue);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment