diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb4e0af..a3e5499 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,14 +14,14 @@ jobs: steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up JDK 13 uses: actions/setup-java@v1 with: java-version: 13 - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/pom.xml b/pom.xml index d679c4e..fc96cf2 100644 --- a/pom.xml +++ b/pom.xml @@ -26,9 +26,9 @@ - net.i2p.crypto - eddsa - 0.3.0 + org.c02e.jpgpj + jpgpj + 1.0 org.springframework.boot @@ -75,7 +75,7 @@ org.apache.sshd sshd-sftp - 2.5.1 + 2.6.0 commons-io @@ -131,7 +131,7 @@ io.findify - s3mock_2.12 + s3mock_2.13 0.2.6 test diff --git a/src/main/java/se/nbis/lega/inbox/configuration/SFTPConfiguration.java b/src/main/java/se/nbis/lega/inbox/configuration/SFTPConfiguration.java index e64f535..0c816b3 100644 --- a/src/main/java/se/nbis/lega/inbox/configuration/SFTPConfiguration.java +++ b/src/main/java/se/nbis/lega/inbox/configuration/SFTPConfiguration.java @@ -9,8 +9,8 @@ import org.apache.sshd.server.auth.pubkey.PublickeyAuthenticator; import org.apache.sshd.server.auth.pubkey.UserAuthPublicKeyFactory; import org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider; -import org.apache.sshd.server.subsystem.sftp.SftpEventListener; -import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory; +import org.apache.sshd.sftp.server.SftpEventListener; +import org.apache.sshd.sftp.server.SftpSubsystemFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/se/nbis/lega/inbox/pojo/KeyAlgorithm.java b/src/main/java/se/nbis/lega/inbox/pojo/KeyAlgorithm.java index 8c7419c..387c222 100644 --- a/src/main/java/se/nbis/lega/inbox/pojo/KeyAlgorithm.java +++ b/src/main/java/se/nbis/lega/inbox/pojo/KeyAlgorithm.java @@ -5,6 +5,6 @@ */ public enum KeyAlgorithm { - RSA, DSS, ED25519 + RSA, ED25519 } diff --git a/src/main/java/se/nbis/lega/inbox/s3/S3SftpEventListener.java b/src/main/java/se/nbis/lega/inbox/s3/S3SftpEventListener.java index 2f5338b..cedc4e1 100644 --- a/src/main/java/se/nbis/lega/inbox/s3/S3SftpEventListener.java +++ b/src/main/java/se/nbis/lega/inbox/s3/S3SftpEventListener.java @@ -2,7 +2,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.sshd.server.session.ServerSession; -import org.apache.sshd.server.subsystem.sftp.Handle; +import org.apache.sshd.sftp.server.Handle; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.stereotype.Component; diff --git a/src/main/java/se/nbis/lega/inbox/sftp/InboxSftpEventListener.java b/src/main/java/se/nbis/lega/inbox/sftp/InboxSftpEventListener.java index 3bafc72..586fa76 100644 --- a/src/main/java/se/nbis/lega/inbox/sftp/InboxSftpEventListener.java +++ b/src/main/java/se/nbis/lega/inbox/sftp/InboxSftpEventListener.java @@ -7,9 +7,9 @@ import org.apache.commons.io.FilenameUtils; import org.apache.http.entity.ContentType; import org.apache.sshd.server.session.ServerSession; -import org.apache.sshd.server.subsystem.sftp.FileHandle; -import org.apache.sshd.server.subsystem.sftp.Handle; -import org.apache.sshd.server.subsystem.sftp.SftpEventListener; +import org.apache.sshd.sftp.server.FileHandle; +import org.apache.sshd.sftp.server.Handle; +import org.apache.sshd.sftp.server.SftpEventListener; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -124,7 +124,7 @@ public void linked(ServerSession session, Path source, Path target, boolean symL */ @Override public void modifiedAttributes(ServerSession session, Path path, Map attrs, Throwable thrown) { - log.info("User {} modified attributes of {}: ", session.getUsername(), path, attrs); + log.info("User {} modified attributes of {} {}: ", session.getUsername(), path, attrs); } /** diff --git a/src/test/java/se/nbis/lega/inbox/sftp/InboxAuthenticatorTest.java b/src/test/java/se/nbis/lega/inbox/sftp/InboxAuthenticatorTest.java index b0637f6..f818e45 100644 --- a/src/test/java/se/nbis/lega/inbox/sftp/InboxAuthenticatorTest.java +++ b/src/test/java/se/nbis/lega/inbox/sftp/InboxAuthenticatorTest.java @@ -81,15 +81,6 @@ public void authenticatePublicKeyRSA() throws IOException, URISyntaxException { assertNotNull(ssh.newSFTPClient()); } - @Test - public void authenticatePublicKeyDSS() throws IOException, URISyntaxException { - mockCEGAEndpoint(username, password, PasswordHashingAlgorithm.BLOWFISH, KeyAlgorithm.DSS, HttpStatus.OK); - ClassLoader classloader = Thread.currentThread().getContextClassLoader(); - File privateKey = new File(classloader.getResource(KeyAlgorithm.DSS.name().toLowerCase() + ".sec").toURI()); - ssh.authPublickey(username, privateKey.getPath()); - assertNotNull(ssh.newSFTPClient()); - } - @Test public void authenticatePublicKeyED25519() throws IOException, URISyntaxException { mockCEGAEndpoint(username, password, PasswordHashingAlgorithm.BLOWFISH, KeyAlgorithm.ED25519, HttpStatus.OK); @@ -103,7 +94,7 @@ public void authenticatePublicKeyED25519() throws IOException, URISyntaxExceptio public void authenticatePublicKeyFail() throws IOException, URISyntaxException { mockCEGAEndpoint(username, password, PasswordHashingAlgorithm.BLOWFISH, KeyAlgorithm.RSA, HttpStatus.OK); ClassLoader classloader = Thread.currentThread().getContextClassLoader(); - File privateKey = new File(classloader.getResource("dss.sec").toURI()); + File privateKey = new File(classloader.getResource("rsa.sec").toURI()); ssh.authPublickey(username, privateKey.getPath()); assertNotNull(ssh.newSFTPClient()); } diff --git a/src/test/resources/dss.sec b/src/test/resources/dss.sec deleted file mode 100644 index b29c637..0000000 --- a/src/test/resources/dss.sec +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -MIIBuwIBAAKBgQDLHZq04FbrOBMh0IXpShKC1bSb21PAwsQuKA1cueFH1vA/ZiTU -z0MLs8Banl3RL/Za/u+Hwp4nuUMDpCA7KU5wGLOUcZOmUnvcm7x7BjhxVGiTMI2Z -VhkQVGJd6Tptv1TEzviu2BlcpcvyQ9B9drludf9AUo3P0n7XJdwKhLW28wIVAIP6 -IU6C8CGyGevAN3tGSWsgUhZjAoGBALz2FGacbQqm/mI+38va4qT/ZvkF3XbXngFT -rSI9XF1ym6iFBuNtCMQRdIaKQGbNfw7XWTz++HIlOvqPybKBbuAVdDoLtoqWETwa -VdS0K7QQBa+M7+cJhRQGaukPkqYS7mCBNcceuNiwR8ANnuyp/+abVSN5DbTfUOFN -fws6q5luAoGAERwINHXDi4q42dsxcA59CsWQdefjSU1INa8gREaEdPjclZG8+1z+ -3n+TePR5sin2rpGLfNZYUeR0eC94z0puwqf53wmf2FCzaFV1Gfy149RjAwkHKGmO -G0eldkDNd9ZIl008THC+zbeidl9nB723Vk6aJWJWyOZvKY4e3TbZuMECFA+SkHp4 -EX8OviXE6waqQ5BZU2GV ------END DSA PRIVATE KEY----- diff --git a/src/test/resources/dss.ssh b/src/test/resources/dss.ssh deleted file mode 100644 index 7d083fc..0000000 --- a/src/test/resources/dss.ssh +++ /dev/null @@ -1 +0,0 @@ -ssh-dss AAAAB3NzaC1kc3MAAACBAMsdmrTgVus4EyHQhelKEoLVtJvbU8DCxC4oDVy54UfW8D9mJNTPQwuzwFqeXdEv9lr+74fCnie5QwOkIDspTnAYs5Rxk6ZSe9ybvHsGOHFUaJMwjZlWGRBUYl3pOm2/VMTO+K7YGVyly/JD0H12uW51/0BSjc/Sftcl3AqEtbbzAAAAFQCD+iFOgvAhshnrwDd7RklrIFIWYwAAAIEAvPYUZpxtCqb+Yj7fy9ripP9m+QXddteeAVOtIj1cXXKbqIUG420IxBF0hopAZs1/DtdZPP74ciU6+o/JsoFu4BV0Ogu2ipYRPBpV1LQrtBAFr4zv5wmFFAZq6Q+SphLuYIE1xx642LBHwA2e7Kn/5ptVI3kNtN9Q4U1/CzqrmW4AAACAERwINHXDi4q42dsxcA59CsWQdefjSU1INa8gREaEdPjclZG8+1z+3n+TePR5sin2rpGLfNZYUeR0eC94z0puwqf53wmf2FCzaFV1Gfy149RjAwkHKGmOG0eldkDNd9ZIl008THC+zbeidl9nB723Vk6aJWJWyOZvKY4e3TbZuME=