-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: System-managed and RBAC support to access to KV and Storage. (#72)
- Loading branch information
1 parent
d2ed379
commit e33d1f4
Showing
39 changed files
with
542 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/it/pagopa/swclient/mil/auth/azure/auth/service/AzureAuthService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* AzureAuthService.java | ||
* | ||
* 1 ago 2023 | ||
*/ | ||
package it.pagopa.swclient.mil.auth.azure.auth.service; | ||
|
||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
import org.eclipse.microprofile.rest.client.inject.RestClient; | ||
|
||
import io.quarkus.logging.Log; | ||
import io.smallrye.mutiny.Uni; | ||
import it.pagopa.swclient.mil.auth.azure.auth.bean.GetAccessTokenResponse; | ||
import it.pagopa.swclient.mil.auth.azure.auth.client.AzureAuthClient; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
|
||
/** | ||
* @author Antonio Tarricone | ||
*/ | ||
@ApplicationScoped | ||
public class AzureAuthService { | ||
/* | ||
* Scopes for authentication. | ||
*/ | ||
//private static final String VAULT = "https://vault.azure.net/.default"; | ||
public static final String VAULT = "https://vault.azure.net"; | ||
public static final String STORAGE = "https://storage.azure.com"; | ||
|
||
/* | ||
* | ||
*/ | ||
@RestClient | ||
AzureAuthClient client; | ||
|
||
/* | ||
* | ||
*/ | ||
@ConfigProperty(name = "azure-auth-api.identity") | ||
String identity; | ||
|
||
/** | ||
* @return | ||
*/ | ||
public Uni<GetAccessTokenResponse> getAccessToken() { | ||
Log.debug("Authenticating to Azure AD for Key Vault."); | ||
return client.getAccessToken(identity, VAULT); | ||
} | ||
|
||
/** | ||
* @return | ||
*/ | ||
public Uni<GetAccessTokenResponse> getAccessTokenForStorage() { | ||
Log.debug("Authenticating to Azure AD for Storage Account."); | ||
return client.getAccessToken(identity, STORAGE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.