mirror of
https://github.com/google/nomulus.git
synced 2025-07-09 12:43:24 +02:00
Add clientCertificate to TlsCredentials.toString() (#945)
* Add clientCertificate to TlsCredentials.toString() FlowRunner.run() logs these credentials to the GAE logs by implicitly using the toString() method, so we need to add it if we want it to appear in the logs.
This commit is contained in:
parent
4e66fed497
commit
a3537447ef
2 changed files with 5 additions and 2 deletions
|
@ -223,6 +223,7 @@ public class TlsCredentials implements TransportCredentials {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return toStringHelper(getClass())
|
return toStringHelper(getClass())
|
||||||
|
.add("clientCertificate", clientCertificate.orElse(null))
|
||||||
.add("clientCertificateHash", clientCertificateHash.orElse(null))
|
.add("clientCertificateHash", clientCertificateHash.orElse(null))
|
||||||
.add("clientAddress", clientInetAddr.orElse(null))
|
.add("clientAddress", clientInetAddr.orElse(null))
|
||||||
.toString();
|
.toString();
|
||||||
|
|
|
@ -155,12 +155,14 @@ class FlowRunnerTest {
|
||||||
new TlsCredentials(
|
new TlsCredentials(
|
||||||
true,
|
true,
|
||||||
Optional.of("abc123def"),
|
Optional.of("abc123def"),
|
||||||
Optional.of("cert"),
|
Optional.of("cert046F5A3"),
|
||||||
Optional.of("127.0.0.1"),
|
Optional.of("127.0.0.1"),
|
||||||
certificateChecker);
|
certificateChecker);
|
||||||
flowRunner.run(eppMetricBuilder);
|
flowRunner.run(eppMetricBuilder);
|
||||||
assertThat(Splitter.on("\n\t").split(findFirstLogMessageByPrefix(handler, "EPP Command\n\t")))
|
assertThat(Splitter.on("\n\t").split(findFirstLogMessageByPrefix(handler, "EPP Command\n\t")))
|
||||||
.contains("TlsCredentials{clientCertificateHash=abc123def, clientAddress=/127.0.0.1}");
|
.contains(
|
||||||
|
"TlsCredentials{clientCertificate=cert046F5A3, clientCertificateHash=abc123def,"
|
||||||
|
+ " clientAddress=/127.0.0.1}");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue