Skip to content

Commit

Permalink
Extend ActionRequest and TransportService for Resource permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
  • Loading branch information
stephen-crawford committed Aug 13, 2024
1 parent 2defb76 commit 27b2f15
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions server/src/main/java/org/opensearch/action/ActionRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import org.opensearch.transport.TransportRequest;

import java.io.IOException;
import java.util.Collections;
import java.util.List;

/**
* Base action request implemented by plugins.
Expand All @@ -58,6 +60,14 @@ public ActionRequest(StreamInput in) throws IOException {
super(in);
}

/**
* Should be overwritten by implementing plugins with the resources each actionRequest requires.
* Bypasses resource evaluation by default.
*/
public List<String> getResources() {
return Collections.emptyList();
}

public abstract ActionRequestValidationException validate();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,8 @@ public TransportAddress[] addressesFromString(String address) throws UnknownHost
"cluster:monitor",
"cluster:internal",
"internal:",
"views:"
"views:",
"resource:"
)
)
);
Expand Down

0 comments on commit 27b2f15

Please sign in to comment.