VaishKumbhar opened a new pull request, #754:
URL: https://github.com/apache/commons-vfs/pull/754

   ## What
   Adds `SftpPasswordAuthTest`  — new test class that verify SFTP password 
authentication via `StaticUserAuthenticator` in Commons VFS2.
   
   ## Why
   There is no dedicated test for SFTP password-based authentication. The 
existing `SftpProviderTest` relies on `SftpTestServerHelper` which accepts 
`username == password` and also allows `UserAuthNone`, so it does not 
specifically validate that `StaticUserAuthenticator` credentials are correctly 
propagated through the VFS2 SFTP provider.
   
   ## How
   - Each test spins up an inline embedded SSHD 0.8.0 server with a strict 
`PasswordAuthenticator` that only accepts a specific username/password pair.
   - The server uses an explicit RSA 2048-bit host key instead of the SSHD 
0.8.0 default DSA key, which is incompatible with Java 17+ (disabled legacy 
crypto algorithms).
   - Server teardown uses a daemon thread with a 5-second timeout to prevent 
JVM hangs caused by SSHD 0.8.0 lingering sessions after failed authentication.
   - Tests verify: resolving files, resolving folders (with and without 
trailing slash), and that wrong credentials produce a `FileSystemException`.
   
   ## Test summary
   | Test | Description |
   |------|-------------|
   | `testResolveFile` | Connects with correct credentials, resolves a file, 
asserts it exists and is readable |
   | `testResolveFolder` | Connects with correct credentials, resolves a 
directory |
   | `testResolveFolderWithTrailingSlash` | Same as above with trailing slash 
in URI |
   | `testWrongCredentialsThrowsException` | Connects with wrong credentials, 
asserts `FileSystemException` is thrown |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to