From 47c5d46efb5eeeb43b969ed773724b411edbefe1 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Sun, 19 Jan 2025 10:33:36 -0500 Subject: [PATCH] Update Jackson to 2.18.2 --- parent/pom.xml | 4 +-- .../security/jose/jwejws/JAXRSJweJwsTest.java | 12 ++------ .../jose/jwejws/JAXRSJwsJsonTest.java | 7 ++--- .../jose/jwejws/JweJwsAlgorithmTest.java | 29 ++----------------- .../jose/jwejws/JweJwsReferenceTest.java | 11 ------- .../jose/jwejws/JwsHTTPHeaderTest.java | 7 ----- .../security/jose/jwt/JWTAlgorithmTest.java | 20 ------------- .../security/jose/jwt/JWTAuthnAuthzTest.java | 18 ------------ .../security/jose/jwt/JWTPropertiesTest.java | 12 -------- .../jaxrs/security/jose/jwejws/server.xml | 5 ---- .../security/jose/jwejws/serverJwsJson.xml | 3 -- 11 files changed, 9 insertions(+), 119 deletions(-) diff --git a/parent/pom.xml b/parent/pom.xml index 237d0acbd8a..38c2b433958 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -131,8 +131,8 @@ 4.4.16 5.3.1 5.2.5 - 2.17.2 - 2.17.2 + 2.18.2 + 2.18.2 3.9 1.8.1 2.1.3 diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java index 9b3cf2891d0..206d5cb44c0 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java @@ -20,13 +20,10 @@ package org.apache.cxf.systest.jaxrs.security.jose.jwejws; import java.net.URL; -import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Properties; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.annotation.Priority; import jakarta.ws.rs.BadRequestException; import org.apache.cxf.Bus; @@ -85,8 +82,7 @@ public void testJweJwkPlainTextRSA() throws Exception { @Test public void testJweJwkBookBeanRSA() throws Exception { String address = "https://localhost:" + PORT + "/jwejwkrsa"; - BookStore bs = createJweBookStore(address, - Collections.singletonList(new JacksonJsonProvider())); + BookStore bs = createJweBookStore(address, List.of()); Book book = bs.echoBook(new Book("book", 123L)); assertEquals("book", book.getName()); assertEquals(123L, book.getId()); @@ -265,8 +261,7 @@ public void testJweRsaJwsBookHMac() throws Exception { String address = "https://localhost:" + PORT + "/jwejwshmac"; HmacJwsSignatureProvider hmacProvider = new HmacJwsSignatureProvider(ENCODED_MAC_KEY, SignatureAlgorithm.HS256); - BookStore bs = createJweJwsBookStore(address, hmacProvider, - Collections.singletonList(new JacksonJsonProvider())); + BookStore bs = createJweJwsBookStore(address, hmacProvider, List.of()); Book book = bs.echoBook(new Book("book", 123L)); assertEquals("book", book.getName()); assertEquals(123L, book.getId()); @@ -303,8 +298,7 @@ public void testJwsJwkPlainTextHMacUnencoded() throws Exception { @Test public void testJwsJwkBookHMac() throws Exception { String address = "https://localhost:" + PORT + "/jwsjwkhmac"; - BookStore bs = createJwsBookStore(address, - Collections.singletonList(new JacksonJsonProvider())); + BookStore bs = createJwsBookStore(address, List.of()); Book book = bs.echoBook(new Book("book", 123L)); assertEquals("book", book.getName()); assertEquals(123L, book.getId()); diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java index 215f2c27b90..7e8cda95da3 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJwsJsonTest.java @@ -28,8 +28,6 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.BadRequestException; import org.apache.cxf.Bus; import org.apache.cxf.bus.spring.SpringBusFactory; @@ -86,7 +84,7 @@ public void testJwsJsonBookBeanHmac() throws Exception { String address = "https://localhost:" + PORT + "/jwsjsonhmac"; BookStore bs = createBookStore(address, "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties", - Collections.singletonList(new JacksonJsonProvider())); + List.of()); Book book = bs.echoBook(new Book("book", 123L)); assertEquals("book", book.getName()); assertEquals(123L, book.getId()); @@ -98,8 +96,7 @@ public void testJweCompactJwsJsonBookBeanHmac() throws Exception { return; } String address = "https://localhost:" + PORT + "/jwejwsjsonhmac"; - List extraProviders = Arrays.asList(new JacksonJsonProvider(), - new JweWriterInterceptor(), + List extraProviders = Arrays.asList(new JweWriterInterceptor(), new JweClientResponseFilter()); String jwkStoreProperty = "org/apache/cxf/systest/jaxrs/security/secret.jwk.properties"; Map props = new HashMap<>(); diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsAlgorithmTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsAlgorithmTest.java index fd5255d7138..639e661c3ce 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsAlgorithmTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsAlgorithmTest.java @@ -25,8 +25,6 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.core.Response; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.rs.security.jose.jaxrs.JweWriterInterceptor; @@ -65,7 +63,6 @@ public void testEncryptionProperties() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; @@ -92,7 +89,6 @@ public void testEncryptionDynamic() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; @@ -122,7 +118,6 @@ public void testWrongKeyEncryptionAlgorithm() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; @@ -148,7 +143,6 @@ public void testWrongKeyEncryptionAlgorithmKeyIncluded() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; @@ -178,7 +172,6 @@ public void testWrongContentEncryptionAlgorithm() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; @@ -204,7 +197,6 @@ public void testBadEncryptingKey() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; @@ -230,7 +222,6 @@ public void testSmallEncryptionKeySize() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwesmallkey/bookstore/books"; @@ -257,12 +248,9 @@ public void testManualEncryption() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); - List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); - String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books"; WebClient client = - WebClient.create(address, providers, busFile.toString()); + WebClient.create(address, List.of(), busFile.toString()); client.type("application/json").accept("application/json"); Map properties = new HashMap<>(); @@ -310,7 +298,6 @@ public void testEncryptionPBES() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwepbes/bookstore/books"; @@ -339,7 +326,6 @@ public void testEncryptionPBESDifferentCount() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwepbes/bookstore/books"; @@ -374,7 +360,6 @@ public void testSignatureProperties() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jws/bookstore/books"; @@ -401,7 +386,6 @@ public void testSignatureDynamic() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jws/bookstore/books"; @@ -431,7 +415,6 @@ public void testWrongSignatureAlgorithm() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jws/bookstore/books"; @@ -457,7 +440,6 @@ public void testWrongSignatureAlgorithmKeyIncluded() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jws/bookstore/books"; @@ -484,7 +466,6 @@ public void testBadSigningKey() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jws/bookstore/books"; @@ -511,7 +492,6 @@ public void testSignatureEllipticCurve() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwsec/bookstore/books"; @@ -540,12 +520,9 @@ public void testManualSignature() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); - List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); - String address = "http://localhost:" + PORT + "/jws/bookstore/books"; WebClient client = - WebClient.create(address, providers, busFile.toString()); + WebClient.create(address, List.of(), busFile.toString()); client.type("application/json").accept("application/json"); Map properties = new HashMap<>(); @@ -588,7 +565,6 @@ public void testSmallSignatureKeySize() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwssmallkey/bookstore/books"; @@ -616,7 +592,6 @@ public void testUnsignedTokenFailure() throws Exception { URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwsWriterInterceptor writerInterceptor = new JwsWriterInterceptor(); writerInterceptor.setSignatureProvider(new NoneJwsSignatureProvider()); providers.add(writerInterceptor); diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsReferenceTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsReferenceTest.java index 405742d8ae9..64b855665a2 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsReferenceTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JweJwsReferenceTest.java @@ -25,8 +25,6 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.core.Response; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.rs.security.jose.jaxrs.JweWriterInterceptor; @@ -64,7 +62,6 @@ public void testEncryptionIncludePublicKey() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweincludekey/bookstore/books"; @@ -91,7 +88,6 @@ public void testEncryptionIncludeCert() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books"; @@ -128,7 +124,6 @@ public void testEncryptionIncludeCertNegativeTest() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books"; @@ -158,7 +153,6 @@ public void testEncryptionIncludeCertSha1() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books"; @@ -195,7 +189,6 @@ public void testEncryptionIncludeCertSha1NegativeTest() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JweWriterInterceptor()); String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books"; @@ -229,7 +222,6 @@ public void testSignatureIncludeCert() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwsincludecert/bookstore/books"; @@ -264,7 +256,6 @@ public void testSignatureIncludeCertNegativeTest() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwsincludecert/bookstore/books"; @@ -292,7 +283,6 @@ public void testSignatureIncludeCertSha1() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwsincludecertsha1/bookstore/books"; @@ -328,7 +318,6 @@ public void testSignatureIncludeCertSha1NegativeTest() throws Exception { URL busFile = JweJwsReferenceTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwsWriterInterceptor()); String address = "http://localhost:" + PORT + "/jwsincludecertsha1/bookstore/books"; diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JwsHTTPHeaderTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JwsHTTPHeaderTest.java index 9c4d536b76a..8ba4b1f5316 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JwsHTTPHeaderTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JwsHTTPHeaderTest.java @@ -28,8 +28,6 @@ import java.util.Map; import java.util.Set; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.Response; import org.apache.cxf.interceptor.Fault; @@ -65,7 +63,6 @@ public void testSignHTTPHeaders() throws Exception { URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor(); providers.add(jwsWriterInterceptor); @@ -97,7 +94,6 @@ public void testSpecifyHeadersToSign() throws Exception { URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor(); jwsWriterInterceptor.setProtectHttpHeaders(true); Set headersToSign = new HashSet<>(); @@ -133,7 +129,6 @@ public void testSignAdditionalCustomHeader() throws Exception { URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor(); jwsWriterInterceptor.setProtectHttpHeaders(true); Set headersToSign = new HashSet<>(); @@ -168,7 +163,6 @@ public void testSignCustomHeaderRequired() throws Exception { URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor(); jwsWriterInterceptor.setProtectHttpHeaders(true); providers.add(jwsWriterInterceptor); @@ -208,7 +202,6 @@ public void testSignEmptyCustomHeader() throws Exception { URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor(); jwsWriterInterceptor.setProtectHttpHeaders(true); Set headersToSign = new HashSet<>(); diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAlgorithmTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAlgorithmTest.java index 168cfabe2ce..696ca5b6138 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAlgorithmTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAlgorithmTest.java @@ -27,8 +27,6 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.core.Response; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.rs.security.jose.jaxrs.JwtAuthenticationClientFilter; @@ -66,7 +64,6 @@ public void testEncryptionProperties() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwtAuthenticationClientFilter clientFilter = new JwtAuthenticationClientFilter(); clientFilter.setJwsRequired(false); clientFilter.setJweRequired(true); @@ -106,7 +103,6 @@ public void testEncryptionDynamic() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwtAuthenticationClientFilter clientFilter = new JwtAuthenticationClientFilter(); clientFilter.setJwsRequired(false); clientFilter.setJweRequired(true); @@ -149,7 +145,6 @@ public void testWrongKeyEncryptionAlgorithm() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwtAuthenticationClientFilter clientFilter = new JwtAuthenticationClientFilter(); clientFilter.setJwsRequired(false); clientFilter.setJweRequired(true); @@ -191,7 +186,6 @@ public void testWrongContentEncryptionAlgorithm() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwtAuthenticationClientFilter clientFilter = new JwtAuthenticationClientFilter(); clientFilter.setJwsRequired(false); clientFilter.setJweRequired(true); @@ -234,7 +228,6 @@ public void testBadEncryptingKey() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwtAuthenticationClientFilter clientFilter = new JwtAuthenticationClientFilter(); clientFilter.setJwsRequired(false); clientFilter.setJweRequired(true); @@ -277,7 +270,6 @@ public void testSignatureProperties() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -314,7 +306,6 @@ public void testSignatureDynamic() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -354,7 +345,6 @@ public void testWrongSignatureAlgorithm() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -390,7 +380,6 @@ public void testBadSigningKey() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -427,7 +416,6 @@ public void testSignatureEllipticCurve() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtec/bookstore/books"; @@ -468,7 +456,6 @@ public void testSmallSignatureKeySize() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -506,7 +493,6 @@ public void testUnsignedTokenSuccess() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -542,7 +528,6 @@ public void testUnsignedTokenFailure() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -574,7 +559,6 @@ public void testSignatureEncryptionProperties() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); JwtAuthenticationClientFilter clientFilter = new JwtAuthenticationClientFilter(); clientFilter.setJwsRequired(true); clientFilter.setJweRequired(true); @@ -617,7 +601,6 @@ public void testSignatureCertificateTest() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtincludecert/bookstore/books"; @@ -660,7 +643,6 @@ public void testBadSignatureCertificateTest() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtincludecert/bookstore/books"; @@ -698,7 +680,6 @@ public void testHMACSignature() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/hmacsignedjwt/bookstore/books"; @@ -737,7 +718,6 @@ public void testBadHMACSignature() throws Exception { URL busFile = JWTAlgorithmTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/hmacsignedjwt/bookstore/books"; diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAuthnAuthzTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAuthnAuthzTest.java index 523060c705b..5493f3a579c 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAuthnAuthzTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTAuthnAuthzTest.java @@ -28,8 +28,6 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.core.Response; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.rs.security.jose.jaxrs.JwtAuthenticationClientFilter; @@ -63,7 +61,6 @@ public void testAuthentication() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -103,7 +100,6 @@ public void testAuthenticationFailure() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwt/bookstore/books"; @@ -140,7 +136,6 @@ public void testAuthorization() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/books"; @@ -182,7 +177,6 @@ public void testAuthorizationWithTwoRolesAsList() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/books"; @@ -224,7 +218,6 @@ public void testAuthorizationWithTwoRolesAsString() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/books"; @@ -266,7 +259,6 @@ public void testAuthorizationNoRole() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/books"; @@ -302,7 +294,6 @@ public void testAuthorizationWrongRole() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/books"; @@ -339,7 +330,6 @@ public void testAuthorizationRolesAllowedAnnotation() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthzannotations/bookstore/booksrolesallowed"; @@ -381,7 +371,6 @@ public void testAuthorizationRolesAllowedAnnotationGET() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthzannotations/bookstore/booksrolesallowed"; @@ -423,7 +412,6 @@ public void testAuthorizationRolesAllowedAnnotationHEAD() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthzannotations/bookstore/booksrolesallowed"; @@ -461,7 +449,6 @@ public void testAuthorizationWrongRolesAllowedAnnotation() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthzannotations/bookstore/booksrolesallowed"; @@ -499,7 +486,6 @@ public void testAuthorizationWrongRolesAllowedAnnotationGET() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthzannotations/bookstore/booksrolesallowed"; @@ -537,7 +523,6 @@ public void testAuthorizationWrongRolesAllowedAnnotationHEAD() throws Exception URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthzannotations/bookstore/booksrolesallowed"; @@ -575,7 +560,6 @@ public void testClaimsAuthorization() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/booksclaims"; @@ -619,7 +603,6 @@ public void testClaimsAuthorizationWeakClaims() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/booksclaims"; @@ -658,7 +641,6 @@ public void testClaimsAuthorizationNoClaims() throws Exception { URL busFile = JWTAuthnAuthzTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/signedjwtauthz/bookstore/booksclaims"; diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTPropertiesTest.java b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTPropertiesTest.java index 670c0554605..c62d8d5c141 100644 --- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTPropertiesTest.java +++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwt/JWTPropertiesTest.java @@ -28,8 +28,6 @@ import java.util.List; import java.util.Map; -import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; - import jakarta.ws.rs.core.Response; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.rs.security.jose.jaxrs.JwtAuthenticationClientFilter; @@ -63,7 +61,6 @@ public void testExpiredToken() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -99,7 +96,6 @@ public void testFutureToken() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -134,7 +130,6 @@ public void testNearFutureTokenFailure() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -169,7 +164,6 @@ public void testNearFutureTokenSuccess() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwtnearfuture/bookstore/books"; @@ -204,7 +198,6 @@ public void testNotBeforeFailure() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -240,7 +233,6 @@ public void testNotBeforeSuccess() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwtnearfuture/bookstore/books"; @@ -276,7 +268,6 @@ public void testSetClaimsDirectly() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -307,7 +298,6 @@ public void testBadAudience() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -339,7 +329,6 @@ public void testNoAudience() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; @@ -369,7 +358,6 @@ public void testMultipleAudiences() throws Exception { URL busFile = JWTPropertiesTest.class.getResource("client.xml"); List providers = new ArrayList<>(); - providers.add(new JacksonJsonProvider()); providers.add(new JwtAuthenticationClientFilter()); String address = "https://localhost:" + PORT + "/unsignedjwt/bookstore/books"; diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml index b948abe04aa..425e817776b 100644 --- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml +++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml @@ -163,7 +163,6 @@ under the License. - @@ -171,7 +170,6 @@ under the License. - @@ -212,7 +210,6 @@ under the License. - @@ -229,7 +226,6 @@ under the License. - @@ -243,7 +239,6 @@ under the License. - diff --git a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/serverJwsJson.xml b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/serverJwsJson.xml index bdcd01fc5b1..1313eb84cea 100644 --- a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/serverJwsJson.xml +++ b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/serverJwsJson.xml @@ -48,7 +48,6 @@ under the License. - @@ -56,7 +55,6 @@ under the License. - @@ -73,7 +71,6 @@ under the License. -