Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
io.github.ricall.junit5-sftp:junit5-sftp
Advanced tools
A JUnit 5 extension library that allows you to fake a SFTP server.
This JUnit 5 libary provides a way to create a sftp server that can be used for integration testing.
Add the dependency to gradle
testImplementation 'io.github.ricall.junit5-sftp:junit5-sftp:2.0.1'
Add the dependency to mvn pom.xml
<dependency>
<groupId>io.github.ricall.junit5-sftp</groupId>
<artifactId>junit5-sftp</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>
JUnit5
extensionpublic class TestEmbeddedSftpServer {
@RegisterExtension
public final EmbeddedSftpServer sftpServer = SftpServer.defaultSftpServer()
.withPort(3022)
.withUser("user", "pass")
.withResources(resourceAt("/tmp/data").fromClasspathResource("/data"))
.build();
@Test
public void verifySftpFilesCanBeDownloaded() {
// sftp server is running on sftp://user:pass@localhost:3022
// the files and directories from the data package are copied into the /tmp/data folder
// on the sftp server
}
}
The FTP server uses an in-memory FileSystem to manage files, between tests the file system is recreated so that tests do not impact each other.
FileSystemResource
abstraction.@SftpEmbeddableServerExtension
provides a powerful FileSystemResource
abstraction that allows you to populate the
in-memory FileSystem with files/folders in a simple easy to use fashion.
withText
Return a FileSystemResource
that will populate the /tmp/file1.txt
file with File Contents
FileSystemResource.resourceAt("/tmp/file1.txt").withText("File Contents")
withContent
Return a FileSystemResource
that will populate the /tmp/file2.txt
file with the data returned from
createFileInputStream()
FileSystemResource.resourceAt("/tmp/file2.txt").withContent(this::createFileInputStream)
fromClasspathResource
Return a list of FileSystemResource
's that will populate the /tmp/test-data
folder with all files/directories under
the test.data
package.
FileSystemResource.resourceAt("/tmp/test-data").fromClasspathResource("/test/data")
fromPath
Return a list of FileSystemResource
's that will populate the /tmp/folder
folder with all the files/directories
under path
(path can be files/folders on your hard drive, files/folders in a ZIP/TAR container or event files/folders
in another in-memory filesystem)
FileSystemResource.resourceAt("/tmp/folder").fromPath(path)
This software is licensed using MIT
FAQs
Unknown package
We found that io.github.ricall.junit5-sftp:junit5-sftp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.