Skip to content

Commit

Permalink
Test Proxy minor updates (Azure#33943)
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity authored Mar 9, 2023
1 parent 9dc44fb commit 8be14e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,14 @@ public void addSanitizers(List<TestProxySanitizer> testProxySanitizers) {

/**
* Add matcher rules to match recorded data in playback.
* Matchers are only applied for playback session and so this will be a noop when invoked in RECORD/LIVE mode.
* @param testProxyMatchers the list of matcher rules when playing back recorded data.
* @throws RuntimeException Playback has not started.
*/
public void addMatchers(List<TestProxyRequestMatcher> testProxyMatchers) {
if (testMode != TestMode.PLAYBACK) {
return;
}
if (testProxyPlaybackClient != null) {
testProxyPlaybackClient.addMatcherRequests(testProxyMatchers);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class TestProxyUtils {
"(?:<SecondaryKey>)(?<secret>.*)(?:</SecondaryKey>)"));

private static final String URL_REGEX = "(?<=http://|https://)([^/?]+)";
private static final List<String> HEADERS_TO_REDACT = new ArrayList<>(Arrays.asList("Ocp-Apim-Subscription-Key"));
private static final List<String> HEADERS_TO_REDACT = new ArrayList<>(Arrays.asList("Ocp-Apim-Subscription-Key", "Operation-Location", "api-key"));
private static final String REDACTED_VALUE = "REDACTED";

private static final String DELEGATION_KEY_CLIENTID_REGEX = "(?:<SignedOid>)(?<secret>.*)(?:</SignedOid>)";
Expand Down

0 comments on commit 8be14e1

Please sign in to comment.