diff --git a/pom.xml b/pom.xml index 99df970a..fcbe4e2a 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 3.6.2 0.8.15 - 3.10.3 + 3.10.4 3.16.0 3.5.0 3.2.0 diff --git a/src/main/java/land/oras/auth/HttpClient.java b/src/main/java/land/oras/auth/HttpClient.java index 0cf862ec..aebce014 100644 --- a/src/main/java/land/oras/auth/HttpClient.java +++ b/src/main/java/land/oras/auth/HttpClient.java @@ -718,13 +718,12 @@ private ResponseWrapper executeRequest( // Scopes are invariant across retries — compute once. ContainerRef containerRef = scopes.getContainerRef(); LOG.debug("Scopes are adding registry scopes"); - Scopes newScopes = - switch (method) { - case "GET", "HEAD" -> scopes.withAddedRegistryScopes(Scope.PULL); - case "POST", "PUT", "PATCH" -> scopes.withAddedRegistryScopes(Scope.PUSH); - case "DELETE" -> scopes.withAddedRegistryScopes(Scope.DELETE); - default -> throw new OrasException("Unsupported HTTP method: " + method); - }; + Scopes newScopes = switch (method) { + case "GET", "HEAD" -> scopes.withAddedRegistryScopes(Scope.PULL); + case "POST", "PUT", "PATCH" -> scopes.withAddedRegistryScopes(Scope.PUSH); + case "DELETE" -> scopes.withAddedRegistryScopes(Scope.DELETE); + default -> throw new OrasException("Unsupported HTTP method: " + method); + }; newScopes = newScopes.withIdentity(authProvider.getIdentity(containerRef)); LOG.debug("Existing scopes: {}", scopes.getScopes()); LOG.debug("New scopes: {}", newScopes.getScopes()); diff --git a/src/main/java/land/oras/policy/SigstoreVerifier.java b/src/main/java/land/oras/policy/SigstoreVerifier.java index adc6a8dd..936744ce 100644 --- a/src/main/java/land/oras/policy/SigstoreVerifier.java +++ b/src/main/java/land/oras/policy/SigstoreVerifier.java @@ -214,11 +214,10 @@ private static boolean digestMatches(byte[] payload, String imageDigest) { */ private static boolean verifySignature(PublicKey key, byte[] content, byte[] signature) { // Might support other algorithm in the future - String algorithm = - switch (key.getAlgorithm()) { - case Const.KEY_EC_ALGORITHM -> Const.KEY_SHA256_ECDSA_SIGNATURE_ALGORITHM; - default -> null; - }; + String algorithm = switch (key.getAlgorithm()) { + case Const.KEY_EC_ALGORITHM -> Const.KEY_SHA256_ECDSA_SIGNATURE_ALGORITHM; + default -> null; + }; if (algorithm == null) { LOG.warn("Unsupported public key algorithm for Sigstore verification: {}", key.getAlgorithm()); return false;