-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter HTTP Basic Authorisation Credential in Update Audit Log #1622
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # whois-api/src/main/java/net/ripe/db/whois/api/apiKey/BearerTokenExtractor.java # whois-api/src/main/java/net/ripe/db/whois/api/rest/WhoisServletDeployer.java # whois-api/src/test/java/net/ripe/db/whois/api/ApiKeyAuthServerDummy.java # whois-api/src/test/java/net/ripe/db/whois/api/rest/WhoisRestApiKeyAuthTestIntegration.java # whois-api/src/test/java/net/ripe/db/whois/api/rest/WhoisSearchServiceTestIntegration.java # whois-update/src/main/resources/templates/notification.vm # whois-update/src/test/java/net/ripe/db/whois/update/handler/response/ResponseFactoryTest.java
"delete: adsf\n"; | ||
|
||
assertThat(PasswordFilter.filterPasswordsInContents(input), containsString("" + | ||
"Header: Authorization=Basic FILTERED\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two spaces in the output, but the regex doesn't appear to include any spaces in the matching group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed one space
private static String replaceBasicAuthHeader(final Matcher matcher) { | ||
final StringBuilder result = new StringBuilder(); | ||
while (matcher.find()) { | ||
matcher.appendReplacement(result, String.format("%s%s", StringUtils.substringBefore(matcher.group(0), matcher.group(1)),"FILTERED")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regex is still matching a space? Can you use (.*)
as the group in the pattern instead?
No description provided.