This is an automated email from the ASF dual-hosted git repository. twolf pushed a commit to branch dev_3.0 in repository https://gitbox.apache.org/repos/asf/mina-sshd.git
commit 5d5a65a263437e2bee9f642a28c8f7a6e4fc61db Author: Thomas Wolf <[email protected]> AuthorDate: Mon May 19 21:13:10 2025 +0200 Minor clean up for ProxyData --- sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyData.java | 3 +++ .../src/main/java/org/apache/sshd/client/proxy/ProxyDataFactory.java | 1 + 2 files changed, 4 insertions(+) diff --git a/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyData.java b/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyData.java index 35753e7ab..af7b016cc 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyData.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyData.java @@ -52,6 +52,9 @@ public class ProxyData { * @param proxyPassword to use for log-in to the proxy, may be {@code null} */ public ProxyData(Proxy proxy, String proxyUser, char[] proxyPassword) { + if (Proxy.Type.DIRECT.equals(proxy.type())) { + throw new IllegalArgumentException("Proxy is direct"); + } if (!(proxy.address() instanceof InetSocketAddress)) { throw new IllegalArgumentException("Proxy does not have an InetSocketAddress"); } diff --git a/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyDataFactory.java b/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyDataFactory.java index 4727b283d..c01597b81 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyDataFactory.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/proxy/ProxyDataFactory.java @@ -23,6 +23,7 @@ import java.net.InetSocketAddress; /** * A factory for obtaining {@link ProxyData} to connect through some proxy. */ +@FunctionalInterface public interface ProxyDataFactory { /**
