aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2020-07-26 20:37:57 +0200
committerThomas Wolf <thomas.wolf@paranor.ch>2020-09-19 15:17:00 -0400
commit566e49d7d39b12c785be24b8b61b4960a4b7ea17 (patch)
treee85e18f6feed63d84a8a8be09cd6179bad97930f /org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java
parent020dc586a6e01fd98f0ce8ca0c0c9997b4224fc4 (diff)
downloadjgit-566e49d7d39b12c785be24b8b61b4960a4b7ea17.tar.gz
jgit-566e49d7d39b12c785be24b8b61b4960a4b7ea17.zip
sshd: support the ProxyJump ssh config
This is useful to access git repositories behind a bastion server (jump host). Add a constant for the config; rewrite the whole connection initiation to parse the value and (recursively) set up the chain of hops. Add tests for a single hop and two different ways to configure a two-hop chain. The connection timeout applies to each hop in the chain individually. Change-Id: Idd25af95aa2ec5367404587e4e530b0663c03665 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java30
1 files changed, 29 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java
index b1fac2cffb..fff2938e5d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/SshConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2018 Thomas Wolf <thomas.wolf@paranor.ch> and others
+ * Copyright (C) 2018, 2020 Thomas Wolf <thomas.wolf@paranor.ch> and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0 which is available at
@@ -117,6 +117,34 @@ public final class SshConstants {
/** Key in an ssh config file. */
public static final String PROXY_COMMAND = "ProxyCommand";
+ /**
+ * Comma-separated list of jump hosts, defining a jump host chain <em>in
+ * reverse order</em>. Each jump host is a SSH URI or "[user@]host[:port]".
+ * <p>
+ * Reverse order means: to connect A->B->target, one can do in
+ * {@code ~/.ssh/config} either of:
+ * </p>
+ *
+ * <pre>
+ * Host target
+ * ProxyJump B,A
+ * </pre>
+ * <p>
+ * <em>or</em>
+ * </p>
+ *
+ * <pre>
+ * Host target
+ * ProxyJump B
+ *
+ * Host B
+ * ProxyJump A
+ * </pre>
+ *
+ * @since 5.10
+ */
+ public static final String PROXY_JUMP = "ProxyJump";
+
/** Key in an ssh config file. */
public static final String REMOTE_COMMAND = "RemoteCommand";