mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 12:07:51 +02:00
Extend registrar allowed IPs auth exception text with IP address (#1726)
This commit is contained in:
parent
a04420c873
commit
4399067ddd
1 changed files with 7 additions and 3 deletions
|
@ -114,7 +114,7 @@ public class TlsCredentials implements TransportCredentials {
|
|||
"Authentication error: IP address %s is not allow-listed for registrar %s; allow list is:"
|
||||
+ " %s",
|
||||
clientInetAddr, registrar.getRegistrarId(), ipAddressAllowList);
|
||||
throw new BadRegistrarIpAddressException();
|
||||
throw new BadRegistrarIpAddressException(clientInetAddr);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
@ -216,8 +216,12 @@ public class TlsCredentials implements TransportCredentials {
|
|||
|
||||
/** Registrar IP address is not in stored allow list. */
|
||||
public static class BadRegistrarIpAddressException extends AuthenticationErrorException {
|
||||
BadRegistrarIpAddressException() {
|
||||
super("Registrar IP address is not in stored allow list");
|
||||
BadRegistrarIpAddressException(Optional<InetAddress> clientInetAddr) {
|
||||
super(
|
||||
clientInetAddr.isPresent()
|
||||
? String.format(
|
||||
"Registrar IP address %s is not in stored allow list", clientInetAddr.get())
|
||||
: "Registrar IP address is not in stored allow list");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue