-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH key support #16
Comments
I know it's a little old (and using junit4) but I find a way to use a public key: download the source (only one file) from the git and add to 'startServer' after 'setPort':
of course, add private Path hostKeyPath = null in the variables and a setter:
|
@Assafkalfa I do not remember how the code under test was working but the test was implemented quite simply (based on the code in PR #15 : @Rule
public final FakeSftpServerRule sftpServer = new FakeSftpServerRule();
@Test
public void should_send_file() throws Exception {
// add identity
Path authorizedKeysPath = Paths.get(FtrServiceTest.class.getResource("/unit-test-user.pub").toURI());
sftpServer.addIdentity("jon.snow", authorizedKeysPath);
// call code under test
//check
assertTrue("remote file not found", sftpServer.existsFile("/666_myfile.txt"));
} It was a one time usage so I cannot help you on other usage of this component. |
The rule is working fine but I'd like to use it also with an identity file.
Would you mind a PR on this topic?
The aim is to support authentication via an SSH public/private key pair.
If it's ok for you then there is already an implementation in #15
The text was updated successfully, but these errors were encountered: