Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.azure.core.credential.AccessToken;
import com.azure.core.credential.TokenCredential;
import com.azure.core.credential.TokenRequestContext;
import com.azure.security.keyvault.keys.cryptography.models.KeyWrapAlgorithm;
import com.azure.storage.common.StorageSharedKeyCredential;
import com.azure.storage.file.datalake.DataLakeFileSystemClientBuilder;
import java.io.Serializable;
Expand Down Expand Up @@ -53,6 +52,9 @@ public class AzureProperties implements Serializable {
public static final String AZURE_KEYVAULT_KEY_WRAP_ALGORITHM =
"azure.keyvault.key-wrap-algorithm";

// Must match KeyWrapAlgorithm.RSA_OAEP_256.getValue() from azure-security-keyvault-keys
private static final String DEFAULT_KEY_WRAP_ALGORITHM = "RSA-OAEP-256";

/**
* Configure the ADLS token credential provider used to get {@link TokenCredential}. A fully
* qualified concrete class with package that implements the {@link AdlsTokenCredentialProvider}
Expand Down Expand Up @@ -136,8 +138,7 @@ public AzureProperties(Map<String, String> properties) {

this.keyWrapAlgorithm =
properties.getOrDefault(
AzureProperties.AZURE_KEYVAULT_KEY_WRAP_ALGORITHM,
KeyWrapAlgorithm.RSA_OAEP_256.getValue());
AzureProperties.AZURE_KEYVAULT_KEY_WRAP_ALGORITHM, DEFAULT_KEY_WRAP_ALGORITHM);
}

public Optional<Integer> adlsReadBlockSize() {
Expand Down Expand Up @@ -204,8 +205,8 @@ public Mono<AccessToken> getToken(TokenRequestContext request) {
}
}

public KeyWrapAlgorithm keyWrapAlgorithm() {
return KeyWrapAlgorithm.fromString(this.keyWrapAlgorithm);
public String keyWrapAlgorithm() {
return this.keyWrapAlgorithm;
}

public Optional<String> keyVaultUrl() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ private ClientState state() {
keyClientBuilder
.credential(AdlsTokenCredentialProviders.from(allProperties).credential())
.buildClient();
KeyWrapAlgorithm keyWrapAlgorithm = azureProperties.keyWrapAlgorithm();
KeyWrapAlgorithm keyWrapAlgorithm =
KeyWrapAlgorithm.fromString(azureProperties.keyWrapAlgorithm());
state = new ClientState(keyClient, keyWrapAlgorithm);
}
}
Expand Down
Loading