Skip to content

Commit 23e706a

Browse files
Fixes after rebase with main
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
1 parent 53575d4 commit 23e706a

File tree

8 files changed

+7
-30
lines changed

8 files changed

+7
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
## [Unreleased 3.x]
77

88
### Features
9-
### Added
10-
- [Resource Sharing] Adds a Resource Access Evaluator for standalone Resource access authorization ([#5408](https://github.com/opensearch-project/security/pull/5408))
119

1210
* Introduced new experimental versioned security configuration management feature ([#5357] (https://github.com/opensearch-project/security/pull/5357))
1311
* [Resource Sharing] Adds migrate API to move resource-sharing info to security plugin ([#5389](https://github.com/opensearch-project/security/pull/5389))
@@ -27,8 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2725
* Optimized performance for construction of internal action privileges data structure ([#5470](https://github.com/opensearch-project/security/pull/5470))
2826
* Restricting query optimization via star tree index for users with queries on indices with DLS/FLS/FieldMasked restrictions ([#5492](https://github.com/opensearch-project/security/pull/5492))
2927
* Handle subject in nested claim for JWT auth backends ([#5467](https://github.com/opensearch-project/security/pull/5467))
30-
* Moved OpenSAML jars to a Shadow Jar configuration to facilitate its use in FIPS enabled environments ([#5400](https://github.com/opensearch-project/security/pull/5404))
31-
* [Resource Sharing] Adds a Resource Access Evaluator for standalone Resource access authorization ([#5408](https://github.com/opensearch-project/security/pull/5408))
28+
* [Resource Sharing] Adds a Share API to fetch and update sharing information ([#5459](https://github.com/opensearch-project/security/pull/5459))
3229

3330
### Bug Fixes
3431

@@ -39,7 +36,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3936
* Fix usage of jwt_clock_skew_tolerance_seconds in HTTPJwtAuthenticator ([#5506](https://github.com/opensearch-project/security/pull/5506))
4037
* Always install demo certs if configured with demo certs ([#5517](https://github.com/opensearch-project/security/pull/5517))
4138

42-
4339
### Refactoring
4440

4541
* Refactor JWT Vendor to take a claims builder and rename oboEnabled to be enabled ([#5436](https://github.com/opensearch-project/security/pull/5436))
@@ -54,7 +50,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5450
- Bump `spring_version` from 6.2.7 to 6.2.9 ([#5403](https://github.com/opensearch-project/security/pull/5403), [#5493](https://github.com/opensearch-project/security/pull/5493))
5551
- Bump `stefanzweifel/git-auto-commit-action` from 5 to 6 ([#5401](https://github.com/opensearch-project/security/pull/5401))
5652
- Bump `com.github.spotbugs` from 5.2.5 to 6.2.3 ([#5409](https://github.com/opensearch-project/security/pull/5409), [#5450](https://github.com/opensearch-project/security/pull/5450), [#5474](https://github.com/opensearch-project/security/pull/5474), [#5536](https://github.com/opensearch-project/security/pull/5536))
57-
- Bump `com.github.spotbugs` from 5.2.5 to 6.2.1 ([#5409](https://github.com/opensearch-project/security/pull/5409), [#5450](https://github.com/opensearch-project/security/pull/5450))
5853
- Bump `org.codehaus.plexus:plexus-utils` from 3.3.0 to 3.6.0 ([#5429](https://github.com/opensearch-project/security/pull/5429))
5954
- Bump `net.bytebuddy:byte-buddy` from 1.17.5 to 1.17.6 ([#5427](https://github.com/opensearch-project/security/pull/5427))
6055
- Bump `io.dropwizard.metrics:metrics-core` from 4.2.32 to 4.2.33 ([#5428](https://github.com/opensearch-project/security/pull/5428))

sample-resource-plugin/src/integrationTest/java/org/opensearch/sample/resource/SecurityDisabledTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.opensearch.test.framework.cluster.ClusterManager;
2727
import org.opensearch.test.framework.cluster.LocalCluster;
2828
import org.opensearch.test.framework.cluster.TestRestClient;
29+
import org.opensearch.test.framework.matcher.RestMatchers;
2930

3031
import static org.hamcrest.MatcherAssert.assertThat;
3132
import static org.hamcrest.Matchers.containsString;
@@ -129,7 +130,6 @@ public void testSamplePluginAPIs() {
129130
}
130131

131132
private void assertNotImplementedResponse(TestRestClient.HttpResponse response, String msg) {
132-
response.assertStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
133-
assertThat(response.getTextFromJsonBody("/error/reason"), containsString(msg));
133+
assertThat(response, RestMatchers.isMethodNotImplemented("/error/reason", msg));
134134
}
135135
}

sample-resource-plugin/src/main/java/org/opensearch/sample/resource/actions/rest/revoke/RevokeResourceAccessRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
import static org.opensearch.sample.utils.Constants.RESOURCE_INDEX_NAME;
2121

22-
import static org.opensearch.sample.utils.Constants.RESOURCE_INDEX_NAME;
23-
2422
/**
2523
* Request object for revoking access to a sample resource
2624
*/

sample-resource-plugin/src/main/java/org/opensearch/sample/resource/actions/rest/share/ShareResourceRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
import static org.opensearch.sample.utils.Constants.RESOURCE_INDEX_NAME;
2121

22-
import static org.opensearch.sample.utils.Constants.RESOURCE_INDEX_NAME;
23-
2422
/**
2523
* Request object for sharing sample resource transport action
2624
*/

src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,9 +1171,7 @@ public Collection<Object> createComponents(
11711171
settings,
11721172
privilegesInterceptor,
11731173
cih,
1174-
irr,
1175-
resourcePluginInfo.getResourceIndices(),
1176-
rsIndexHandler
1174+
irr
11771175
);
11781176

11791177
dlsFlsBaseContext = new DlsFlsBaseContext(evaluator, threadPool.getThreadContext(), adminDns);

src/main/java/org/opensearch/security/privileges/PrivilegesEvaluator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
package org.opensearch.security.privileges;
2828

29-
import java.io.IOException;
3029
import java.util.ArrayList;
3130
import java.util.Arrays;
3231
import java.util.Collections;

src/main/java/org/opensearch/security/resources/ResourceAccessHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.opensearch.security.support.ConfigConstants;
4040
import org.opensearch.security.support.WildcardMatcher;
4141
import org.opensearch.security.user.User;
42+
import org.opensearch.threadpool.ThreadPool;
4243

4344
import reactor.util.annotation.NonNull;
4445

@@ -59,12 +60,12 @@ public class ResourceAccessHandler {
5960

6061
@Inject
6162
public ResourceAccessHandler(
62-
final ThreadContext threadContext,
63+
final ThreadPool threadPool,
6364
final ResourceSharingIndexHandler resourceSharingIndexHandler,
6465
AdminDNs adminDns,
6566
PrivilegesEvaluator evaluator
6667
) {
67-
this.threadContext = threadContext;
68+
this.threadContext = threadPool.getThreadContext();
6869
this.resourceSharingIndexHandler = resourceSharingIndexHandler;
6970
this.adminDNs = adminDns;
7071
this.privilegesEvaluator = evaluator;

src/main/java/org/opensearch/security/transport/SecurityRequestHandler.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,6 @@ protected void messageReceivedDecorate(
114114

115115
String initialActionClassValue = getThreadContext().getHeader(ConfigConstants.OPENDISTRO_SECURITY_INITIAL_ACTION_CLASS_HEADER);
116116

117-
String userHdr = getThreadContext().getHeader(ConfigConstants.OPENDISTRO_SECURITY_AUTHENTICATED_USER_HEADER);
118-
119-
// restore a persistent user-subject from header, if null
120-
if (getThreadContext().getPersistent(ConfigConstants.OPENDISTRO_SECURITY_AUTHENTICATED_USER) == null && userHdr != null) {
121-
User user = this.userFactory.fromSerializedBase64(userHdr);
122-
123-
getThreadContext().putPersistent(
124-
ConfigConstants.OPENDISTRO_SECURITY_AUTHENTICATED_USER,
125-
new UserSubjectImpl(getThreadPool(), user)
126-
);
127-
}
128-
129117
final ThreadContext.StoredContext sgContext = getThreadContext().newStoredContext(false);
130118

131119
final String originHeader = getThreadContext().getHeader(ConfigConstants.OPENDISTRO_SECURITY_ORIGIN_HEADER);

0 commit comments

Comments
 (0)