summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2015-09-30 15:57:59 -0700
committerJeff Forcier <jeff@bitprophet.org>2015-09-30 15:58:01 -0700
commit93694bb9ed4e28673586fd18ffce0fc0e925df1f (patch)
treeb5012ad4b3f6831d8e9a9294d897633771351f90
parent8bf03014128b074bf6988100f18e48a94671cca2 (diff)
Add docstring to AgentRequestHandler so it shows up in the docs.
-rw-r--r--paramiko/agent.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py
index f928881e..6a8e7fb4 100644
--- a/paramiko/agent.py
+++ b/paramiko/agent.py
@@ -290,6 +290,26 @@ class AgentServerProxy(AgentSSH):
class AgentRequestHandler(object):
+ """
+ Primary/default implementation of SSH agent forwarding functionality.
+
+ Simply instantiate this class, handing it a live command-executing session
+ object, and it will handle forwarding any local SSH agent processes it
+ finds.
+
+ For example::
+
+ # Connect
+ client = SSHClient()
+ client.connect(host, port, username)
+ # Obtain session
+ session = client.get_transport().open_session()
+ # Forward local agent
+ AgentRequestHandler(session)
+ # Commands executed after this point will see the forwarded agent on
+ # the remote end.
+ session.exec_command("git clone https://my.git.repository/")
+ """
def __init__(self, chanClient):
self._conn = None
self.__chanC = chanClient