Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]Introduces Resource Sharing and Access Control #16030

Open
wants to merge 68 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
909a85b
Adds a new plugin type named ResourcePlugin and relevant base classes
DarshitChanpura Aug 27, 2024
66a849c
Adds a No-op implementation of ResourcePlugin
DarshitChanpura Aug 27, 2024
08cdcb3
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Aug 30, 2024
d7169e4
Adds a way to configure security plugin for resource access-control
DarshitChanpura Aug 30, 2024
58ae851
Fixes compilation errors and changes debug log-level to info for Reso…
DarshitChanpura Aug 30, 2024
fd00243
Replace plugin count check with isEmpty
DarshitChanpura Aug 30, 2024
ef8a0b7
Adds package-info
DarshitChanpura Aug 30, 2024
e98cb61
Renames a bunch of files
DarshitChanpura Aug 30, 2024
96f09b0
Changes method signatures to be inline with their usage
DarshitChanpura Aug 30, 2024
c86dfc9
Adds new method for deleting by entity
DarshitChanpura Aug 30, 2024
7c6ec2a
Adds abstract method definitions for ResourcePlugin interface
DarshitChanpura Sep 3, 2024
c04762e
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Sep 3, 2024
f95a67f
Adds toXContent implementations
DarshitChanpura Sep 6, 2024
8b8fffd
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Sep 6, 2024
7e7cd0a
Modifies some method names and comments
DarshitChanpura Sep 10, 2024
e1a1b62
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Oct 2, 2024
23fcfba
Fixes license
DarshitChanpura Oct 2, 2024
fba48ab
Adds changelog entry
DarshitChanpura Oct 2, 2024
9cb8d0e
Adds a notion of scope
DarshitChanpura Oct 2, 2024
848234e
Modifies sharedwith to accomodate scope
DarshitChanpura Oct 4, 2024
eaf0c6e
Adds missing JavaDoc
DarshitChanpura Oct 4, 2024
6a6e6f7
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Oct 4, 2024
566913a
Adds NamedWriteable capability and removes un-needed method
DarshitChanpura Oct 4, 2024
b4f876f
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Oct 10, 2024
9baac32
Updates toXContent implementations
DarshitChanpura Oct 10, 2024
0eb47ac
Fix toString implementation
DarshitChanpura Oct 10, 2024
e313071
Allows the ability to list resource permissions
DarshitChanpura Oct 15, 2024
bd91162
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Nov 5, 2024
2327258
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Nov 20, 2024
774a4a1
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Nov 25, 2024
37cacf0
Adds NamedWriteable implementations
DarshitChanpura Nov 27, 2024
4107407
Adds TODO for Noop Implementation
DarshitChanpura Dec 3, 2024
274c64f
Adds fromValue method to EntityType
DarshitChanpura Dec 4, 2024
014be82
Refactors variables from List to Set
DarshitChanpura Dec 5, 2024
3143796
Updates revokeAccess signature to accept scopes to revoke access from
DarshitChanpura Dec 5, 2024
04a02cb
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 5, 2024
e468f91
Convert sets to lists
DarshitChanpura Dec 5, 2024
3a0b4b1
Upper-case the default scope
DarshitChanpura Dec 5, 2024
0056807
Adds concrete implementation of getResources in Noop RAC plugin
DarshitChanpura Dec 11, 2024
0548fc2
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 11, 2024
193112b
Updates the ResourceAccessControlPlugin to have noop actions, renames…
DarshitChanpura Dec 13, 2024
cbbefa6
Adds ReflectPermissions for DefaultResourceAccessControlPlugin
DarshitChanpura Dec 13, 2024
d7d1f25
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 13, 2024
a44b06a
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 17, 2024
b58308e
Adds missing package-info
DarshitChanpura Dec 17, 2024
b25a9a7
Adds unit and integration tests
DarshitChanpura Dec 18, 2024
eb43578
Adds missing experimental annotations
DarshitChanpura Dec 18, 2024
bcd0f2b
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 18, 2024
686f037
Uses jackson object-mapper to read resource class and updates the int…
DarshitChanpura Dec 18, 2024
0bf9fd1
Completes the integrations tests
DarshitChanpura Dec 18, 2024
4a073f1
Updates SHAs
DarshitChanpura Dec 18, 2024
34f160c
Comment and code cleanup
DarshitChanpura Dec 19, 2024
1df8e11
Fixes tests
DarshitChanpura Dec 19, 2024
eee5ce1
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 20, 2024
77c56be
Adds integration tests for non-default RAC plugin
DarshitChanpura Dec 20, 2024
bb584bb
Removes unused dependency licenses
DarshitChanpura Dec 20, 2024
448307b
Adds missing license headers
DarshitChanpura Dec 20, 2024
d9f5262
Adds type bounding to Resource
DarshitChanpura Dec 20, 2024
1aff350
Updates Resource to be a serializable
DarshitChanpura Dec 20, 2024
f90b165
Adds getResourceName as API contract for Resource
DarshitChanpura Dec 20, 2024
5e6b8ff
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 30, 2024
ce9d5ec
Removes notion of users, roles and backend_roles
DarshitChanpura Dec 30, 2024
7a868cb
Fixes gradle check failures
DarshitChanpura Dec 30, 2024
f1d3011
Fixes created by tests
DarshitChanpura Dec 31, 2024
00ba7a7
Adds test for recipient registry
DarshitChanpura Dec 31, 2024
6fb5055
Fixes a bug in toXContent
DarshitChanpura Dec 31, 2024
3dfc16e
Merge remote-tracking branch 'upstream/main' into resource-permissions
DarshitChanpura Dec 31, 2024
532d13a
Moves jackson dependency addition to server build.gradle
DarshitChanpura Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Introduce a setting to disable download of full cluster state from remote on term mismatch([#16798](https://github.com/opensearch-project/OpenSearch/pull/16798/))
- Added ability to retrieve value from DocValues in a flat_object filed([#16802](https://github.com/opensearch-project/OpenSearch/pull/16802))
- Introduce framework for auxiliary transports and an experimental gRPC transport plugin ([#16534](https://github.com/opensearch-project/OpenSearch/pull/16534))
- Add resource-level access control and sharing ([#16030](https://github.com/opensearch-project/OpenSearch/pull/16030))

### Dependencies
- Bump `com.google.cloud:google-cloud-core-http` from 2.23.0 to 2.47.0 ([#16504](https://github.com/opensearch-project/OpenSearch/pull/16504))
Expand Down
8 changes: 0 additions & 8 deletions distribution/tools/upgrade-cli/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions distribution/tools/upgrade-cli/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions modules/ingest-geoip/licenses/jackson-annotations-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions modules/ingest-geoip/licenses/jackson-annotations-NOTICE

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions modules/ingest-geoip/licenses/jackson-databind-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions modules/ingest-geoip/licenses/jackson-databind-NOTICE

This file was deleted.

8 changes: 0 additions & 8 deletions plugins/crypto-kms/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/crypto-kms/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions plugins/discovery-ec2/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/discovery-ec2/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions plugins/repository-s3/licenses/jackson-LICENSE

This file was deleted.

20 changes: 0 additions & 20 deletions plugins/repository-s3/licenses/jackson-NOTICE

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ dependencies {
api project(":libs:opensearch-telemetry")
api project(":libs:opensearch-task-commons")

api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
api "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}"


compileOnly project(':libs:opensearch-plugin-classloader')
testRuntimeOnly project(':libs:opensearch-plugin-classloader')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.accesscontrol.resources;

import org.opensearch.accesscontrol.resources.testplugins.TestRACPlugin;
import org.opensearch.accesscontrol.resources.testplugins.TestResourcePlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.plugins.ResourceAccessControlPlugin;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;

import java.util.Collection;
import java.util.List;

public class NonDefaultResourceAccessControlPluginIT extends OpenSearchIntegTestCase {
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return List.of(TestResourcePlugin.class, TestRACPlugin.class);
}

public void testSampleResourcePluginCallsTestRACPluginToManageResourceAccess() {
ResourceAccessControlPlugin racPlugin = TestResourcePlugin.GuiceHolder.getResourceService().getResourceAccessControlPlugin();
MatcherAssert.assertThat(racPlugin.getClass(), Matchers.is(TestRACPlugin.class));
}
}
Loading
Loading