From a6e55710ba604063af2fe16c394c3dba4d22b1e3 Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Thu, 19 Oct 2023 14:34:17 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Fixes=20typos=20=F0=9F=91=A9=E2=80=8D?= =?UTF-8?q?=F0=9F=8F=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- src/main/java/ninja/Aws4HashCalculator.java | 2 +- src/main/java/ninja/SignedChunkHandler.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 844049f..b2fb7bc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ See https://s3ninja.net for more details. ## Contributions -Contributions as issues or pull requests are always welcome. Please [sign-off](https://developercertificate.org) +Contributions as issues or pull requests are always welcome. Please [sign off](https://developercertificate.org) all your commits by adding a line like "Signed-off-by: Name " at the end of each commit, indicating that you wrote the code and have the right to pass it on as an open source diff --git a/src/main/java/ninja/Aws4HashCalculator.java b/src/main/java/ninja/Aws4HashCalculator.java index 6ed0d98..817e84d 100644 --- a/src/main/java/ninja/Aws4HashCalculator.java +++ b/src/main/java/ninja/Aws4HashCalculator.java @@ -69,7 +69,7 @@ public String computeHash(WebContext webContext, String pathPrefix) throws Excep Matcher matcher = AWS_AUTH4_PATTERN.matcher(webContext.getHeaderValue("Authorization").asString("")); if (!matcher.matches()) { - // If the header doesn't match, let's try an URL parameter as we might be processing a presigned URL + // If the header doesn't match, let's try a URL parameter as we might be processing a presigned URL matcher = X_AMZ_CREDENTIAL_PATTERN.matcher(webContext.get("X-Amz-Credential").asString("")); if (!matcher.matches()) { throw new IllegalArgumentException("Unknown AWS4 auth pattern"); diff --git a/src/main/java/ninja/SignedChunkHandler.java b/src/main/java/ninja/SignedChunkHandler.java index 58bee7e..3c992cf 100644 --- a/src/main/java/ninja/SignedChunkHandler.java +++ b/src/main/java/ninja/SignedChunkHandler.java @@ -36,7 +36,7 @@ public void handle(ByteBuf content, boolean last) throws IOException { } // copy everything into the auxiliary buffer first, and try to pull as many complete chunks as possible from it - // afterwards + // afterward chunkBuffer.writeBytes(content); if (tryToCompleteTransfer()) { drainAndFlush(); From ef76fe83e3319d7be98979b2675b9f5e94dda6ac Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Thu, 19 Oct 2023 14:34:50 +0200 Subject: [PATCH 2/5] =?UTF-8?q?Uses=20HTTPS=20links=20=F0=9F=94=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/templates/footer.html.pasta | 2 +- src/site/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/footer.html.pasta b/src/main/resources/templates/footer.html.pasta index 4b72fca..52b2c2e 100644 --- a/src/main/resources/templates/footer.html.pasta +++ b/src/main/resources/templates/footer.html.pasta @@ -3,7 +3,7 @@
@sirius.kernel.info.Product.getProduct().getName() is made with all the love in the world by - scireum in Remshalden + scireum in Remshalden
diff --git a/src/site/index.html b/src/site/index.html index 6c07d42..75d3a07 100644 --- a/src/site/index.html +++ b/src/site/index.html @@ -127,7 +127,7 @@

S3 ninja


- S3 ninja is made with all the love in the world by scireum in Remshalden
From bab6625717ce8a5ac8316bf31a4c8c5270ec7b9f Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Thu, 19 Oct 2023 14:35:21 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Applies=20code=20inspection=20suggestions?= =?UTF-8?q?=20=F0=9F=8F=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ninja/AwsLegacyHashCalculator.java | 2 +- src/main/java/ninja/S3Dispatcher.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ninja/AwsLegacyHashCalculator.java b/src/main/java/ninja/AwsLegacyHashCalculator.java index 1f35f04..a8fab77 100644 --- a/src/main/java/ninja/AwsLegacyHashCalculator.java +++ b/src/main/java/ninja/AwsLegacyHashCalculator.java @@ -117,7 +117,7 @@ public String computeHash(WebContext webContext, String pathPrefix) throws Excep SecretKeySpec keySpec = new SecretKeySpec(storage.getAwsSecretKey().getBytes(), "HmacSHA1"); Mac mac = Mac.getInstance("HmacSHA1"); mac.init(keySpec); - byte[] result = mac.doFinal(stringToSign.toString().getBytes(StandardCharsets.UTF_8.name())); + byte[] result = mac.doFinal(stringToSign.toString().getBytes(StandardCharsets.UTF_8)); return Base64.getEncoder().encodeToString(result); } diff --git a/src/main/java/ninja/S3Dispatcher.java b/src/main/java/ninja/S3Dispatcher.java index 1065f72..993d41d 100644 --- a/src/main/java/ninja/S3Dispatcher.java +++ b/src/main/java/ninja/S3Dispatcher.java @@ -58,7 +58,6 @@ import java.time.format.DateTimeFormatterBuilder; import java.util.Base64; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -1037,7 +1036,7 @@ private void completeMultipartUpload(WebContext webContext, uploadId, parts.entrySet() .stream() - .sorted(Comparator.comparing(Map.Entry::getKey)) + .sorted(Map.Entry.comparingByKey()) .map(Map.Entry::getValue) .toList()); From 8ee5498cde5820d415638210691540b06af6654f Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Thu, 19 Oct 2023 14:35:40 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Removes=20unused=20import=20=F0=9F=97=91?= =?UTF-8?q?=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ninja/APILog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/ninja/APILog.java b/src/main/java/ninja/APILog.java index 864fdb7..8995618 100644 --- a/src/main/java/ninja/APILog.java +++ b/src/main/java/ninja/APILog.java @@ -11,7 +11,6 @@ import com.google.common.collect.Lists; import sirius.kernel.commons.Watch; import sirius.kernel.di.std.Register; -import sirius.kernel.nls.NLS; import java.time.LocalDateTime; import java.util.Iterator; From 05e99594e01a9b54bc8641eacbae7f55f4aa37d2 Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Thu, 19 Oct 2023 14:39:23 +0200 Subject: [PATCH 5/5] =?UTF-8?q?Removes=20redundant=20`throws`=20clause=20?= =?UTF-8?q?=F0=9F=A7=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/ninja/ListFileTreeVisitor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ninja/ListFileTreeVisitor.java b/src/main/java/ninja/ListFileTreeVisitor.java index b60186f..7048575 100644 --- a/src/main/java/ninja/ListFileTreeVisitor.java +++ b/src/main/java/ninja/ListFileTreeVisitor.java @@ -53,7 +53,7 @@ protected ListFileTreeVisitor(XMLStructuredOutput output, } @Override - public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { + public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) { File file = path.toFile(); String name = StoredObject.decodeKey(file.getName());