Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Schema
Commits
e984a75f
Commit
e984a75f
authored
Oct 14, 2020
by
Aman Verma
Committed by
Kishore Battula
Oct 14, 2020
Browse files
updating key names to make code work against opendes tenant
parent
19553a15
Changes
5
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
e984a75f
...
...
@@ -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
...
...
devops/azure/chart/templates/deployment.yaml
View file @
e984a75f
...
...
@@ -65,46 +65,33 @@ spec:
key
:
ENV_KEYVAULT
-
name
:
AZURE_TENANT_ID
valueFrom
:
configMap
KeyRef
:
name
:
osdu-svc-properties
key
:
ENV_TENANT_ID
secret
KeyRef
:
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
:
clientpassw
or
d
key
:
clientpassword
name
:
active-direct
or
y
key
:
principal-
clientpassword
-
name
:
aad_client_id
valueFrom
:
secretKeyRef
:
name
:
a
ppid
key
:
appid
name
:
a
ctive-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
...
...
provider/schema-azure/src/main/java/org/opengroup/osdu/schema/azure/di/AzureBootstrapConfig.java
View file @
e984a75f
...
...
@@ -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
)
{
...
...
provider/schema-azure/src/main/resources/application.properties
View file @
e984a75f
...
...
@@ -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
...
...
provider/schema-azure/src/test/java/org/opengroup/osdu/schema/provider/azure/di/AzureBootstrapConfigTest.java
View file @
e984a75f
...
...
@@ -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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment