[BUG] Set secret operation of the Key Vault Secrets Client overrides the content type of the secret with application/json #37019
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
KeyVault
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
The Key Vault Secrets Client sets or overrides the content type of the secret with
application/json
. This means, that even if the caller specified the content type of the secret, the created secret in the Key Vault will haveapplication/json
persisted.Exception or Stack Trace
N/A
To Reproduce
Run the following test:
Code Snippet
The content type is set in the following locations:
azure-sdk-for-java/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/implementation/SecretClientImpl.java
Line 475 in 18e1933
azure-sdk-for-java/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/implementation/SecretClientImpl.java
Line 622 in 18e1933
The contentType parameter is always getting
applciation/json
as value due to these lines:azure-sdk-for-java/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretAsyncClient.java
Line 297 in 3f261df
azure-sdk-for-java/sdk/keyvault/azure-security-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretClient.java
Line 268 in 3f261df
Expected behavior
When the
contentType
is set in the secret properties object, then it is persisted as-is, the test in the "To Reproduce" section passes.Screenshots
N/A
Setup (please complete the following information):
Additional context
The bug was introduced in 4.7.0, as the same test passes with 4.6.x or previous versions of the client.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: