mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 00:47:11 +02:00
Sanitize EPP XML requests and responses
Masks user credentials (tags 'pw' and 'newPW') in EPP XML messages. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=207953894
This commit is contained in:
parent
9eec70729f
commit
81fce674d2
11 changed files with 415 additions and 3 deletions
|
@ -190,12 +190,13 @@ public class FlowRunnerTest extends ShardableTestCase {
|
|||
@Test
|
||||
public void testRun_loggingStatement_complexEppInput() throws Exception {
|
||||
String domainCreateXml = loadFile(getClass(), "domain_create_prettyprinted.xml");
|
||||
String sanitizedDomainCreateXml = domainCreateXml.replace("2fooBAR", "*******");
|
||||
flowRunner.inputXmlBytes = domainCreateXml.getBytes(UTF_8);
|
||||
flowRunner.run(eppMetricBuilder);
|
||||
String logMessage = findFirstLogMessageByPrefix(handler, "EPP Command\n\t");
|
||||
List<String> lines = Splitter.on("\n\t").splitToList(logMessage);
|
||||
assertThat(lines.size()).named("number of lines in log message").isAtLeast(9);
|
||||
String xml = Joiner.on('\n').join(lines.subList(3, lines.size() - 4));
|
||||
assertThat(xml).isEqualTo(domainCreateXml);
|
||||
assertThat(xml).isEqualTo(sanitizedDomainCreateXml);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue