copyTestResource(String, File). These test key files names have four
components, separated by a single underscore: "id", the algorithm, the bits
(if variable), and the password if the private key is encrypted. For instance
"id_ecdsa_384_testpass" is an encrypted ECDSA-384 key. The passphrase
to decrypt is "testpass". The key "id_ecdsa_384" is the same but
unencrypted. All keys were generated and encrypted via ssh-keygen. Note that
DSA and ec25519 have no "bits" component. Available keys are listed in
SshTestBase#KEY_RESOURCES.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | |
| protected static class |
| Modifier and Type | Field and Description |
|---|---|
| private SshSessionFactory | |
| protected File | |
| protected File | |
| protected File | |
| protected File | |
| protected File | |
| protected SshTestGitServer | |
| protected File | |
| protected static final String | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected File | |
| protected void | copyTestResource(String
of the test resource to copy resourceName, File file to copy the resource to to)Copies a test data file contained in the test bundle to the given file. |
| protected void | copyTestResource(Class<?>
Class to use to load the resourceof the test resource to copy resourceName, File file to copy the resource to to)Copies a test data file contained in the test bundle to the given file,
using |
| private static File | |
| protected static String | Returns: the public-key part of the lineto write the known_hosts file to file, String for the entry host, int for the entry port, File to use publicKey)Creates a new known_hosts file with one entry for the given host and port taken from the given public key file. |
| protected abstract SshSessionFactory | |
| protected SshSessionFactory | |
| protected boolean | Returns: true if found, false otherwiseto look for host, int to look for port, String to look for keyPart, List<String> to look in lines)Checks whether there is a line for the given host and port that also matches the given key part in the list of lines. |
| protected abstract void | |
| protected void | |
| protected void | |
| public void | |
| public void | |
| private static void |
| factory | back to summary |
|---|---|
| private SshSessionFactory factory | |
| knownHosts | back to summary |
|---|---|
| protected File knownHosts | |
| privateKey1 | back to summary |
|---|---|
| protected File privateKey1 | |
| privateKey2 | back to summary |
|---|---|
| protected File privateKey2 | |
| publicKey1 | back to summary |
|---|---|
| protected File publicKey1 | |
| publicKey2 | back to summary |
|---|---|
protected File publicKey2
| |
| server | back to summary |
|---|---|
| protected SshTestGitServer server | |
| sshDir | back to summary |
|---|---|
| protected File sshDir | |
| TEST_USER | back to summary |
|---|---|
| protected static final String TEST_USER | |
| testPort | back to summary |
|---|---|
| protected int testPort | |
| SshTestHarness | back to summary |
|---|---|
| public SshTestHarness() | |
| cloneWith | back to summary |
|---|---|
| protected File cloneWith(String uri, File to, CredentialsProvider provider, String... config) throws Exception | |
| copyTestResource | back to summary |
|---|---|
| protected void copyTestResource(String resourceName, File to) throws IOException Copies a test data file contained in the test bundle to the given file.
Equivalent to
| |
| copyTestResource | back to summary |
|---|---|
| protected void copyTestResource(Class<?> loader, String resourceName, File to) throws IOException Copies a test data file contained in the test bundle to the given file,
using
| |
| createKeyPair | back to summary |
|---|---|
| private static File createKeyPair(KeyPair newKey, File privateKeyFile) throws Exception | |
| createKnownHostsFile | back to summary |
|---|---|
| protected static String createKnownHostsFile(File file, String host, int port, File publicKey) throws IOException Creates a new known_hosts file with one entry for the given host and port taken from the given public key file.
| |
| createSessionFactory | back to summary |
|---|---|
| protected abstract SshSessionFactory createSessionFactory() | |
| getSessionFactory | back to summary |
|---|---|
| protected SshSessionFactory getSessionFactory() | |
| hasHostKey | back to summary |
|---|---|
| protected boolean hasHostKey(String host, int port, String keyPart, List<String> lines) Checks whether there is a line for the given host and port that also matches the given key part in the list of lines. | |
| installConfig | back to summary |
|---|---|
| protected abstract void installConfig(String... config) | |
| pushTo | back to summary |
|---|---|
| protected void pushTo(File localClone) throws Exception | |
| pushTo | back to summary |
|---|---|
| protected void pushTo(CredentialsProvider provider, File localClone) throws Exception | |
| setUp | back to summary |
|---|---|
| public void setUp() throws Exception Overrides org. Doc from org. Setup test | |
| shutdownServer | back to summary |
|---|---|
public void shutdownServer() throws Exception
| |
| write | back to summary |
|---|---|
| private static void write(BufferedWriter out, byte[] bytes, int lineLength) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private URIish |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public List | |
| public URIish |
| items | back to summary |
|---|---|
| private List<CredentialItem> items | |
| uri | back to summary |
|---|---|
| private URIish uri | |
| LogEntry | back to summary |
|---|---|
| public LogEntry(URIish uri, List<CredentialItem> items) | |
| getItems | back to summary |
|---|---|
| public List | |
| getURIish | back to summary |
|---|---|
| public URIish getURIish() | |
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private final Iterator | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | get(URIish
the URI of the remote resource that needs authentication. uri, CredentialItem... the items the application requires to complete authentication. items)Implements abstract org. Ask for the credential items to be populated. |
| public List | |
| public boolean | isInteractive()
Implements abstract org. Check if the provider is interactive with the end-user. |
| private void | |
| public boolean | supports(CredentialItem...
the items the application requires to complete authentication. items)Implements abstract org. Check if the provider can supply the necessary
|
| log | back to summary |
|---|---|
| private List<SshTestHarness. | |
| strings | back to summary |
|---|---|
| private final Iterator<String> strings | |
| stringStore | back to summary |
|---|---|
| private final List<String> stringStore | |
| TestCredentialsProvider | back to summary |
|---|---|
| public TestCredentialsProvider(String... strings) | |
| get | back to summary |
|---|---|
| public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem Implements abstract org. Doc from org. Ask for the credential items to be populated.
| |
| getLog | back to summary |
|---|---|
| public List | |
| isInteractive | back to summary |
|---|---|
| public boolean isInteractive() Implements abstract org. Doc from org. Check if the provider is interactive with the end-user. An interactive provider may try to open a dialog box, or prompt for input on the terminal, and will wait for a user response. A non-interactive provider will either populate CredentialItems, or fail.
| |
| logItems | back to summary |
|---|---|
| private void logItems(URIish uri, CredentialItem... items) | |
| supports | back to summary |
|---|---|
| public boolean supports(CredentialItem... items) Implements abstract org. Doc from org. Check if the provider can supply the necessary
| |