From 879afa7487d56c5711a0909231a1ff89c14e417d Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 15 Nov 2024 09:54:23 -0500 Subject: [PATCH] Rebase with latest from main Signed-off-by: Craig Perkins --- build.gradle | 133 ++++++++---------- sample-extension-plugin/build.gradle | 4 + .../security/OpenSearchSecurityPlugin.java | 1 + 3 files changed, 61 insertions(+), 77 deletions(-) diff --git a/build.gradle b/build.gradle index 87469dff38..7c5ab01546 100644 --- a/build.gradle +++ b/build.gradle @@ -645,29 +645,7 @@ dependencies { runtimeOnly 'org.apache.commons:commons-text:1.12.0' runtimeOnly "org.glassfish.jaxb:jaxb-runtime:${jaxb_version}" runtimeOnly 'com.google.j2objc:j2objc-annotations:2.8' - compileOnly 'com.google.code.f//integration test framework:\n' + - ' integrationTestImplementation(\'com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1\') {\n' + - ' exclude(group: \'junit\', module: \'junit\')\n' + - ' }\n' + - ' integrationTestImplementation \'junit:junit:4.13.2\'\n' + - ' integrationTestImplementation "org.opensearch.plugin:reindex-client:${opensearch_version}"\n' + - ' integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}"\n' + - ' integrationTestImplementation \'commons-io:commons-io:2.17.0\'\n' + - ' integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}"\n' + - ' integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}"\n' + - ' integrationTestImplementation \'org.hamcrest:hamcrest:2.2\'\n' + - ' integrationTestImplementation "org.bouncycastle:bcpkix-jdk18on:${versions.bouncycastle}"\n' + - ' integrationTestImplementation "org.bouncycastle:bcutil-jdk18on:${versions.bouncycastle}"\n' + - ' integrationTestImplementation(\'org.awaitility:awaitility:4.2.2\') {\n' + - ' exclude(group: \'org.hamcrest\', module: \'hamcrest\')\n' + - ' }\n' + - ' integrationTestImplementation \'com.unboundid:unboundid-ldapsdk:4.0.14\'\n' + - ' integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}"\n' + - ' integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14"\n' + - ' integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14"\n' + - ' integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14"\n' + - ' integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16"\n' + - ' integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5"indbugs:jsr305:3.0.2' + compileOnly 'com.google.code.findbugs:jsr305:3.0.2' runtimeOnly 'org.lz4:lz4-java:1.8.0' runtimeOnly 'org.slf4j:slf4j-api:1.7.36' runtimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:${versions.log4j}" @@ -747,29 +725,29 @@ dependencies { compileOnly "org.opensearch:opensearch:${opensearch_version}" //integration test framework: - integrationTestImplementation('com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1') { - exclude(group: 'junit', module: 'junit') - } - integrationTestImplementation 'junit:junit:4.13.2' - integrationTestImplementation "org.opensearch.plugin:reindex-client:${opensearch_version}" - integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}" - integrationTestImplementation 'commons-io:commons-io:2.17.0' - integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}" - integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}" - integrationTestImplementation 'org.hamcrest:hamcrest:2.2' - integrationTestImplementation "org.bouncycastle:bcpkix-jdk18on:${versions.bouncycastle}" - integrationTestImplementation "org.bouncycastle:bcutil-jdk18on:${versions.bouncycastle}" - integrationTestImplementation('org.awaitility:awaitility:4.2.2') { - exclude(group: 'org.hamcrest', module: 'hamcrest') - } - integrationTestImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14' - integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}" - integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14" - integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14" - integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14" - integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16" - integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5" - integrationTestImplementation "org.mockito:mockito-core:5.14.2" +// integrationTestImplementation('com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1') { +// exclude(group: 'junit', module: 'junit') +// } +// integrationTestImplementation 'junit:junit:4.13.2' +// integrationTestImplementation "org.opensearch.plugin:reindex-client:${opensearch_version}" +// integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}" +// integrationTestImplementation 'commons-io:commons-io:2.17.0' +// integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}" +// integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}" +// integrationTestImplementation 'org.hamcrest:hamcrest:2.2' +// integrationTestImplementation "org.bouncycastle:bcpkix-jdk18on:${versions.bouncycastle}" +// integrationTestImplementation "org.bouncycastle:bcutil-jdk18on:${versions.bouncycastle}" +// integrationTestImplementation('org.awaitility:awaitility:4.2.2') { +// exclude(group: 'org.hamcrest', module: 'hamcrest') +// } +// integrationTestImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14' +// integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}" +// integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14" +// integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14" +// integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14" +// integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16" +// integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5" +// integrationTestImplementation "org.mockito:mockito-core:5.14.2" //spotless implementation('com.google.googlejavaformat:google-java-format:1.24.0') { @@ -777,37 +755,38 @@ dependencies { } } -//allprojects { -// configurations { -// integrationTestImplementation.extendsFrom implementation -// integrationTestRuntimeOnly.extendsFrom runtimeOnly -// } -// dependencies { -// //integration test framework: -// integrationTestImplementation('com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1') { -// exclude(group: 'junit', module: 'junit') -// } -// integrationTestImplementation 'junit:junit:4.13.2' -// integrationTestImplementation "org.opensearch.plugin:reindex-client:${opensearch_version}" -// integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}" -// integrationTestImplementation 'commons-io:commons-io:2.17.0' -// integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}" -// integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}" -// integrationTestImplementation 'org.hamcrest:hamcrest:2.2' -// integrationTestImplementation "org.bouncycastle:bcpkix-jdk18on:${versions.bouncycastle}" -// integrationTestImplementation "org.bouncycastle:bcutil-jdk18on:${versions.bouncycastle}" -// integrationTestImplementation('org.awaitility:awaitility:4.2.2') { -// exclude(group: 'org.hamcrest', module: 'hamcrest') -// } -// integrationTestImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14' -// integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}" -// integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14" -// integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14" -// integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14" -// integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16" -// integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5" -// } -//} +allprojects { + configurations { + integrationTestImplementation.extendsFrom implementation + integrationTestRuntimeOnly.extendsFrom runtimeOnly + } + dependencies { + //integration test framework: + integrationTestImplementation('com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1') { + exclude(group: 'junit', module: 'junit') + } + integrationTestImplementation 'junit:junit:4.13.2' + integrationTestImplementation "org.opensearch.plugin:reindex-client:${opensearch_version}" + integrationTestImplementation "org.opensearch.plugin:percolator-client:${opensearch_version}" + integrationTestImplementation 'commons-io:commons-io:2.17.0' + integrationTestImplementation "org.apache.logging.log4j:log4j-core:${versions.log4j}" + integrationTestImplementation "org.apache.logging.log4j:log4j-jul:${versions.log4j}" + integrationTestImplementation 'org.hamcrest:hamcrest:2.2' + integrationTestImplementation "org.bouncycastle:bcpkix-jdk18on:${versions.bouncycastle}" + integrationTestImplementation "org.bouncycastle:bcutil-jdk18on:${versions.bouncycastle}" + integrationTestImplementation('org.awaitility:awaitility:4.2.2') { + exclude(group: 'org.hamcrest', module: 'hamcrest') + } + integrationTestImplementation 'com.unboundid:unboundid-ldapsdk:4.0.14' + integrationTestImplementation "org.opensearch.plugin:mapper-size:${opensearch_version}" + integrationTestImplementation "org.apache.httpcomponents:httpclient-cache:4.5.14" + integrationTestImplementation "org.apache.httpcomponents:httpclient:4.5.14" + integrationTestImplementation "org.apache.httpcomponents:fluent-hc:4.5.14" + integrationTestImplementation "org.apache.httpcomponents:httpcore:4.4.16" + integrationTestImplementation "org.apache.httpcomponents:httpasyncclient:4.1.5" + integrationTestImplementation "org.mockito:mockito-core:5.14.2" + } +} jar { libsDirName = '.' diff --git a/sample-extension-plugin/build.gradle b/sample-extension-plugin/build.gradle index 89316763ea..518113e56f 100644 --- a/sample-extension-plugin/build.gradle +++ b/sample-extension-plugin/build.gradle @@ -68,6 +68,10 @@ dependencies { implementation 'com.nimbusds:nimbus-jose-jwt:9.41.2' implementation 'com.rfksystems:blake2b:2.0.0' implementation 'com.password4j:password4j:1.8.2' + + // Action privileges: check tables and compact collections + implementation 'com.selectivem.collections:special-collections-complete:1.4.0' + //JWT implementation "io.jsonwebtoken:jjwt-api:${jjwt_version}" implementation "io.jsonwebtoken:jjwt-impl:${jjwt_version}" diff --git a/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java b/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java index 09a5a1f024..b24680d1be 100644 --- a/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java +++ b/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java @@ -43,6 +43,7 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects;