Skip to content

Commit 058bcdb

Browse files
authored
Categorize Security APIs (#95245)
Categorize security APIs for use with the serverless project.
1 parent a005694 commit 058bcdb

File tree

46 files changed

+138
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+138
-0
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import org.elasticsearch.rest.BaseRestHandler;
1717
import org.elasticsearch.rest.RestRequest;
1818
import org.elasticsearch.rest.RestResponse;
19+
import org.elasticsearch.rest.Scope;
20+
import org.elasticsearch.rest.ServerlessScope;
1921
import org.elasticsearch.rest.action.RestBuilderListener;
2022
import org.elasticsearch.xcontent.ToXContent;
2123
import org.elasticsearch.xcontent.XContentBuilder;
@@ -31,6 +33,7 @@
3133
import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
3234
import static org.elasticsearch.rest.RestStatus.OK;
3335

36+
@ServerlessScope(Scope.PUBLIC)
3437
public class RestGetLicenseAction extends BaseRestHandler {
3538

3639
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestGetLicenseAction.class);

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.elasticsearch.rest.RestRequest;
1313
import org.elasticsearch.rest.RestResponse;
1414
import org.elasticsearch.rest.RestStatus;
15+
import org.elasticsearch.rest.Scope;
16+
import org.elasticsearch.rest.ServerlessScope;
1517
import org.elasticsearch.rest.action.RestBuilderListener;
1618
import org.elasticsearch.xcontent.XContentBuilder;
1719
import org.elasticsearch.xpack.core.ssl.action.GetCertificateInfoAction;
@@ -25,6 +27,7 @@
2527
* A REST handler to obtain information about TLS/SSL (X.509) certificates
2628
* @see GetCertificateInfoAction
2729
*/
30+
@ServerlessScope(Scope.INTERNAL)
2831
public class RestGetCertificateInfoAction extends BaseRestHandler {
2932

3033
@Override

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.elasticsearch.rest.RestRequest;
1414
import org.elasticsearch.rest.RestResponse;
1515
import org.elasticsearch.rest.RestStatus;
16+
import org.elasticsearch.rest.Scope;
17+
import org.elasticsearch.rest.ServerlessScope;
1618
import org.elasticsearch.rest.action.RestBuilderListener;
1719
import org.elasticsearch.xcontent.ToXContent;
1820
import org.elasticsearch.xcontent.XContentBuilder;
@@ -27,6 +29,7 @@
2729

2830
import static org.elasticsearch.rest.RestRequest.Method.GET;
2931

32+
@ServerlessScope(Scope.PUBLIC)
3033
public class RestAuthenticateAction extends SecurityBaseRestHandler {
3134

3235
private final SecurityContext securityContext;

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestBulkUpdateApiKeyAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.elasticsearch.common.settings.Settings;
1212
import org.elasticsearch.license.XPackLicenseState;
1313
import org.elasticsearch.rest.RestRequest;
14+
import org.elasticsearch.rest.Scope;
15+
import org.elasticsearch.rest.ServerlessScope;
1416
import org.elasticsearch.rest.action.RestToXContentListener;
1517
import org.elasticsearch.xcontent.ConstructingObjectParser;
1618
import org.elasticsearch.xcontent.ParseField;
@@ -27,6 +29,7 @@
2729
import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg;
2830
import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg;
2931

32+
@ServerlessScope(Scope.PUBLIC)
3033
public final class RestBulkUpdateApiKeyAction extends ApiKeyBaseRestHandler {
3134

3235
@SuppressWarnings("unchecked")

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestClearApiKeyCacheAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.elasticsearch.common.settings.Settings;
1212
import org.elasticsearch.license.XPackLicenseState;
1313
import org.elasticsearch.rest.RestRequest;
14+
import org.elasticsearch.rest.Scope;
15+
import org.elasticsearch.rest.ServerlessScope;
1416
import org.elasticsearch.rest.action.RestActions.NodesResponseRestListener;
1517
import org.elasticsearch.xpack.core.security.action.ClearSecurityCacheAction;
1618
import org.elasticsearch.xpack.core.security.action.ClearSecurityCacheRequest;
@@ -21,6 +23,7 @@
2123

2224
import static org.elasticsearch.rest.RestRequest.Method.POST;
2325

26+
@ServerlessScope(Scope.PUBLIC)
2427
public class RestClearApiKeyCacheAction extends SecurityBaseRestHandler {
2528

2629
public RestClearApiKeyCacheAction(Settings settings, XPackLicenseState licenseState) {

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.elasticsearch.common.settings.Settings;
1313
import org.elasticsearch.license.XPackLicenseState;
1414
import org.elasticsearch.rest.RestRequest;
15+
import org.elasticsearch.rest.Scope;
16+
import org.elasticsearch.rest.ServerlessScope;
1517
import org.elasticsearch.rest.action.RestToXContentListener;
1618
import org.elasticsearch.xpack.core.security.action.apikey.CreateApiKeyRequest;
1719
import org.elasticsearch.xpack.core.security.action.apikey.CreateApiKeyRequestBuilder;
@@ -25,6 +27,7 @@
2527
/**
2628
* Rest action to create an API key
2729
*/
30+
@ServerlessScope(Scope.PUBLIC)
2831
public final class RestCreateApiKeyAction extends ApiKeyBaseRestHandler {
2932

3033
/**

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import org.elasticsearch.rest.RestRequest;
1515
import org.elasticsearch.rest.RestResponse;
1616
import org.elasticsearch.rest.RestStatus;
17+
import org.elasticsearch.rest.Scope;
18+
import org.elasticsearch.rest.ServerlessScope;
1719
import org.elasticsearch.rest.action.RestBuilderListener;
1820
import org.elasticsearch.xcontent.XContentBuilder;
1921
import org.elasticsearch.xpack.core.security.action.apikey.GetApiKeyAction;
@@ -28,6 +30,7 @@
2830
/**
2931
* Rest action to get one or more API keys information.
3032
*/
33+
@ServerlessScope(Scope.PUBLIC)
3134
public final class RestGetApiKeyAction extends ApiKeyBaseRestHandler {
3235

3336
public RestGetApiKeyAction(Settings settings, XPackLicenseState licenseState) {

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGrantApiKeyAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import org.elasticsearch.rest.RestRequest;
1818
import org.elasticsearch.rest.RestRequestFilter;
1919
import org.elasticsearch.rest.RestStatus;
20+
import org.elasticsearch.rest.Scope;
21+
import org.elasticsearch.rest.ServerlessScope;
2022
import org.elasticsearch.rest.action.RestToXContentListener;
2123
import org.elasticsearch.xcontent.ObjectParser;
2224
import org.elasticsearch.xcontent.ParseField;
@@ -38,6 +40,7 @@
3840
* Rest action to create an API key on behalf of another user. Loosely mimics the API of
3941
* {@link org.elasticsearch.xpack.security.rest.action.oauth2.RestGetTokenAction} combined with {@link RestCreateApiKeyAction}
4042
*/
43+
@ServerlessScope(Scope.INTERNAL)
4144
public final class RestGrantApiKeyAction extends ApiKeyBaseRestHandler implements RestRequestFilter {
4245

4346
static final ObjectParser<GrantApiKeyRequest, Void> PARSER = new ObjectParser<>("grant_api_key_request", GrantApiKeyRequest::new);

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import org.elasticsearch.rest.RestRequest;
1616
import org.elasticsearch.rest.RestResponse;
1717
import org.elasticsearch.rest.RestStatus;
18+
import org.elasticsearch.rest.Scope;
19+
import org.elasticsearch.rest.ServerlessScope;
1820
import org.elasticsearch.rest.action.RestBuilderListener;
1921
import org.elasticsearch.xcontent.ConstructingObjectParser;
2022
import org.elasticsearch.xcontent.ParseField;
@@ -32,6 +34,7 @@
3234
/**
3335
* Rest action to invalidate one or more API keys
3436
*/
37+
@ServerlessScope(Scope.PUBLIC)
3538
public final class RestInvalidateApiKeyAction extends ApiKeyBaseRestHandler {
3639
@SuppressWarnings("unchecked")
3740
static final ConstructingObjectParser<InvalidateApiKeyRequest, Void> PARSER = new ConstructingObjectParser<>(

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestQueryApiKeyAction.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import org.elasticsearch.index.query.QueryBuilder;
1515
import org.elasticsearch.license.XPackLicenseState;
1616
import org.elasticsearch.rest.RestRequest;
17+
import org.elasticsearch.rest.Scope;
18+
import org.elasticsearch.rest.ServerlessScope;
1719
import org.elasticsearch.rest.action.RestToXContentListener;
1820
import org.elasticsearch.search.searchafter.SearchAfterBuilder;
1921
import org.elasticsearch.search.sort.FieldSortBuilder;
@@ -35,6 +37,7 @@
3537
/**
3638
* Rest action to search for API keys
3739
*/
40+
@ServerlessScope(Scope.PUBLIC)
3841
public final class RestQueryApiKeyAction extends ApiKeyBaseRestHandler {
3942

4043
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)