Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -135,9 +134,7 @@ public AzureProperties(Map<String, String> properties) {
}

this.keyWrapAlgorithm =
properties.getOrDefault(
AzureProperties.AZURE_KEYVAULT_KEY_WRAP_ALGORITHM,
KeyWrapAlgorithm.RSA_OAEP_256.getValue());
properties.getOrDefault(AzureProperties.AZURE_KEYVAULT_KEY_WRAP_ALGORITHM, "RSA-OAEP-256");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we extract this into a named constant with a comment noting which Azure SDK value it mirrors? Something like:

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion, updated.

}

public Optional<Integer> adlsReadBlockSize() {
Expand Down Expand Up @@ -204,8 +201,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