Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #106 from neicnordic/feature/update-sshd2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Titov authored Jan 14, 2021
2 parents 77c5bd4 + 05ae3cc commit 201b83c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

<dependencies>
<dependency>
<groupId>net.i2p.crypto</groupId>
<artifactId>eddsa</artifactId>
<version>0.3.0</version>
<groupId>org.c02e.jpgpj</groupId>
<artifactId>jpgpj</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-sftp</artifactId>
<version>2.5.1</version>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -131,7 +131,7 @@
</dependency>
<dependency>
<groupId>io.findify</groupId>
<artifactId>s3mock_2.12</artifactId>
<artifactId>s3mock_2.13</artifactId>
<version>0.2.6</version>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/se/nbis/lega/inbox/pojo/KeyAlgorithm.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
*/
public enum KeyAlgorithm {

RSA, DSS, ED25519
RSA, ED25519

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -124,7 +124,7 @@ public void linked(ServerSession session, Path source, Path target, boolean symL
*/
@Override
public void modifiedAttributes(ServerSession session, Path path, Map<String, ?> attrs, Throwable thrown) {
log.info("User {} modified attributes of {}: ", session.getUsername(), path, attrs);
log.info("User {} modified attributes of {} {}: ", session.getUsername(), path, attrs);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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());
}
Expand Down
12 changes: 0 additions & 12 deletions src/test/resources/dss.sec

This file was deleted.

1 change: 0 additions & 1 deletion src/test/resources/dss.ssh

This file was deleted.

0 comments on commit 201b83c

Please sign in to comment.