diff --git a/pom.xml b/pom.xml index 9aa22d7031049109cad6fa8364d6c125207b2a6c..97e25e89e466f5e7e20bce4667ad9e4731044cb4 100644 --- a/pom.xml +++ b/pom.xml @@ -110,7 +110,7 @@ <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> - <version>1.26</version> + <version>1.31</version> </dependency> <!-- swagger dependency --> <!-- <dependency> diff --git a/provider/register-azure/pom.xml b/provider/register-azure/pom.xml index cb0345039e89c8cb8747fef356bb7e5e9dc1253c..a016e3774a2d017ede9123af39c872c3c9f6f9be 100644 --- a/provider/register-azure/pom.xml +++ b/provider/register-azure/pom.xml @@ -29,14 +29,14 @@ <packaging>jar</packaging> <version>0.18.0-SNAPSHOT</version> <properties> - <osdu.corelibazure.version>0.15.2</osdu.corelibazure.version> + <osdu.corelibazure.version>0.18.0-rc3</osdu.corelibazure.version> <osdu.oscorecommon.version>0.15.0</osdu.oscorecommon.version> <junit-jupiter.version>5.6.0</junit-jupiter.version> <mockito-junit-jupiter.version>2.23.0</mockito-junit-jupiter.version> <oauth2-oidc-sdk.version>6.5</oauth2-oidc-sdk.version> - <woodstox-core.version>5.3.0</woodstox-core.version> + <woodstox-core.version>6.4.0</woodstox-core.version> <hibernate-validator.version>5.3.6.Final</hibernate-validator.version> - <jackson-databind.version>2.13.2.2</jackson-databind.version> + <jackson-databind.version>2.13.4</jackson-databind.version> <jackson.version>2.13.2</jackson.version> <spring-webmvc.version>5.3.22</spring-webmvc.version> </properties> diff --git a/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureBootstrapConfig.java b/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureBootstrapConfig.java index 54995cb8039b029a9de9c42495d53980ca4097c7..435c46868a28c971e4d8afacee510144bc4b634f 100644 --- a/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureBootstrapConfig.java +++ b/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureBootstrapConfig.java @@ -36,7 +36,6 @@ public class AzureBootstrapConfig { @Value("${azure.appResourceId}") private String azureAppResourceId; - private String azureTenantId; @Bean @Named("KEY_VAULT_URL") @@ -50,8 +49,4 @@ public class AzureBootstrapConfig { return cosmosDBName; } - @Inject - public void setAzureTenantId(@Named("APP_DEV_SP_TENANT_ID") String azureTenantId) { - this.azureTenantId = azureTenantId; - } -} \ No newline at end of file +} diff --git a/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureTenantIdConfig.java b/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureTenantIdConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..2d5a72ad27631ac11e3aca7058615dbc8daaf7a1 --- /dev/null +++ b/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/di/AzureTenantIdConfig.java @@ -0,0 +1,20 @@ +package org.opengroup.osdu.register.provider.azure.di; + +import lombok.Getter; +import org.springframework.stereotype.Component; + +import javax.inject.Inject; +import javax.inject.Named; + +@Getter +@Component +public class AzureTenantIdConfig { + + private String azureTenantId; + + @Inject + public void setAzureTenantId(@Named("APP_DEV_SP_TENANT_ID") String azureTenantId) { + System.out.println(azureTenantId); + this.azureTenantId = azureTenantId; + } +} diff --git a/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/subscriber/pubsub/PushSubscription.java b/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/subscriber/pubsub/PushSubscription.java index 28aa71ea0628147cc77927b6481724c8de714290..34050c707200b9b78bc659f88eeac7fa25984835 100644 --- a/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/subscriber/pubsub/PushSubscription.java +++ b/provider/register-azure/src/main/java/org/opengroup/osdu/register/provider/azure/subscriber/pubsub/PushSubscription.java @@ -21,6 +21,7 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.register.provider.azure.di.AzureBootstrapConfig; +import org.opengroup.osdu.register.provider.azure.di.AzureTenantIdConfig; import org.opengroup.osdu.register.provider.azure.util.PartitionHelperEventGrid; import org.opengroup.osdu.register.utils.AppServiceConfig; import org.springframework.beans.factory.annotation.Autowired; @@ -46,6 +47,8 @@ public class PushSubscription implements IPubsubSubscription { @Autowired private JaxRsDpsLog logger; @Autowired + private AzureTenantIdConfig azureTenantIdConfig; + @Autowired private AppServiceConfig serviceConfig; @Autowired private PartitionHelperEventGrid partitionHelper; @@ -54,7 +57,7 @@ public class PushSubscription implements IPubsubSubscription { String topicName = partitionHelper.getFullyQualifiedTopicName(topicAliasName); WebHookEventSubscriptionDestination subscriptionDestination = new WebHookEventSubscriptionDestination(); subscriptionDestination.withEndpointUrl(serviceConfig.getRecordsChangePubsubEndpoint()); - subscriptionDestination.withAzureActiveDirectoryTenantId(azureBootstrapConfig.getAzureTenantId()); + subscriptionDestination.withAzureActiveDirectoryTenantId(azureTenantIdConfig.getAzureTenantId()); subscriptionDestination.withAzureActiveDirectoryApplicationIdOrUri(azureBootstrapConfig.getAzureAppResourceId()); String scope = partitionHelper.retrieveScope((topicName)); diff --git a/provider/register-azure/src/test/java/org/opengroup/osdu/register/provider/azure/subscriber/PushSubscriptionTest.java b/provider/register-azure/src/test/java/org/opengroup/osdu/register/provider/azure/subscriber/PushSubscriptionTest.java index 51872bf30e7ec8867aa412693c2011b2d1b3a5e2..82559b28712fa9cb87bb559e5d2dc1e086fcb7c2 100644 --- a/provider/register-azure/src/test/java/org/opengroup/osdu/register/provider/azure/subscriber/PushSubscriptionTest.java +++ b/provider/register-azure/src/test/java/org/opengroup/osdu/register/provider/azure/subscriber/PushSubscriptionTest.java @@ -33,6 +33,7 @@ import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.model.http.AppException; import org.opengroup.osdu.core.common.model.http.DpsHeaders; import org.opengroup.osdu.register.provider.azure.di.AzureBootstrapConfig; +import org.opengroup.osdu.register.provider.azure.di.AzureTenantIdConfig; import org.opengroup.osdu.register.provider.azure.subscriber.pubsub.PushSubscription; import org.opengroup.osdu.register.provider.azure.util.PartitionHelperEventGrid; import org.opengroup.osdu.register.utils.AppServiceConfig; @@ -78,6 +79,9 @@ public class PushSubscriptionTest { @Mock private AzureBootstrapConfig azureBootstrapConfig; + @Mock + private AzureTenantIdConfig azureTenantIdConfig; + @Mock private JaxRsDpsLog logger; @@ -111,7 +115,7 @@ public class PushSubscriptionTest { String format = String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.EventGrid/topics/%s", subscriptionId, resourceGroupName, topicName); lenient().when(partitionHelper.retrieveScope(topicName)).thenReturn(format); - lenient().when(azureBootstrapConfig.getAzureTenantId()).thenReturn(tenantId); + lenient().when(azureTenantIdConfig.getAzureTenantId()).thenReturn(tenantId); lenient().when(azureBootstrapConfig.getAzureAppResourceId()).thenReturn(appResourceId); lenient().when(serviceConfig.getRecordsChangePubsubEndpoint()).thenReturn(pushEndpoint); lenient().when(headers.getPartitionId()).thenReturn(PARTITION_ID); diff --git a/register-core/pom.xml b/register-core/pom.xml index 35530169b564d0121bd6874994072a0403705d7a..7d8f0633b8a9e9cea26adc50a8f1427c7822a983 100644 --- a/register-core/pom.xml +++ b/register-core/pom.xml @@ -33,7 +33,7 @@ <properties> <netty.version>4.1.70.Final</netty.version> <spring-security-web.version>5.7.2</spring-security-web.version> - <jackson-databind.version>2.13.2.2</jackson-databind.version> + <jackson-databind.version>2.13.4</jackson-databind.version> <jackson.version>2.13.2</jackson.version> </properties>