Skip to content

Commit

Permalink
fix wrong dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Parisa68 committed Dec 9, 2024
1 parent 1ca7d38 commit bec1414
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
POSTGRES_PASSWORD: rootpasswd
OPENID_CONFIGURATION_URL: http://localhost:8000/openid-configuration
USERINFO_ENDPOINT_URL: http://localhost:8000/userinfo
CRYPT4GH_PRIVATE_KEY_PATH: test/crypt4gh/crypt4gh.sec.pem
CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH: test/crypt4gh/crypt4gh.pass
CRYPT4GH_PRIVATE_KEY_PATH: ./test/crypt4gh/crypt4gh.sec.pem
CRYPT4GH_PRIVATE_KEY_PASSWORD_PATH: ./test/crypt4gh/crypt4gh.pass
BROKER_USERNAME: guest

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ void testStreamingValidTokenValidFileRangePlain() {
@SneakyThrows
@Test
void testStreamingValidTokenValidFileFullEncrypted() {
String publicKey = Files.readString(new File("test/crypt4gh/crypt4gh.pub.pem").toPath());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("test/crypt4gh/crypt4gh.sec.pem"), "password".toCharArray());
String publicKey = Files.readString(new File("./test/crypt4gh/crypt4gh.pub.pem").toPath());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("./test/crypt4gh/crypt4gh.sec.pem"), "password".toCharArray());
HttpResponse<byte[]> response = Unirest.get("http://localhost:8080/files/EGAF00000000014?destinationFormat=crypt4gh").header(HttpHeaders.AUTHORIZATION, "Bearer " + validToken).header("Public-Key", publicKey).asBytes();
int status = response.getStatus();
Assertions.assertEquals(HttpStatus.OK.value(), status);
Expand All @@ -196,8 +196,8 @@ void testStreamingValidTokenValidFileFullEncrypted() {
@SneakyThrows
@Test
void testStreamingValidTokenValidFileRangeEncrypted() {
String publicKey = Files.readString(new File("test/crypt4gh/crypt4gh.pub.pem").toPath());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("test/crypt4gh/crypt4gh.sec.pem"), "password".toCharArray());
String publicKey = Files.readString(new File("./test/crypt4gh/crypt4gh.pub.pem").toPath());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("./test/crypt4gh/crypt4gh.sec.pem"), "password".toCharArray());
HttpResponse<byte[]> response = Unirest.get("http://localhost:8080/files/EGAF00000000014?startCoordinate=100&endCoordinate=200&destinationFormat=crypt4gh").header(HttpHeaders.AUTHORIZATION, "Bearer " + validToken).header("Public-Key", publicKey).asBytes();
int status = response.getStatus();
Assertions.assertEquals(HttpStatus.OK.value(), status);
Expand All @@ -216,7 +216,7 @@ void testPOSIXExportRequestFileValidToken() {
return;
}
export("EGAF00000000014", false);
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("./test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
try (InputStream byteArrayInputStream = new FileInputStream("[email protected]/files/body.enc");
Crypt4GHInputStream crypt4GHInputStream = new Crypt4GHInputStream(byteArrayInputStream, privateKey)) {
byte[] bytes = IOUtils.toByteArray(crypt4GHInputStream);
Expand All @@ -232,7 +232,7 @@ void testPOSIXExportRequestDatasetValidToken() {
return;
}
export("EGAD00010000919", true);
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("./test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
try (InputStream byteArrayInputStream = new FileInputStream("[email protected]/files/body.enc");
Crypt4GHInputStream crypt4GHInputStream = new Crypt4GHInputStream(byteArrayInputStream, privateKey)) {
byte[] bytes = IOUtils.toByteArray(crypt4GHInputStream);
Expand All @@ -248,7 +248,7 @@ void testS3ExportRequestFileValidToken() {
return;
}
export("EGAF00000000014", false);
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("./test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
try (InputStream byteArrayInputStream = getMinioClient().getObject(GetObjectArgs.builder().bucket("lega").object("[email protected]/body.enc").build());
Crypt4GHInputStream crypt4GHInputStream = new Crypt4GHInputStream(byteArrayInputStream, privateKey)) {
byte[] bytes = IOUtils.toByteArray(crypt4GHInputStream);
Expand All @@ -264,7 +264,7 @@ void testS3ExportRequestDatasetValidToken() {
return;
}
export("EGAD00010000919", true);
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("test/crypt4ghmy.sec.pem"), "passw0rd".toCharArray());
PrivateKey privateKey = KeyUtils.getInstance().readPrivateKey(new File("./test/crypt4gh/my.sec.pem"), "passw0rd".toCharArray());
try (InputStream byteArrayInputStream = getMinioClient().getObject(GetObjectArgs.builder().bucket("lega").object("[email protected]/body.enc").build());
Crypt4GHInputStream crypt4GHInputStream = new Crypt4GHInputStream(byteArrayInputStream, privateKey)) {
byte[] bytes = IOUtils.toByteArray(crypt4GHInputStream);
Expand Down Expand Up @@ -295,7 +295,7 @@ void export(String id, boolean dataset) {
validToken,
dataset ? "datasetId" : "fileId",
id,
FileUtils.readFileToString(new File("test/crypt4gh/my.pub.pem"), Charset.defaultCharset()));
FileUtils.readFileToString(new File("./test/crypt4gh/my.pub.pem"), Charset.defaultCharset()));
channel.basicPublish("",
"exportRequests",
properties,
Expand Down

0 comments on commit bec1414

Please sign in to comment.