From 7139963c8654f34575ccb8bb1cf167f81730130d Mon Sep 17 00:00:00 2001 From: Andrey Pleskach Date: Sun, 2 Jul 2023 15:08:52 +0200 Subject: [PATCH] Bump JSON libs Signed-off-by: Andrey Pleskach --- build.gradle | 28 +++++++++++++------ .../compliance/FieldReadCallback.java | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index c1302656c4..b32c28062e 100644 --- a/build.gradle +++ b/build.gradle @@ -481,12 +481,29 @@ dependencies { implementation 'commons-cli:commons-cli:1.3.1' implementation "org.bouncycastle:bcprov-jdk15to18:${versions.bouncycastle}" implementation 'org.ldaptive:ldaptive:1.2.3' - implementation 'io.jsonwebtoken:jjwt-api:0.10.8' + implementation('org.apache.cxf:cxf-rt-rs-security-jose:3.5.5') { exclude(group: 'jakarta.activation', module: 'jakarta.activation-api') } - implementation 'com.github.wnameless:json-flattener:0.5.0' - implementation 'com.flipkart.zjsonpatch:zjsonpatch:0.4.4' + //JWT + implementation 'io.jsonwebtoken:jjwt-api:0.11.5' + implementation 'io.jsonwebtoken:jjwt-impl:0.11.5' + implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5' + // JSON flattener + implementation ("com.github.wnameless.json:json-base:2.4.0") { + exclude group: "org.glassfish", module: "jakarta.json" + exclude group: "com.google.code.gson", module: "gson" + exclude group: "org.json", module: "json" + } + implementation 'com.github.wnameless.json:json-flattener:0.16.4' + // JSON patch + implementation 'com.flipkart.zjsonpatch:zjsonpatch:0.4.14' + implementation 'org.apache.commons:commons-collections4:4.4' + + //JSON path + implementation 'com.jayway.jsonpath:json-path:2.8.0' + implementation 'net.minidev:json-smart:2.4.11' + implementation "org.apache.kafka:kafka-clients:${kafka_version}" implementation 'com.onelogin:java-saml:2.5.0' implementation 'com.onelogin:java-saml-core:2.5.0' @@ -498,7 +515,6 @@ dependencies { runtimeOnly 'org.apache.cxf:cxf-rt-security:3.5.5' runtimeOnly 'com.sun.activation:jakarta.activation:1.2.2' - runtimeOnly 'com.eclipsesource.minimal-json:minimal-json:0.9.5' runtimeOnly 'commons-codec:commons-codec:1.14' runtimeOnly 'org.cryptacular:cryptacular:1.2.4' runtimeOnly 'com.google.errorprone:error_prone_annotations:2.3.4' @@ -527,10 +543,6 @@ dependencies { implementation 'org.opensaml:opensaml-storage-api:3.4.5' implementation 'commons-lang:commons-lang:2.4' implementation 'commons-collections:commons-collections:3.2.2' - implementation 'com.jayway.jsonpath:json-path:2.4.0' - implementation 'net.minidev:json-smart:2.4.10' - runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.10.8' - runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.10.8' runtimeOnly 'com.google.guava:failureaccess:1.0.1' runtimeOnly 'org.apache.commons:commons-text:1.10.0' runtimeOnly 'org.glassfish.jaxb:jaxb-runtime:2.3.4' diff --git a/src/main/java/org/opensearch/security/compliance/FieldReadCallback.java b/src/main/java/org/opensearch/security/compliance/FieldReadCallback.java index 73f536c2f8..5fc1c73128 100644 --- a/src/main/java/org/opensearch/security/compliance/FieldReadCallback.java +++ b/src/main/java/org/opensearch/security/compliance/FieldReadCallback.java @@ -105,7 +105,7 @@ public void binaryFieldRead(final FieldInfo fieldInfo, byte[] fieldValue) { fieldValue = Utils.jsonMapToByteArray(filteredSource); } - Map filteredSource = new JsonFlattener(new String(fieldValue, StandardCharsets.UTF_8)).flattenAsMap(); + final Map filteredSource = JsonFlattener.flattenAsMap(new String(fieldValue, StandardCharsets.UTF_8)); for (String k : filteredSource.keySet()) { if (!recordField(k, filteredSource.get(k) instanceof String)) { continue;