From 9682a840ad487fc65eb7b6150e8d7a77fb87b9dd Mon Sep 17 00:00:00 2001 From: Stephen Crawford Date: Wed, 21 Dec 2022 11:07:29 -0500 Subject: [PATCH] Spotless apply Jenkins fix Signed-off-by: Stephen Crawford --- .../src/main/java/org/opensearch/authn/jwt/JwtVerifier.java | 4 +--- .../org/opensearch/authn/AuthenticationTokenHandlerTests.java | 1 - .../test/java/org/opensearch/identity/BearerAuthTests.java | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sandbox/libs/authn/src/main/java/org/opensearch/authn/jwt/JwtVerifier.java b/sandbox/libs/authn/src/main/java/org/opensearch/authn/jwt/JwtVerifier.java index d09646934380f..162c15362e4e7 100644 --- a/sandbox/libs/authn/src/main/java/org/opensearch/authn/jwt/JwtVerifier.java +++ b/sandbox/libs/authn/src/main/java/org/opensearch/authn/jwt/JwtVerifier.java @@ -68,9 +68,7 @@ private static void validateSignatureAlgorithm(JsonWebKey key, JwtToken jwt) thr SignatureAlgorithm tokenAlgorithm = SignatureAlgorithm.getAlgorithm(jwt.getJwsHeaders().getAlgorithm()); if (!keyAlgorithm.equals(tokenAlgorithm)) { - throw new RuntimeException( - "Algorithm of JWT does not match algorithm of JWK (" + keyAlgorithm + " != " + tokenAlgorithm + ")" - ); + throw new RuntimeException("Algorithm of JWT does not match algorithm of JWK (" + keyAlgorithm + " != " + tokenAlgorithm + ")"); } } diff --git a/sandbox/libs/authn/src/test/java/org/opensearch/authn/AuthenticationTokenHandlerTests.java b/sandbox/libs/authn/src/test/java/org/opensearch/authn/AuthenticationTokenHandlerTests.java index dad0a4fa245ad..a92521ad2fb4a 100644 --- a/sandbox/libs/authn/src/test/java/org/opensearch/authn/AuthenticationTokenHandlerTests.java +++ b/sandbox/libs/authn/src/test/java/org/opensearch/authn/AuthenticationTokenHandlerTests.java @@ -62,4 +62,3 @@ public void testShouldReturnNullWhenExtractingNullToken() throws RuntimeExceptio MatcherAssert.assertThat(shiroAuthToken, nullValue()); } } - diff --git a/sandbox/modules/identity/src/test/java/org/opensearch/identity/BearerAuthTests.java b/sandbox/modules/identity/src/test/java/org/opensearch/identity/BearerAuthTests.java index cb4722165f635..a3570ce03589b 100644 --- a/sandbox/modules/identity/src/test/java/org/opensearch/identity/BearerAuthTests.java +++ b/sandbox/modules/identity/src/test/java/org/opensearch/identity/BearerAuthTests.java @@ -143,7 +143,7 @@ public void testClusterHealthWithInvalidBearerAuthenticationHeader() throws IOEx request.setOptions(options); Response response = OpenSearchRestTestCase.client().performRequest(request); // Should be unauthorized because created with a different signing algorithm - // Current implementation allows a unauthorized request to pass + // Current implementation allows a unauthorized request to pass try { OpenSearchRestTestCase.client().performRequest(request); } catch (ResponseException e) {