Skip to content

Commit

Permalink
Add ShareWithAction to security plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Dec 17, 2024
1 parent 981446a commit c9cf55f
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 389 deletions.
12 changes: 6 additions & 6 deletions checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@
<property name="severity" value="error"/>
</module>

<module name="RegexpSingleline">
<property name="format" value="extension"/>
<property name="ignoreCase" value="true"/>
<property name="message" value="Extension should only be used sparingly to keep implementations as generic as possible" />
<property name="severity" value="error"/>
</module>
<!-- <module name="RegexpSingleline">-->
<!-- <property name="format" value="extension"/>-->
<!-- <property name="ignoreCase" value="true"/>-->
<!-- <property name="message" value="Extension should only be used sparingly to keep implementations as generic as possible" />-->
<!-- <property name="severity" value="error"/>-->
<!-- </module>-->

<module name="SuppressWithPlainTextCommentFilter">
<property name="offCommentFormat" value="CS-SUPPRESS-ALL: .+"/> <!-- Require an explaination after surpressing -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
import org.opensearch.security.sampleextension.actions.list.ListSampleResourceAction;
import org.opensearch.security.sampleextension.actions.list.ListSampleResourceRestAction;
import org.opensearch.security.sampleextension.actions.list.ListSampleResourceTransportAction;
import org.opensearch.security.sampleextension.actions.sharing.UpdateSampleResourceSharingAction;
import org.opensearch.security.sampleextension.actions.sharing.UpdateSampleResourceSharingRestAction;
import org.opensearch.security.sampleextension.actions.sharing.UpdateSampleResourceSharingTransportAction;
import org.opensearch.security.sampleextension.actions.update.UpdateSampleResourceAction;
import org.opensearch.security.sampleextension.actions.update.UpdateSampleResourceRestAction;
import org.opensearch.security.sampleextension.actions.update.UpdateSampleResourceTransportAction;
Expand Down Expand Up @@ -117,8 +114,7 @@ public List<RestHandler> getRestHandlers(
new CreateSampleResourceRestAction(),
new GetSampleResourceRestAction(),
new ListSampleResourceRestAction(),
new UpdateSampleResourceRestAction(),
new UpdateSampleResourceSharingRestAction()
new UpdateSampleResourceRestAction()
);
}

Expand All @@ -128,7 +124,6 @@ public List<RestHandler> getRestHandlers(
new ActionHandler<>(CreateSampleResourceAction.INSTANCE, CreateSampleResourceTransportAction.class),
new ActionHandler<>(GetSampleResourceAction.INSTANCE, GetSampleResourceTransportAction.class),
new ActionHandler<>(ListSampleResourceAction.INSTANCE, ListSampleResourceTransportAction.class),
new ActionHandler<>(UpdateSampleResourceSharingAction.INSTANCE, UpdateSampleResourceSharingTransportAction.class),
new ActionHandler<>(UpdateSampleResourceAction.INSTANCE, UpdateSampleResourceTransportAction.class)
);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void testCreateSampleResource() throws IOException, InterruptedException
).map();
System.out.println("resourceSharingResponse: " + resourceSharingResponseMap);

Request updateSharingRequest = new Request("PUT", "/_plugins/resource_sharing_example/resource/update_sharing/" + resourceId);
Request updateSharingRequest = new Request("PUT", "/_plugins/_security/resource/sample_resource/" + resourceId + "/share_with");
updateSharingRequest.setEntity(
new StringEntity("{\"share_with\":{\"users\": [\"admin\"], \"backend_roles\": [], \"allowed_actions\": [\"*\"]}}")
);
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit c9cf55f

Please sign in to comment.