Skip to content

Commit

Permalink
Update Jackson to 2.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
reta committed Jan 19, 2025
1 parent 145de46 commit 47c5d46
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 119 deletions.
4 changes: 2 additions & 2 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
<cxf.httpcomponents.core.version>4.4.16</cxf.httpcomponents.core.version>
<cxf.httpcomponents.client5.version>5.3.1</cxf.httpcomponents.client5.version>
<cxf.httpcomponents.core5.version>5.2.5</cxf.httpcomponents.core5.version>
<cxf.jackson.version>2.17.2</cxf.jackson.version>
<cxf.jackson.databind.version>2.17.2</cxf.jackson.databind.version>
<cxf.jackson.version>2.18.2</cxf.jackson.version>
<cxf.jackson.databind.version>2.18.2</cxf.jackson.databind.version>
<cxf.jacorb.version>3.9</cxf.jacorb.version>
<cxf.jaeger.version>1.8.1</cxf.jaeger.version>
<cxf.jakarta.activation.version>2.1.3</cxf.jakarta.activation.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand All @@ -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<String, Object> props = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -65,7 +63,6 @@ public void testEncryptionProperties() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books";
Expand All @@ -92,7 +89,6 @@ public void testEncryptionDynamic() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books";
Expand Down Expand Up @@ -122,7 +118,6 @@ public void testWrongKeyEncryptionAlgorithm() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books";
Expand All @@ -148,7 +143,6 @@ public void testWrongKeyEncryptionAlgorithmKeyIncluded() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books";
Expand Down Expand Up @@ -178,7 +172,6 @@ public void testWrongContentEncryptionAlgorithm() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books";
Expand All @@ -204,7 +197,6 @@ public void testBadEncryptingKey() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweoaepgcm/bookstore/books";
Expand All @@ -230,7 +222,6 @@ public void testSmallEncryptionKeySize() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwesmallkey/bookstore/books";
Expand All @@ -257,12 +248,9 @@ public void testManualEncryption() throws Exception {

URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> 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<String, Object> properties = new HashMap<>();
Expand Down Expand Up @@ -310,7 +298,6 @@ public void testEncryptionPBES() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwepbes/bookstore/books";
Expand Down Expand Up @@ -339,7 +326,6 @@ public void testEncryptionPBESDifferentCount() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwepbes/bookstore/books";
Expand Down Expand Up @@ -374,7 +360,6 @@ public void testSignatureProperties() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jws/bookstore/books";
Expand All @@ -401,7 +386,6 @@ public void testSignatureDynamic() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jws/bookstore/books";
Expand Down Expand Up @@ -431,7 +415,6 @@ public void testWrongSignatureAlgorithm() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jws/bookstore/books";
Expand All @@ -457,7 +440,6 @@ public void testWrongSignatureAlgorithmKeyIncluded() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jws/bookstore/books";
Expand All @@ -484,7 +466,6 @@ public void testBadSigningKey() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jws/bookstore/books";
Expand All @@ -511,7 +492,6 @@ public void testSignatureEllipticCurve() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwsec/bookstore/books";
Expand Down Expand Up @@ -540,12 +520,9 @@ public void testManualSignature() throws Exception {

URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> 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<String, Object> properties = new HashMap<>();
Expand Down Expand Up @@ -588,7 +565,6 @@ public void testSmallSignatureKeySize() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwssmallkey/bookstore/books";
Expand Down Expand Up @@ -616,7 +592,6 @@ public void testUnsignedTokenFailure() throws Exception {
URL busFile = JweJwsAlgorithmTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
JwsWriterInterceptor writerInterceptor = new JwsWriterInterceptor();
writerInterceptor.setSignatureProvider(new NoneJwsSignatureProvider());
providers.add(writerInterceptor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -64,7 +62,6 @@ public void testEncryptionIncludePublicKey() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweincludekey/bookstore/books";
Expand All @@ -91,7 +88,6 @@ public void testEncryptionIncludeCert() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books";
Expand Down Expand Up @@ -128,7 +124,6 @@ public void testEncryptionIncludeCertNegativeTest() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books";
Expand Down Expand Up @@ -158,7 +153,6 @@ public void testEncryptionIncludeCertSha1() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books";
Expand Down Expand Up @@ -195,7 +189,6 @@ public void testEncryptionIncludeCertSha1NegativeTest() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JweWriterInterceptor());

String address = "http://localhost:" + PORT + "/jweincludecert/bookstore/books";
Expand Down Expand Up @@ -229,7 +222,6 @@ public void testSignatureIncludeCert() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwsincludecert/bookstore/books";
Expand Down Expand Up @@ -264,7 +256,6 @@ public void testSignatureIncludeCertNegativeTest() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwsincludecert/bookstore/books";
Expand Down Expand Up @@ -292,7 +283,6 @@ public void testSignatureIncludeCertSha1() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwsincludecertsha1/bookstore/books";
Expand Down Expand Up @@ -328,7 +318,6 @@ public void testSignatureIncludeCertSha1NegativeTest() throws Exception {
URL busFile = JweJwsReferenceTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
providers.add(new JwsWriterInterceptor());

String address = "http://localhost:" + PORT + "/jwsincludecertsha1/bookstore/books";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -65,7 +63,6 @@ public void testSignHTTPHeaders() throws Exception {
URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor();
providers.add(jwsWriterInterceptor);

Expand Down Expand Up @@ -97,7 +94,6 @@ public void testSpecifyHeadersToSign() throws Exception {
URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor();
jwsWriterInterceptor.setProtectHttpHeaders(true);
Set<String> headersToSign = new HashSet<>();
Expand Down Expand Up @@ -133,7 +129,6 @@ public void testSignAdditionalCustomHeader() throws Exception {
URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor();
jwsWriterInterceptor.setProtectHttpHeaders(true);
Set<String> headersToSign = new HashSet<>();
Expand Down Expand Up @@ -168,7 +163,6 @@ public void testSignCustomHeaderRequired() throws Exception {
URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor();
jwsWriterInterceptor.setProtectHttpHeaders(true);
providers.add(jwsWriterInterceptor);
Expand Down Expand Up @@ -208,7 +202,6 @@ public void testSignEmptyCustomHeader() throws Exception {
URL busFile = JwsHTTPHeaderTest.class.getResource("client.xml");

List<Object> providers = new ArrayList<>();
providers.add(new JacksonJsonProvider());
JwsWriterInterceptor jwsWriterInterceptor = new JwsWriterInterceptor();
jwsWriterInterceptor.setProtectHttpHeaders(true);
Set<String> headersToSign = new HashSet<>();
Expand Down
Loading

0 comments on commit 47c5d46

Please sign in to comment.