io.quarkus
quarkus-rest-client-jackson
@@ -150,6 +154,7 @@
build
generate-code
generate-code-tests
+ native-image-agent
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClient.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityClient.java
similarity index 78%
rename from src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClient.java
rename to src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityClient.java
index 35ae68e..c5f8888 100644
--- a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClient.java
+++ b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityClient.java
@@ -1,5 +1,5 @@
/*
- * AzureIdentityReactiveClient.java
+ * AzureIdentityClient.java
*
* 17 mag 2024
*/
@@ -10,12 +10,12 @@
/**
*
- * Reactive REST client to get access token from Microsoft Entra ID.
+ * Reactive client to get access token from Microsoft Entra ID.
*
*
* @author Antonio Tarricone
*/
-public interface AzureIdentityReactiveClient {
+public interface AzureIdentityClient {
/**
*
* Retrieves an access token for an Azure resource.
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClientFactory.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClientFactory.java
deleted file mode 100644
index 56e7969..0000000
--- a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClientFactory.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * AzureIdentityReactiveClientFactory.java
- *
- * 4 ago 2024
- */
-package it.pagopa.swclient.mil.azureservices.identity.client;
-
-import java.net.URI;
-import java.util.Optional;
-
-import org.eclipse.microprofile.config.inject.ConfigProperty;
-
-import io.quarkus.logging.Log;
-import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
-import jakarta.enterprise.inject.Produces;
-import jakarta.enterprise.inject.spi.DeploymentException;
-import jakarta.inject.Inject;
-import jakarta.ws.rs.ext.Provider;
-
-/**
- *
- * Initializes the right Azure Identity REST client depending on environment variables found.
- *
- *
- *
- * If environment variables IDENTITY_ENDPOINT
and IDENTITY_HEADER
are set,
- * System Assigned Managed Identity will be used.
- *
- *
- *
- * If environment variables AZURE_FEDERATED_TOKEN_FILE
, AZURE_TENANT_ID
,
- * AZURE_CLIENT_ID
and AZURE_AUTHORITY_HOST
are set, Workload
- * Identity will be used.
- *
- *
- * @author Antonio Tarricone
- */
-@Provider
-public class AzureIdentityReactiveClientFactory {
- /**
- *
- * Endpoint to get access token by means of system managed identity.
- *
- */
- private Optional identityEndpoint;
-
- /**
- *
- * Value to use to set x-identity-header.
- *
- */
- private Optional identityHeader;
-
- /**
- *
- * Endpoint to get access token by means of workload identity.
- *
- */
- private Optional authorityHost;
-
- /**
- *
- * Tenant ID.
- *
- */
- private Optional tenantId;
-
- /**
- *
- * Client ID.
- *
- */
- private Optional clientId;
-
- /**
- *
- * Token file with client assertion.
- *
- */
- private Optional federatedTokenFile;
-
- /**
- *
- * Constructor.
- *
- *
- * @param identityEndpoint Endpoint to get access token by means of system managed identity
- * @param identityHeader Value to use to set x-identity-header
- * @param authorityHost Endpoint to get access token by means of workload identity
- * @param tenantId Tenant ID
- * @param clientId Client ID
- * @param federatedTokenFile Token file with client assertion
- */
- @Inject
- AzureIdentityReactiveClientFactory(
- @ConfigProperty(name = "IDENTITY_ENDPOINT") Optional identityEndpoint,
- @ConfigProperty(name = "IDENTITY_HEADER") Optional identityHeader,
- @ConfigProperty(name = "AZURE_AUTHORITY_HOST") Optional authorityHost,
- @ConfigProperty(name = "AZURE_TENANT_ID") Optional tenantId,
- @ConfigProperty(name = "AZURE_CLIENT_ID") Optional clientId,
- @ConfigProperty(name = "AZURE_FEDERATED_TOKEN_FILE") Optional federatedTokenFile) {
- this.identityEndpoint = identityEndpoint;
- this.identityHeader = identityHeader;
- this.authorityHost = authorityHost;
- this.tenantId = tenantId;
- this.clientId = clientId;
- this.federatedTokenFile = federatedTokenFile;
- }
-
- /**
- *
- * Initializes the right Azure Identity REST client depending on environment variables found.
- *
- *
- * @return {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClient
- * AzureIdentityReactiveClient}
- */
- @Produces
- AzureIdentityReactiveClient get() {
- Log.trace("Azure Identity REST Client factory invoked!");
-
- if (identityEndpoint.isPresent() && identityHeader.isPresent()) {
- Log.debug("Azure System Managed Identity will be use");
- return QuarkusRestClientBuilder.newBuilder()
- .baseUri(URI.create(identityEndpoint.get()))
- .build(AzureSystemManagedIdentityReactiveClient.class);
- } else if (authorityHost.isPresent() && tenantId.isPresent() && clientId.isPresent() && federatedTokenFile.isPresent()) {
- Log.debug("Azure Workload Identity will be use");
- return QuarkusRestClientBuilder.newBuilder()
- .baseUri(URI.create(authorityHost.get() + tenantId.get()))
- .build(AzureWorkloadIdentityReactiveClient.class);
- } else {
- Log.fatal("IDENTITY_ENDPOINT and IDENTITY_HEADER must not be null or AZURE_AUTHORITY_HOST and AZURE_TENANT_ID and AZURE_CLIENT_ID and AZURE_FEDERATED_TOKEN_FILE must not be null");
- throw new DeploymentException("IDENTITY_ENDPOINT and IDENTITY_HEADER must not be null or AZURE_AUTHORITY_HOST and AZURE_TENANT_ID and AZURE_CLIENT_ID and AZURE_FEDERATED_TOKEN_FILE must not be null");
- }
- }
-}
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityClient.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityClient.java
new file mode 100644
index 0000000..567038c
--- /dev/null
+++ b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityClient.java
@@ -0,0 +1,62 @@
+/*
+ * AzureSystemManagedIdentityClient.java
+ *
+ * 7 ago 2024
+ */
+package it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged;
+
+import java.net.URI;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import io.quarkus.logging.Log;
+import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
+import io.smallrye.mutiny.Uni;
+import it.pagopa.swclient.mil.azureservices.identity.bean.AccessToken;
+import it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityClient;
+import jakarta.enterprise.context.ApplicationScoped;
+
+/**
+ *
+ * Reactive client (it's a proxy of REST client) to get access token from Microsoft Entra ID by
+ * means of System Managed Identity.
+ *
+ *
+ * @author Antonio Tarricone
+ */
+@ApplicationScoped
+public class AzureSystemManagedIdentityClient implements AzureIdentityClient {
+ /**
+ *
+ * Reactive REST client to get access token from Microsoft Entra ID by means of System Managed
+ * Identity.
+ *
+ *
+ * @see it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged.AzureSystemManagedIdentityRestClient
+ * AzureSystemManagedIdentityRestClient
+ */
+ private AzureSystemManagedIdentityRestClient restClient;
+
+ /**
+ *
+ * Constructor.
+ *
+ *
+ * @param identityEndpoint Endpoint to get access token by means of system managed identity
+ */
+ AzureSystemManagedIdentityClient(@ConfigProperty(name = "IDENTITY_ENDPOINT", defaultValue = "") String identityEndpoint) {
+ Log.trace("Azure System Managed Identity client initialization");
+ restClient = QuarkusRestClientBuilder.newBuilder()
+ .baseUri(URI.create(identityEndpoint))
+ .build(AzureSystemManagedIdentityRestClient.class);
+ }
+
+ /**
+ * @see it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged.AzureSystemManagedIdentityRestClient#getAccessToken(String)
+ */
+ @Override
+ public Uni getAccessToken(String scope) {
+ Log.tracef("Get access token with System Managed Identity for %s", scope);
+ return restClient.getAccessToken(scope);
+ }
+}
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureSystemManagedIdentityReactiveClient.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityRestClient.java
similarity index 82%
rename from src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureSystemManagedIdentityReactiveClient.java
rename to src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityRestClient.java
index 015bd7b..1a32def 100644
--- a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureSystemManagedIdentityReactiveClient.java
+++ b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityRestClient.java
@@ -1,9 +1,9 @@
/*
- * AzureIdentityReactiveClient.java
+ * AzureSystemManagedIdentityRestClient.java
*
* 17 mag 2024
*/
-package it.pagopa.swclient.mil.azureservices.identity.client;
+package it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged;
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
@@ -17,12 +17,13 @@
/**
*
- * Reactive REST client to get access token from Microsoft Entra ID.
+ * Reactive REST client to get access token from Microsoft Entra ID by means of System Managed
+ * Identity.
*
*
* @author Antonio Tarricone
*/
-public interface AzureSystemManagedIdentityReactiveClient extends AzureIdentityReactiveClient {
+public interface AzureSystemManagedIdentityRestClient {
/**
*
* Retrieves an access token for an Azure resource.
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityClient.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityClient.java
new file mode 100644
index 0000000..a8712cf
--- /dev/null
+++ b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityClient.java
@@ -0,0 +1,64 @@
+/*
+ * AzureWorkloadIdentityClient.java
+ *
+ * 7 ago 2024
+ */
+package it.pagopa.swclient.mil.azureservices.identity.client.workload;
+
+import java.net.URI;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+import io.quarkus.logging.Log;
+import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
+import io.smallrye.mutiny.Uni;
+import it.pagopa.swclient.mil.azureservices.identity.bean.AccessToken;
+import it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityClient;
+import jakarta.enterprise.context.ApplicationScoped;
+
+/**
+ *
+ * Reactive client (it's a proxy of REST client) to get access token from Microsoft Entra ID by
+ * means of Workload Identity.
+ *
+ *
+ * @author Antonio Tarricone
+ */
+@ApplicationScoped
+public class AzureWorkloadIdentityClient implements AzureIdentityClient {
+ /**
+ *
+ * Reactive REST client to get access token from Microsoft Entra ID by means of Workload Identity.
+ *
+ *
+ * @see it.pagopa.swclient.mil.azureservices.identity.client.workload.AzureWorkloadIdentityRestClient
+ * AzureWorkloadIdentityRestClient
+ */
+ private AzureWorkloadIdentityRestClient restClient;
+
+ /**
+ *
+ * Constructor.
+ *
+ *
+ * @param authorityHost Endpoint to get access token by means of workload identity
+ * @param tenantId Tenant ID
+ */
+ AzureWorkloadIdentityClient(
+ @ConfigProperty(name = "AZURE_AUTHORITY_HOST", defaultValue = "") String authorityHost,
+ @ConfigProperty(name = "AZURE_TENANT_ID", defaultValue = "") String tenantId) {
+ Log.trace("Azure Workload Identity client initialization");
+ restClient = QuarkusRestClientBuilder.newBuilder()
+ .baseUri(URI.create(authorityHost + tenantId))
+ .build(AzureWorkloadIdentityRestClient.class);
+ }
+
+ /**
+ * @see it.pagopa.swclient.mil.azureservices.identity.client.workload.AzureWorkloadIdentityRestClient#getAccessToken(String)
+ */
+ @Override
+ public Uni getAccessToken(String scope) {
+ Log.tracef("Get access token with Workload Identity for %s", scope);
+ return restClient.getAccessToken(scope);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureWorkloadIdentityReactiveClient.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityRestClient.java
similarity index 91%
rename from src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureWorkloadIdentityReactiveClient.java
rename to src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityRestClient.java
index aed9fc3..7a980c3 100644
--- a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureWorkloadIdentityReactiveClient.java
+++ b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityRestClient.java
@@ -1,9 +1,9 @@
/*
- * AzureWorkloadIdentityReactiveClient.java
+ * AzureWorkloadIdentityRestClient.java
*
* 3 ago 2024
*/
-package it.pagopa.swclient.mil.azureservices.identity.client;
+package it.pagopa.swclient.mil.azureservices.identity.client.workload;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -32,7 +32,7 @@
* @author Antonio Tarricone
*/
@Path("/oauth2/v2.0/token")
-public interface AzureWorkloadIdentityReactiveClient extends AzureIdentityReactiveClient {
+public interface AzureWorkloadIdentityRestClient {
/**
*
* Retrieves an access token for an Azure resource.
diff --git a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveService.java b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveService.java
index 8df6952..3fe15ff 100644
--- a/src/main/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveService.java
+++ b/src/main/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveService.java
@@ -8,12 +8,20 @@
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.quarkus.logging.Log;
import io.smallrye.mutiny.Uni;
import it.pagopa.swclient.mil.azureservices.identity.bean.AccessToken;
-import it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClient;
+import it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityClient;
+import it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged.AzureSystemManagedIdentityClient;
+import it.pagopa.swclient.mil.azureservices.identity.client.workload.AzureWorkloadIdentityClient;
import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Instance;
+import jakarta.enterprise.inject.spi.DeploymentException;
import jakarta.inject.Inject;
/**
@@ -28,10 +36,10 @@
public class AzureIdentityReactiveService {
/**
*
- * Reactive rest client to retrieve an access token from Microsoft Entra ID.
+ * Reactive client to retrieve an access token from Microsoft Entra ID.
*
*/
- AzureIdentityReactiveClient identityClient;
+ private AzureIdentityClient identityClient;
/**
*
@@ -46,20 +54,41 @@ public class AzureIdentityReactiveService {
* Constructor.
*
*
- * @param identityClient {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClient
- * AzureIdentityReactiveClient}.
+ * @param identityEndpoint Endpoint to get access token by means of system managed identity
+ * @param identityHeader Value to use to set x-identity-header
+ * @param authorityHost Endpoint to get access token by means of workload identity
+ * @param tenantId Tenant ID
+ * @param clientId Client ID
+ * @param federatedTokenFile Token file with client assertion
+ * @param anyIdentityClient Any identity client
*/
@Inject
- AzureIdentityReactiveService(AzureIdentityReactiveClient identityClient) {
+ AzureIdentityReactiveService(
+ @ConfigProperty(name = "IDENTITY_ENDPOINT") Optional identityEndpoint,
+ @ConfigProperty(name = "IDENTITY_HEADER") Optional identityHeader,
+ @ConfigProperty(name = "AZURE_AUTHORITY_HOST") Optional authorityHost,
+ @ConfigProperty(name = "AZURE_TENANT_ID") Optional tenantId,
+ @ConfigProperty(name = "AZURE_CLIENT_ID") Optional clientId,
+ @ConfigProperty(name = "AZURE_FEDERATED_TOKEN_FILE") Optional federatedTokenFile,
+ @Any Instance anyIdentityClient) {
/*
- * Initialize access token cache.
+ * Initialize identity client.
*/
- cache = new HashMap<>();
+ if (identityEndpoint.isPresent() && identityHeader.isPresent()) {
+ Log.debug("Azure System Managed Identity will be use");
+ identityClient = anyIdentityClient.select(AzureSystemManagedIdentityClient.class).get();
+ } else if (authorityHost.isPresent() && tenantId.isPresent() && clientId.isPresent() && federatedTokenFile.isPresent()) {
+ Log.debug("Azure Workload Identity will be use");
+ identityClient = anyIdentityClient.select(AzureWorkloadIdentityClient.class).get();
+ } else {
+ Log.fatal("IDENTITY_ENDPOINT and IDENTITY_HEADER must not be null or AZURE_AUTHORITY_HOST and AZURE_TENANT_ID and AZURE_CLIENT_ID and AZURE_FEDERATED_TOKEN_FILE must not be null");
+ throw new DeploymentException("IDENTITY_ENDPOINT and IDENTITY_HEADER must not be null or AZURE_AUTHORITY_HOST and AZURE_TENANT_ID and AZURE_CLIENT_ID and AZURE_FEDERATED_TOKEN_FILE must not be null");
+ }
/*
- * Initialize of the REST client.
+ * Initialize access token cache.
*/
- this.identityClient = identityClient;
+ cache = new HashMap<>();
}
/**
@@ -106,4 +135,16 @@ public Uni getAccessToken(String scope) {
public void clearAccessTokenCache() {
cache.clear();
}
+
+ /**
+ *
+ * Returns identity client in use.
+ *
+ *
+ * @return {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityClient
+ * AzureIdentityClient}
+ */
+ public AzureIdentityClient getIdentityClient() {
+ return identityClient;
+ }
}
\ No newline at end of file
diff --git a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClientFactoryTest.java b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClientFactoryTest.java
deleted file mode 100644
index e400fad..0000000
--- a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureIdentityReactiveClientFactoryTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * AzureIdentityReactiveClientFactoryTest.java
- *
- * 5 ago 2024
- */
-package it.pagopa.swclient.mil.azureservices.identity.client;
-
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.util.Optional;
-
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.TestInfo;
-
-import io.quarkus.test.junit.QuarkusTest;
-import jakarta.enterprise.inject.spi.DeploymentException;
-
-/**
- *
- * @author Antonio Tarricone
- */
-@QuarkusTest
-class AzureIdentityReactiveClientFactoryTest {
- /**
- *
- * @param testInfo
- */
- @BeforeEach
- void init(TestInfo testInfo) {
- String frame = "*".repeat(testInfo.getDisplayName().length() + 11);
- System.out.println(frame);
- System.out.printf("* %s: START *%n", testInfo.getDisplayName());
- System.out.println(frame);
- }
-
- /**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClientFactory#get()}.
- */
- @Test
- void given_systemManagedIdEnvironment_when_invokeGet_then_returnSuitableClient() {
- AzureIdentityReactiveClientFactory factory = new AzureIdentityReactiveClientFactory(
- Optional.of("https://login.microsoftonline.com/"),
- Optional.of("45ed57a0-ec26-41c9-8333-29daf37697d3"),
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Optional.empty());
-
- assertTrue(factory.get() instanceof AzureSystemManagedIdentityReactiveClient);
- }
-
- /**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClientFactory#get()}.
- */
- @Test
- void given_partialsystemManagedIdEnvironment_when_invokeGet_then_throwException() {
- AzureIdentityReactiveClientFactory factory = new AzureIdentityReactiveClientFactory(
- Optional.of("https://login.microsoftonline.com/"),
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Optional.empty());
-
- assertThrows(
- DeploymentException.class,
- () -> factory.get());
- }
-
- /**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClientFactory#get()}.
- */
- @Test
- void given_workloadIdEnvironment_when_invokeGet_then_returnSuitableClient() {
- AzureIdentityReactiveClientFactory factory = new AzureIdentityReactiveClientFactory(
- Optional.empty(),
- Optional.empty(),
- Optional.of("https://login.microsoftonline.com/"),
- Optional.of("da795842-fa15-4fd4-b556-f371ac9bafed"),
- Optional.of("aeeb30a1-2d89-42bd-832c-69dc15a53d36"),
- Optional.of("/var/run/secrets/azure/tokens/azure-identity-token"));
-
- assertTrue(factory.get() instanceof AzureWorkloadIdentityReactiveClient);
- }
-
- /**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClientFactory#get()}.
- */
- @Test
- void given_partialWorkloadIdEnvironment_when_invokeGet_then_throwException() {
- AzureIdentityReactiveClientFactory factory = new AzureIdentityReactiveClientFactory(
- Optional.empty(),
- Optional.empty(),
- Optional.of("https://login.microsoftonline.com/"),
- Optional.empty(),
- Optional.empty(),
- Optional.empty());
-
- assertThrows(
- DeploymentException.class,
- () -> factory.get());
- }
-
- /**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClientFactory#get()}.
- */
- @Test
- void given_noIdentityEnvironment_when_invokeGet_then_throwException() {
- AzureIdentityReactiveClientFactory factory = new AzureIdentityReactiveClientFactory(
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Optional.empty(),
- Optional.empty());
-
- assertThrows(
- DeploymentException.class,
- () -> factory.get());
- }
-}
diff --git a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityClientTest.java b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityClientTest.java
new file mode 100644
index 0000000..25d10e8
--- /dev/null
+++ b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/systemmanaged/AzureSystemManagedIdentityClientTest.java
@@ -0,0 +1,94 @@
+/*
+ * AzureSystemManagedIdentityClientTest.java
+ *
+ * 7 ago 2024
+ */
+package it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.mockStatic;
+import static org.mockito.Mockito.when;
+
+import java.net.URI;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+import org.mockito.MockedStatic;
+
+import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
+import io.quarkus.test.junit.QuarkusTest;
+import io.smallrye.mutiny.Uni;
+import io.smallrye.mutiny.helpers.test.UniAssertSubscriber;
+import it.pagopa.swclient.mil.azureservices.identity.bean.AccessToken;
+import it.pagopa.swclient.mil.azureservices.identity.bean.Scope;
+
+/**
+ *
+ * @author Antonio.tarricone
+ */
+@QuarkusTest
+class AzureSystemManagedIdentityClientTest {
+ /**
+ *
+ * @param testInfo
+ */
+ @BeforeEach
+ void init(TestInfo testInfo) {
+ String frame = "*".repeat(testInfo.getDisplayName().length() + 11);
+ System.out.println(frame);
+ System.out.printf("* %s: START *%n", testInfo.getDisplayName());
+ System.out.println(frame);
+ }
+
+ /**
+ *
+ */
+ @Test
+ void given_requestToGetAccessToken_when_requestIsDone_then_returnAccessToken() {
+ /*
+ * Mocking of REST client.
+ */
+ Instant now = Instant.now();
+ AccessToken accessToken = new AccessToken()
+ .setExpiresOn(now.plus(5, ChronoUnit.MINUTES).getEpochSecond())
+ .setValue("access_token_string");
+
+ AzureSystemManagedIdentityRestClient restClient = mock(AzureSystemManagedIdentityRestClient.class);
+ when(restClient.getAccessToken(Scope.STORAGE))
+ .thenReturn(Uni.createFrom()
+ .item(accessToken));
+
+ /*
+ * Mocking of QuarkusRestClientBuilder.
+ */
+ QuarkusRestClientBuilder clientBuilder = mock(QuarkusRestClientBuilder.class);
+
+ when(clientBuilder.build(AzureSystemManagedIdentityRestClient.class))
+ .thenReturn(restClient);
+
+ when(clientBuilder.baseUri(any(URI.class)))
+ .thenReturn(clientBuilder);
+
+ /*
+ * Mocking of QuarkusRestClientBuilder factory.
+ */
+ try (MockedStatic restClientBuilderFactory = mockStatic(QuarkusRestClientBuilder.class)) {
+ restClientBuilderFactory.when(() -> QuarkusRestClientBuilder.newBuilder())
+ .thenReturn(clientBuilder);
+
+ /*
+ * Test.
+ */
+ AzureSystemManagedIdentityClient client = new AzureSystemManagedIdentityClient("https://login.microsoftonline.com/");
+ client.getAccessToken(Scope.STORAGE)
+ .subscribe()
+ .withSubscriber(UniAssertSubscriber.create())
+ .awaitItem()
+ .assertItem(accessToken);
+ }
+ }
+}
diff --git a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityClientTest.java b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityClientTest.java
new file mode 100644
index 0000000..56dd1bd
--- /dev/null
+++ b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityClientTest.java
@@ -0,0 +1,96 @@
+/*
+ * AzureWorkloadIdentityClientTest.java
+ *
+ * 7 ago 2024
+ */
+package it.pagopa.swclient.mil.azureservices.identity.client.workload;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.mockStatic;
+import static org.mockito.Mockito.when;
+
+import java.net.URI;
+import java.time.Instant;
+import java.time.temporal.ChronoUnit;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+import org.mockito.MockedStatic;
+
+import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder;
+import io.quarkus.test.junit.QuarkusTest;
+import io.smallrye.mutiny.Uni;
+import io.smallrye.mutiny.helpers.test.UniAssertSubscriber;
+import it.pagopa.swclient.mil.azureservices.identity.bean.AccessToken;
+import it.pagopa.swclient.mil.azureservices.identity.bean.Scope;
+
+/**
+ *
+ * @author Antonio.tarricone
+ */
+@QuarkusTest
+class AzureWorkloadIdentityClientTest {
+ /**
+ *
+ * @param testInfo
+ */
+ @BeforeEach
+ void init(TestInfo testInfo) {
+ String frame = "*".repeat(testInfo.getDisplayName().length() + 11);
+ System.out.println(frame);
+ System.out.printf("* %s: START *%n", testInfo.getDisplayName());
+ System.out.println(frame);
+ }
+
+ /**
+ *
+ */
+ @Test
+ void given_requestToGetAccessToken_when_requestIsDone_then_returnAccessToken() {
+ /*
+ * Mocking of REST client.
+ */
+ Instant now = Instant.now();
+ AccessToken accessToken = new AccessToken()
+ .setExpiresOn(now.plus(5, ChronoUnit.MINUTES).getEpochSecond())
+ .setValue("access_token_string");
+
+ AzureWorkloadIdentityRestClient restClient = mock(AzureWorkloadIdentityRestClient.class);
+ when(restClient.getAccessToken(Scope.STORAGE))
+ .thenReturn(Uni.createFrom()
+ .item(accessToken));
+
+ /*
+ * Mocking of QuarkusRestClientBuilder.
+ */
+ QuarkusRestClientBuilder clientBuilder = mock(QuarkusRestClientBuilder.class);
+
+ when(clientBuilder.build(AzureWorkloadIdentityRestClient.class))
+ .thenReturn(restClient);
+
+ when(clientBuilder.baseUri(any(URI.class)))
+ .thenReturn(clientBuilder);
+
+ /*
+ * Mocking of QuarkusRestClientBuilder factory.
+ */
+ try (MockedStatic restClientBuilderFactory = mockStatic(QuarkusRestClientBuilder.class)) {
+ restClientBuilderFactory.when(() -> QuarkusRestClientBuilder.newBuilder())
+ .thenReturn(clientBuilder);
+
+ /*
+ * Test.
+ */
+ AzureWorkloadIdentityClient client = new AzureWorkloadIdentityClient(
+ "https://login.microsoftonline.com/",
+ "da795842-fa15-4fd4-b556-f371ac9bafed");
+ client.getAccessToken(Scope.STORAGE)
+ .subscribe()
+ .withSubscriber(UniAssertSubscriber.create())
+ .awaitItem()
+ .assertItem(accessToken);
+ }
+ }
+}
diff --git a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureWorkloadIdentityReactiveClientTest.java b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityRestClientTest.java
similarity index 69%
rename from src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureWorkloadIdentityReactiveClientTest.java
rename to src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityRestClientTest.java
index b0af8d5..26fb8e4 100644
--- a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/AzureWorkloadIdentityReactiveClientTest.java
+++ b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/client/workload/AzureWorkloadIdentityRestClientTest.java
@@ -1,9 +1,9 @@
/*
- * AzureWorkloadIdentityReactiveClientTest.java
+ * AzureWorkloadIdentityRestClientTest.java
*
- * 5 ago 2024
+ * 7 ago 2024
*/
-package it.pagopa.swclient.mil.azureservices.identity.client;
+package it.pagopa.swclient.mil.azureservices.identity.client.workload;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -26,10 +26,10 @@
/**
*
- * @author antonio.tarricone
+ * @author Antonio Tarricone
*/
@QuarkusTest
-class AzureWorkloadIdentityReactiveClientTest {
+class AzureWorkloadIdentityRestClientTest {
/**
*
* @param testInfo
@@ -43,14 +43,13 @@ void init(TestInfo testInfo) {
}
/**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureWorkloadIdentityReactiveClient#getClientAssertion(java.lang.String)}.
+ *
*/
@Test
void given_tokenFile_when_invokeGetClientAssertion_then_returnFileContent() {
- AzureWorkloadIdentityReactiveClient client = QuarkusRestClientBuilder.newBuilder()
+ AzureWorkloadIdentityRestClient client = QuarkusRestClientBuilder.newBuilder()
.baseUri(URI.create("https://login.microsoftonline.com/da795842-fa15-4fd4-b556-f371ac9bafed"))
- .build(AzureWorkloadIdentityReactiveClient.class);
+ .build(AzureWorkloadIdentityRestClient.class);
assertEquals(
"This is a test!",
@@ -58,8 +57,7 @@ void given_tokenFile_when_invokeGetClientAssertion_then_returnFileContent() {
}
/**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.client.AzureWorkloadIdentityReactiveClient#getClientAssertion(java.lang.String)}.
+ *
*/
@Test
void given_ioExceptionReadingTokenFile_when_invokeGetClientAssertion_then_throwException() {
@@ -72,9 +70,9 @@ void given_ioExceptionReadingTokenFile_when_invokeGetClientAssertion_then_throwE
String.class))))
.thenThrow(IOException.class);
- AzureWorkloadIdentityReactiveClient client = QuarkusRestClientBuilder.newBuilder()
+ AzureWorkloadIdentityRestClient client = QuarkusRestClientBuilder.newBuilder()
.baseUri(URI.create("https://login.microsoftonline.com/da795842-fa15-4fd4-b556-f371ac9bafed"))
- .build(AzureWorkloadIdentityReactiveClient.class);
+ .build(AzureWorkloadIdentityRestClient.class);
assertThrows(DeploymentException.class,
() -> client.getClientAssertion("client_assertion"));
diff --git a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveServiceTest.java b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveServiceTest.java
index a503c1e..bfb3372 100644
--- a/src/test/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveServiceTest.java
+++ b/src/test/java/it/pagopa/swclient/mil/azureservices/identity/service/AzureIdentityReactiveServiceTest.java
@@ -5,6 +5,8 @@
*/
package it.pagopa.swclient.mil.azureservices.identity.service;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
@@ -13,6 +15,7 @@
import java.time.Instant;
import java.time.temporal.ChronoUnit;
+import java.util.Optional;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -23,13 +26,18 @@
import io.smallrye.mutiny.helpers.test.UniAssertSubscriber;
import it.pagopa.swclient.mil.azureservices.identity.bean.AccessToken;
import it.pagopa.swclient.mil.azureservices.identity.bean.Scope;
-import it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityReactiveClient;
+import it.pagopa.swclient.mil.azureservices.identity.client.AzureIdentityClient;
+import it.pagopa.swclient.mil.azureservices.identity.client.systemmanaged.AzureSystemManagedIdentityClient;
+import it.pagopa.swclient.mil.azureservices.identity.client.workload.AzureWorkloadIdentityClient;
+import jakarta.enterprise.inject.Instance;
+import jakarta.enterprise.inject.spi.DeploymentException;
/**
*
* @author Antonio Tarricone
*/
@QuarkusTest
+@SuppressWarnings("unchecked")
class AzureIdentityReactiveServiceTest {
/**
*
@@ -44,8 +52,7 @@ void init(TestInfo testInfo) {
}
/**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.service.AzureIdentityReactiveService#getAccessToken(it.pagopa.swclient.mil.azureservices.identity.bean.Scope)}.
+ *
*/
@Test
void given_emptyCache_when_getAccessTokenInvoked_then_getNewOneCacheAndReturnIt() {
@@ -57,14 +64,29 @@ void given_emptyCache_when_getAccessTokenInvoked_then_getNewOneCacheAndReturnIt(
.setExpiresOn(now.plus(5, ChronoUnit.MINUTES).getEpochSecond())
.setValue("access_token_string");
- AzureIdentityReactiveClient identityClient = mock(AzureIdentityReactiveClient.class);
+ AzureWorkloadIdentityClient identityClient = mock(AzureWorkloadIdentityClient.class);
when(identityClient.getAccessToken(Scope.VAULT))
.thenReturn(Uni.createFrom().item(accessToken));
+ Instance identityClientInstance = mock(Instance.class);
+ when(identityClientInstance.get())
+ .thenReturn(identityClient);
+
+ Instance anyIdentityClient = mock(Instance.class);
+ when(anyIdentityClient.select(AzureWorkloadIdentityClient.class))
+ .thenReturn(identityClientInstance);
+
/*
* Test
*/
- AzureIdentityReactiveService identityService = spy(new AzureIdentityReactiveService(identityClient));
+ AzureIdentityReactiveService identityService = spy(new AzureIdentityReactiveService(
+ Optional.empty(),
+ Optional.empty(),
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.of("da795842-fa15-4fd4-b556-f371ac9bafed"),
+ Optional.of("aeeb30a1-2d89-42bd-832c-69dc15a53d36"),
+ Optional.of("/var/run/secrets/azure/tokens/azure-identity-token"),
+ anyIdentityClient));
identityService.getAccessToken(Scope.VAULT)
.subscribe()
@@ -76,8 +98,7 @@ void given_emptyCache_when_getAccessTokenInvoked_then_getNewOneCacheAndReturnIt(
}
/**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.service.AzureIdentityReactiveService#getAccessToken(it.pagopa.swclient.mil.azureservices.identity.bean.Scope)}.
+ *
*/
@Test
void given_storedAccessToken_when_getAccessTokenInvoked_then_getReturnIt() {
@@ -89,14 +110,29 @@ void given_storedAccessToken_when_getAccessTokenInvoked_then_getReturnIt() {
.setExpiresOn(now.plus(5, ChronoUnit.MINUTES).getEpochSecond())
.setValue("access_token_string");
- AzureIdentityReactiveClient identityClient = mock(AzureIdentityReactiveClient.class);
+ AzureSystemManagedIdentityClient identityClient = mock(AzureSystemManagedIdentityClient.class);
when(identityClient.getAccessToken(Scope.VAULT))
.thenReturn(Uni.createFrom().item(accessToken));
+ Instance identityClientInstance = mock(Instance.class);
+ when(identityClientInstance.get())
+ .thenReturn(identityClient);
+
+ Instance anyIdentityClient = mock(Instance.class);
+ when(anyIdentityClient.select(AzureSystemManagedIdentityClient.class))
+ .thenReturn(identityClientInstance);
+
/*
* Test
*/
- AzureIdentityReactiveService identityService = spy(new AzureIdentityReactiveService(identityClient));
+ AzureIdentityReactiveService identityService = spy(new AzureIdentityReactiveService(
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.of("45ed57a0-ec26-41c9-8333-29daf37697d3"),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ anyIdentityClient));
identityService.getAccessToken(Scope.VAULT)
.subscribe()
@@ -114,10 +150,8 @@ void given_storedAccessToken_when_getAccessTokenInvoked_then_getReturnIt() {
}
/**
- * Test method for
- * {@link it.pagopa.swclient.mil.azureservices.identity.service.AzureIdentityReactiveService#getAccessToken(it.pagopa.swclient.mil.azureservices.identity.bean.Scope)}.
+ *
*/
- @SuppressWarnings("unchecked")
@Test
void given_expAccessTokenStored_when_getAccessTokenInvoked_then_getNewOneCacheAndReturnIt() {
/*
@@ -131,17 +165,31 @@ void given_expAccessTokenStored_when_getAccessTokenInvoked_then_getNewOneCacheAn
.setExpiresOn(now.plus(5, ChronoUnit.MINUTES).getEpochSecond())
.setValue("access_token_string");
- AzureIdentityReactiveClient identityClient = mock(AzureIdentityReactiveClient.class);
-
+ AzureWorkloadIdentityClient identityClient = mock(AzureWorkloadIdentityClient.class);
when(identityClient.getAccessToken(Scope.VAULT))
.thenReturn(
Uni.createFrom().item(expAccessToken),
Uni.createFrom().item(accessToken));
+ Instance identityClientInstance = mock(Instance.class);
+ when(identityClientInstance.get())
+ .thenReturn(identityClient);
+
+ Instance anyIdentityClient = mock(Instance.class);
+ when(anyIdentityClient.select(AzureWorkloadIdentityClient.class))
+ .thenReturn(identityClientInstance);
+
/*
* Test
*/
- AzureIdentityReactiveService identityService = spy(new AzureIdentityReactiveService(identityClient));
+ AzureIdentityReactiveService identityService = spy(new AzureIdentityReactiveService(
+ Optional.empty(),
+ Optional.empty(),
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.of("da795842-fa15-4fd4-b556-f371ac9bafed"),
+ Optional.of("aeeb30a1-2d89-42bd-832c-69dc15a53d36"),
+ Optional.of("/var/run/secrets/azure/tokens/azure-identity-token"),
+ anyIdentityClient));
identityService.getAccessToken(Scope.VAULT)
.subscribe()
@@ -157,4 +205,109 @@ void given_expAccessTokenStored_when_getAccessTokenInvoked_then_getNewOneCacheAn
verify(identityService, times(2)).getNewAccessTokenAndCacheIt(Scope.VAULT);
}
+
+ /**
+ *
+ */
+ @Test
+ void given_systemManagedIdEnvironment_when_invokeGet_then_returnSuitableClient() {
+ AzureSystemManagedIdentityClient identityClient = mock(AzureSystemManagedIdentityClient.class);
+
+ Instance identityClientInstance = mock(Instance.class);
+ when(identityClientInstance.get())
+ .thenReturn(identityClient);
+
+ Instance anyIdentityClient = mock(Instance.class);
+ when(anyIdentityClient.select(AzureSystemManagedIdentityClient.class))
+ .thenReturn(identityClientInstance);
+
+ AzureIdentityReactiveService service = new AzureIdentityReactiveService(
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.of("45ed57a0-ec26-41c9-8333-29daf37697d3"),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ anyIdentityClient);
+
+ assertTrue(service.getIdentityClient() instanceof AzureSystemManagedIdentityClient);
+ }
+
+ /**
+ *
+ */
+ @Test
+ void given_partialsystemManagedIdEnvironment_when_invokeGet_then_throwException() {
+ assertThrows( // NOSONAR
+ DeploymentException.class,
+ () -> new AzureIdentityReactiveService(
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ null));
+ }
+
+ /**
+ *
+ */
+ @Test
+ void given_workloadIdEnvironment_when_invokeGet_then_returnSuitableClient() {
+ AzureWorkloadIdentityClient identityClient = mock(AzureWorkloadIdentityClient.class);
+
+ Instance identityClientInstance = mock(Instance.class);
+ when(identityClientInstance.get())
+ .thenReturn(identityClient);
+
+ Instance anyIdentityClient = mock(Instance.class);
+ when(anyIdentityClient.select(AzureWorkloadIdentityClient.class))
+ .thenReturn(identityClientInstance);
+
+ AzureIdentityReactiveService service = new AzureIdentityReactiveService(
+ Optional.empty(),
+ Optional.empty(),
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.of("da795842-fa15-4fd4-b556-f371ac9bafed"),
+ Optional.of("aeeb30a1-2d89-42bd-832c-69dc15a53d36"),
+ Optional.of("/var/run/secrets/azure/tokens/azure-identity-token"),
+ anyIdentityClient);
+
+ assertTrue(service.getIdentityClient() instanceof AzureWorkloadIdentityClient);
+ }
+
+ /**
+ *
+ */
+ @Test
+ void given_partialWorkloadIdEnvironment_when_invokeGet_then_throwException() {
+ assertThrows( // NOSONAR
+ DeploymentException.class,
+ () -> new AzureIdentityReactiveService(
+ Optional.empty(),
+ Optional.empty(),
+ Optional.of("https://login.microsoftonline.com/"),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ null));
+ }
+
+ /**
+ *
+ */
+ @Test
+ void given_noIdentityEnvironment_when_invokeGet_then_throwException() {
+ assertThrows( // NOSONAR
+ DeploymentException.class,
+ () -> new AzureIdentityReactiveService(
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ Optional.empty(),
+ null));
+ }
}
diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties
index b027298..04300e7 100644
--- a/src/test/resources/application.properties
+++ b/src/test/resources/application.properties
@@ -8,4 +8,8 @@ azure-key-vault-keys.get-keys.maxresults=25
quarkus.rest-client.azure-storage-blob.url=https://dummy
azure-storage-blob.api-version=dummy
-AZURE_FEDERATED_TOKEN_FILE=src/test/resources/azure-identity-token
\ No newline at end of file
+AZURE_AUTHORITY_HOST=https://login.microsoftonline.com/
+AZURE_TENANT_ID=da795842-fa15-4fd4-b556-f371ac9bafed
+AZURE_FEDERATED_TOKEN_FILE=src/test/resources/azure-identity-token
+
+IDENTITY_ENDPOINT=https://login.microsoftonline.com/
\ No newline at end of file