Skip to content

Commit

Permalink
Fixed CredScan issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
vcolin7 committed Apr 6, 2023
1 parent 48546db commit 0098cb2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import com.azure.core.test.TestBase;
import com.azure.core.test.TestMode;
import com.azure.core.test.TestProxyTestBase;
import com.azure.core.test.models.TestProxySanitizer;
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.core.util.Configuration;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.azure.security.keyvault.administration.implementation.KeyVaultCredentialPolicy;
Expand Down Expand Up @@ -49,6 +51,10 @@ protected String getTestName() {
protected List<HttpPipelinePolicy> getPolicies() {
TokenCredential credential = null;

List<TestProxySanitizer> customSanitizers = new ArrayList<>();
customSanitizers.add(new TestProxySanitizer("token", "REDACTED", TestProxySanitizerType.BODY_KEY));
interceptorManager.addSanitizers(customSanitizers);

if (!interceptorManager.isPlaybackMode()) {
String clientId = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_ID");
String clientKey = Configuration.getGlobalConfiguration().get("AZURE_KEYVAULT_CLIENT_SECRET");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"RequestBody": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"StatusCode": 202,
"ResponseHeaders": {
Expand Down Expand Up @@ -626,7 +626,7 @@
"RequestBody": {
"sasTokenParameters": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup/",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"folderToRestore": "mhsm-azkvrecordtestshsm-2023040404325011"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"RequestBody": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"StatusCode": 202,
"ResponseHeaders": {
Expand Down Expand Up @@ -690,7 +690,7 @@
"RequestBody": {
"sasTokenParameters": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup/",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"folder": "mhsm-azkvrecordtestshsm-2023040404345773"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"RequestBody": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"StatusCode": 202,
"ResponseHeaders": {
Expand Down Expand Up @@ -702,7 +702,7 @@
"RequestBody": {
"sasTokenParameters": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup/",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"folderToRestore": "mhsm-azkvrecordtestshsm-2023040404393589"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@
"RequestBody": {
"sasTokenParameters": {
"storageResourceUri": "https://azkvrecordtestsprim.blob.core.windows.net/backup/",
"token": "sv=2021-12-02\u0026ss=b\u0026srt=sco\u0026se=2050-12-12T00%3A00%3A00Z\u0026sp=rwdxlacuptf\u0026sig=W%2FDiD190xBcMb4OXSTYH2HBhJ0hGtxQeUMsiEJCGVHA%3D"
"token": "REDACTED"
},
"folder": "mhsm-azkvrecordtestshsm-2023040404382597"
},
Expand Down

0 comments on commit 0098cb2

Please sign in to comment.