Supports only a single repository. Authenticates only the given test user against his given test public key. Supports fetch and push.
| Modifier and Type | Class and Description |
|---|---|
| private static class | SshTestGitServer.
Simple echo command that echoes back the command string. |
| private static class | |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ECHO_COMMAND
Simple echo test command. |
| private final CloseableExecutorService | |
| protected final List | |
| protected final Repository | |
| protected final SshServer | |
| protected PublicKey | |
| protected final String |
| Access | Constructor and Description |
|---|---|
| public | SshTestGitServer(String
user name of the test user testUser, Path public key file of the test user testKey, Repository to serve repository, byte[] the unencrypted private key to use as host key hostKey)Creates a ssh git test server. |
| public | SshTestGitServer(String
user name of the test user testUser, Path public key file of the test user testKey, Repository to serve repository, KeyPair the unencrypted private key to use as host key hostKey)Creates a ssh git test server. |
| public | SshTestGitServer(String
user name of the test user testUser, PublicKey the testKey, Repository PublicKey of the test userto serve repository, KeyPair the hostKey)KeyPair to use as host keyCreates a ssh git test server. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addHostKey(Path
path to the private key file; should not be encrypted key, boolean whether to add the new key before other existing keys inFront)Adds an additional host key to the server. |
| public void | addHostKey(KeyPair
KeyPair to addwhether to add the new key before other existing keys inFront)Adds an additional host key to the server. |
| protected void | |
| protected void | |
| protected List | Returns: A possibly empty collection of subsystems.Configures the test server's subsystems (sftp, scp). |
| public void | |
| public void | |
| private List | |
| public PropertyResolver | Returns: thePropertyResolverRetrieves the server's |
| private static List | Returns: a list of supported signature factoriesApache MINA sshd 2.6.0 has removed DSA, DSA_CERT and RSA_CERT. |
| private static KeyPair | |
| private static PublicKey | |
| public void | setPreamble(String...
to send lines)Sets the lines the server sends before its server identification in the initial protocol version exchange. |
| public void | |
| public void | |
| public int | Returns: the port the server listens on; test clients should connect to that portStarts the test server, listening on a random port. |
| public void |
| ECHO_COMMAND | back to summary |
|---|---|
| public static final String ECHO_COMMAND Simple echo test command. Replies with the command string as passed. If of the form "echo [int] anything", takes the integer value as a delay in seconds before replying, which may be useful to test various timeout-related things.
| |
| executorService | back to summary |
|---|---|
| private final CloseableExecutorService executorService | |
| hostKeys | back to summary |
|---|---|
| protected final List<KeyPair> hostKeys
| |
| repository | back to summary |
|---|---|
| protected final Repository repository
| |
| server | back to summary |
|---|---|
| protected final SshServer server | |
| testKey | back to summary |
|---|---|
| protected PublicKey testKey
| |
| testUser | back to summary |
|---|---|
| protected final String testUser
| |
| SshTestGitServer | back to summary |
|---|---|
| public SshTestGitServer(String testUser, Path testKey, Repository repository, byte[] hostKey) throws IOException, GeneralSecurityException Creates a ssh git test server. It serves one single repository, and accepts public-key authentication for exactly one test user.
| |
| SshTestGitServer | back to summary |
|---|---|
| public SshTestGitServer(String testUser, Path testKey, Repository repository, KeyPair hostKey) throws IOException, GeneralSecurityException Creates a ssh git test server. It serves one single repository, and accepts public-key authentication for exactly one test user.
| |
| SshTestGitServer | back to summary |
|---|---|
| public SshTestGitServer(String testUser, PublicKey testKey, Repository repository, KeyPair hostKey) Creates a ssh git test server. It serves one single repository, and accepts public-key authentication for exactly one test user. | |
| addHostKey | back to summary |
|---|---|
| public void addHostKey(Path key, boolean inFront) throws IOException, GeneralSecurityException Adds an additional host key to the server.
| |
| addHostKey | back to summary |
|---|---|
| public void addHostKey(KeyPair key, boolean inFront) Adds an additional host key to the server. | |
| configureAuthentication | back to summary |
|---|---|
| protected void configureAuthentication() Configures the authentication mechanisms of this test server. Invoked from the constructor. The default sets up public key authentication for the test user, and a gssapi-with-mic authenticator that pretends to support this mechanism, but that then refuses to authenticate anyone. | |
| configureShell | back to summary |
|---|---|
| protected void configureShell() Configures shell access for the test server. The default provides no shell at all. | |
| configureSubsystems | back to summary |
|---|---|
| protected List Configures the test server's subsystems (sftp, scp). Invoked from the constructor. The default provides a simple SFTP setup with the root directory as the given repository's .git directory's parent. (I.e., at the directory containing the .git directory.)
| |
| enableKeyboardInteractiveAuthentication | back to summary |
|---|---|
| public void enableKeyboardInteractiveAuthentication() Enable keyboard-interactive authentication. The server will accept the test user's name, converted to all upper-case, as password. | |
| enablePasswordAuthentication | back to summary |
|---|---|
| public void enablePasswordAuthentication() Enable password authentication. The server will accept the test user's name, converted to all upper-case, as password. | |
| getAuthFactories | back to summary |
|---|---|
| private List | |
| getPropertyResolver | back to summary |
|---|---|
| public PropertyResolver getPropertyResolver() Retrieves the server's
| |
| getSignatureFactories | back to summary |
|---|---|
| private static List Apache MINA sshd 2.6.0 has removed DSA, DSA_CERT and RSA_CERT. We have to set it up explicitly to still allow users to connect with DSA keys.
| |
| readKeyPair | back to summary |
|---|---|
| private static KeyPair readKeyPair(byte[] keyMaterial) throws IOException, GeneralSecurityException | |
| readPublicKey | back to summary |
|---|---|
| private static PublicKey readPublicKey(Path key) throws IOException, GeneralSecurityException | |
| setPreamble | back to summary |
|---|---|
| public void setPreamble(String... lines) Sets the lines the server sends before its server identification in the initial protocol version exchange.
| |
| setTestUserPublicKey | back to summary |
|---|---|
| public void setTestUserPublicKey(Path key) throws IOException, GeneralSecurityException Sets the test user's public key on the server.
| |
| setTestUserPublicKey | back to summary |
|---|---|
| public void setTestUserPublicKey(PublicKey key) Sets the test user's public key on the server.
| |
| start | back to summary |
|---|---|
| public int start() throws IOException Starts the test server, listening on a random port.
| |
| stop | back to summary |
|---|---|
| public void stop() throws IOException Stops the test server.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void |
| EchoCommand | back to summary |
|---|---|
| protected EchoCommand(String command, CloseableExecutorService executorService) | |
| doEcho | back to summary |
|---|---|
| private void doEcho(String text, OutputStream stream) throws IOException | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected Boolean |
| FakeUserAuthGSS | back to summary |
|---|---|
| private FakeUserAuthGSS() | |
| doAuth | back to summary |
|---|---|
| protected Boolean doAuth(Buffer buffer, boolean initial) throws Exception Overrides org. | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| GitReceivePackCommand | back to summary |
|---|---|
| protected GitReceivePackCommand(String command, CloseableExecutorService executorService) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| GitUploadPackCommand | back to summary |
|---|---|
| protected GitUploadPackCommand(String command, CloseableExecutorService executorService) | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |