You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "nightman68 (via GitHub)" <gi...@apache.org> on 2024/03/18 17:04:27 UTC

[PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

nightman68 opened a new pull request, #477:
URL: https://github.com/apache/mina-sshd/pull/477

    fix #318.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "nightman68 (via GitHub)" <gi...@apache.org>.
nightman68 commented on code in PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#discussion_r1529260685


##########
sshd-core/src/main/java/org/apache/sshd/client/SshClient.java:
##########
@@ -683,8 +683,11 @@ protected List<HostConfigEntry> parseProxyJumps(String proxyJump, AttributeRepos
             String host = uri.getHost();
             int port = uri.getPort();
             String userInfo = uri.getUserInfo();
-            HostConfigEntry entry = resolveHost(userInfo, host, port, context, null);
-            jumps.add(entry);
+            HostConfigEntry entry = null;
+            do {
+                entry = resolveHost(userInfo, host, port, context, null);
+                jumps.add(entry);
+            } while((host = entry.getProxyJump()) != null);

Review Comment:
   1. My tests were working like I posted. Using the jumps in reverse oder was not working.
   2. I have not tested this. I assumed that people will use scheme 1 or 2, a mix - I don't know.
   
   May be this solution is better than nothing?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#issuecomment-2143923600

   Fixed differently via PR #512 (including tests).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on code in PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#discussion_r1529240241


##########
sshd-core/src/main/java/org/apache/sshd/client/SshClient.java:
##########
@@ -683,8 +683,11 @@ protected List<HostConfigEntry> parseProxyJumps(String proxyJump, AttributeRepos
             String host = uri.getHost();
             int port = uri.getPort();
             String userInfo = uri.getUserInfo();
-            HostConfigEntry entry = resolveHost(userInfo, host, port, context, null);
-            jumps.add(entry);
+            HostConfigEntry entry = null;
+            do {
+                entry = resolveHost(userInfo, host, port, context, null);
+                jumps.add(entry);
+            } while((host = entry.getProxyJump()) != null);

Review Comment:
   The list may also need to be reversed. Both your configurations should give a connection
   ```
   client -> jump3 -> jump2 -> jump1 -> target
   ```
   but I think they give
   ```
   client -> jump1 -> jump2 -> jump3 -> target
   ```
   ? 
   
   Also: what if `host` at line 690 is again a chain (multiple hosts separated by commas)? As in the config
   ```
   Host jump1
     Hostname                    jump1.corp
     Port                        22
     User                        nightman
     ProxyJump                   jump2,jump3
     LogLevel                    QUIET
   
   Host jump2
     HostName                    jump2.dmz.corp
     Port                        22
     User                        nightman
     #ProxyJump                   jump3
     LogLevel                    QUIET
   
   Host jump3
     HostName                    jump3.dmz.corp
     Port                        22
     User                        nightman
     LogLevel                    QUIET
   
   Host host*.dmz.corp
     ProxyJump                   jump1
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "nightman68 (via GitHub)" <gi...@apache.org>.
nightman68 commented on PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#issuecomment-2006711798

   1. I fixed the proxy order for "inline" definition - my mistake.
   2. The code is now supporting your example configuration above.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "nightman68 (via GitHub)" <gi...@apache.org>.
nightman68 commented on code in PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#discussion_r1529260685


##########
sshd-core/src/main/java/org/apache/sshd/client/SshClient.java:
##########
@@ -683,8 +683,11 @@ protected List<HostConfigEntry> parseProxyJumps(String proxyJump, AttributeRepos
             String host = uri.getHost();
             int port = uri.getPort();
             String userInfo = uri.getUserInfo();
-            HostConfigEntry entry = resolveHost(userInfo, host, port, context, null);
-            jumps.add(entry);
+            HostConfigEntry entry = null;
+            do {
+                entry = resolveHost(userInfo, host, port, context, null);
+                jumps.add(entry);
+            } while((host = entry.getProxyJump()) != null);

Review Comment:
   1. My tests were working like I posted. Using the jumps in reverse oder was not working.
   2. I have not tested this. I assumed that people will use scheme 1 or 2, a mix - I don't know. Just BTW: `entry.getProxyJump()` return 
   
   May be this solution is better than nothing?
   
   Give me some more time, I'll check tomorrow!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "nightman68 (via GitHub)" <gi...@apache.org>.
nightman68 commented on PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#issuecomment-2057631021

   Sorry, I do not have the time at the moment getting familiar with your test suite etc.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#issuecomment-2230137503

   See https://github.com/apache/mina-sshd/blob/master/docs/changes/2.13.0.md. It does mention the issue. (Use 2.13.1. Publishing to Maven Central of 2.13.0 omitted the source bundles.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "nightman68 (via GitHub)" <gi...@apache.org>.
nightman68 commented on PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#issuecomment-2229503096

   In what release the changes will be included? I can't find this information...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed pull request #477: Make the proxy jump resolver a bit more flexible.
URL: https://github.com/apache/mina-sshd/pull/477


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#issuecomment-2032742958

   Thank you; looks much better. Not sure about the precedence of the lists but we can tackle that issue when it arises.
   
   Could you add tests for this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [PR] Make the proxy jump resolver a bit more flexible. [mina-sshd]

Posted by "nightman68 (via GitHub)" <gi...@apache.org>.
nightman68 commented on code in PR #477:
URL: https://github.com/apache/mina-sshd/pull/477#discussion_r1529260685


##########
sshd-core/src/main/java/org/apache/sshd/client/SshClient.java:
##########
@@ -683,8 +683,11 @@ protected List<HostConfigEntry> parseProxyJumps(String proxyJump, AttributeRepos
             String host = uri.getHost();
             int port = uri.getPort();
             String userInfo = uri.getUserInfo();
-            HostConfigEntry entry = resolveHost(userInfo, host, port, context, null);
-            jumps.add(entry);
+            HostConfigEntry entry = null;
+            do {
+                entry = resolveHost(userInfo, host, port, context, null);
+                jumps.add(entry);
+            } while((host = entry.getProxyJump()) != null);

Review Comment:
   1. My tests were working like I posted. Using the jumps in reverse oder was not working.
   2. I have not tested this. I assumed that people will use scheme 1 or 2, a mix - I don't know. Just BTW: `entry.getProxyJump()` return 
   
   May be this solution is better than nothing?
   
   Give me some more time, I'll check tomorrow!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org