rename watcher actions
Original commit: elastic/x-pack-elasticsearch@5c67344595
This commit is contained in:
parent
5bc3c0c1f8
commit
135742823e
|
@ -123,8 +123,8 @@ public class Watcher {
|
||||||
|
|
||||||
// adding the watcher privileges to shield
|
// adding the watcher privileges to shield
|
||||||
if (Shield.enabled(settings)) {
|
if (Shield.enabled(settings)) {
|
||||||
Shield.registerClusterPrivilege("manage_watcher", "cluster:admin/watcher/*", "cluster:monitor/watcher/*");
|
Shield.registerClusterPrivilege("manage_watcher", "cluster:admin/xpack/watcher/*", "cluster:monitor/xpack/watcher/*");
|
||||||
Shield.registerClusterPrivilege("monitor_watcher", "cluster:monitor/watcher/*");
|
Shield.registerClusterPrivilege("monitor_watcher", "cluster:monitor/xpack/watcher/*");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class AckWatchAction extends Action<AckWatchRequest, AckWatchResponse, AckWatchRequestBuilder> {
|
public class AckWatchAction extends Action<AckWatchRequest, AckWatchResponse, AckWatchRequestBuilder> {
|
||||||
|
|
||||||
public static final AckWatchAction INSTANCE = new AckWatchAction();
|
public static final AckWatchAction INSTANCE = new AckWatchAction();
|
||||||
public static final String NAME = "cluster:admin/watcher/watch/ack";
|
public static final String NAME = "cluster:admin/xpack/watcher/watch/ack";
|
||||||
|
|
||||||
private AckWatchAction() {
|
private AckWatchAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class ActivateWatchAction extends Action<ActivateWatchRequest, ActivateWatchResponse, ActivateWatchRequestBuilder> {
|
public class ActivateWatchAction extends Action<ActivateWatchRequest, ActivateWatchResponse, ActivateWatchRequestBuilder> {
|
||||||
|
|
||||||
public static final ActivateWatchAction INSTANCE = new ActivateWatchAction();
|
public static final ActivateWatchAction INSTANCE = new ActivateWatchAction();
|
||||||
public static final String NAME = "cluster:admin/watcher/watch/activate";
|
public static final String NAME = "cluster:admin/xpack/watcher/watch/activate";
|
||||||
|
|
||||||
private ActivateWatchAction() {
|
private ActivateWatchAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class DeleteWatchAction extends Action<DeleteWatchRequest, DeleteWatchResponse, DeleteWatchRequestBuilder> {
|
public class DeleteWatchAction extends Action<DeleteWatchRequest, DeleteWatchResponse, DeleteWatchRequestBuilder> {
|
||||||
|
|
||||||
public static final DeleteWatchAction INSTANCE = new DeleteWatchAction();
|
public static final DeleteWatchAction INSTANCE = new DeleteWatchAction();
|
||||||
public static final String NAME = "cluster:admin/watcher/watch/delete";
|
public static final String NAME = "cluster:admin/xpack/watcher/watch/delete";
|
||||||
|
|
||||||
private DeleteWatchAction() {
|
private DeleteWatchAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class ExecuteWatchAction extends Action<ExecuteWatchRequest, ExecuteWatchResponse, ExecuteWatchRequestBuilder> {
|
public class ExecuteWatchAction extends Action<ExecuteWatchRequest, ExecuteWatchResponse, ExecuteWatchRequestBuilder> {
|
||||||
|
|
||||||
public static final ExecuteWatchAction INSTANCE = new ExecuteWatchAction();
|
public static final ExecuteWatchAction INSTANCE = new ExecuteWatchAction();
|
||||||
public static final String NAME = "cluster:admin/watcher/watch/execute";
|
public static final String NAME = "cluster:admin/xpack/watcher/watch/execute";
|
||||||
|
|
||||||
private ExecuteWatchAction() {
|
private ExecuteWatchAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class GetWatchAction extends org.elasticsearch.action.Action<GetWatchRequest, GetWatchResponse, GetWatchRequestBuilder> {
|
public class GetWatchAction extends org.elasticsearch.action.Action<GetWatchRequest, GetWatchResponse, GetWatchRequestBuilder> {
|
||||||
|
|
||||||
public static final GetWatchAction INSTANCE = new GetWatchAction();
|
public static final GetWatchAction INSTANCE = new GetWatchAction();
|
||||||
public static final String NAME = "cluster:monitor/watcher/watch/get";
|
public static final String NAME = "cluster:monitor/xpack/watcher/watch/get";
|
||||||
|
|
||||||
private GetWatchAction() {
|
private GetWatchAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class PutWatchAction extends Action<PutWatchRequest, PutWatchResponse, PutWatchRequestBuilder> {
|
public class PutWatchAction extends Action<PutWatchRequest, PutWatchResponse, PutWatchRequestBuilder> {
|
||||||
|
|
||||||
public static final PutWatchAction INSTANCE = new PutWatchAction();
|
public static final PutWatchAction INSTANCE = new PutWatchAction();
|
||||||
public static final String NAME = "cluster:admin/watcher/watch/put";
|
public static final String NAME = "cluster:admin/xpack/watcher/watch/put";
|
||||||
|
|
||||||
private PutWatchAction() {
|
private PutWatchAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class WatcherServiceAction extends Action<WatcherServiceRequest, WatcherServiceResponse, WatcherServiceRequestBuilder> {
|
public class WatcherServiceAction extends Action<WatcherServiceRequest, WatcherServiceResponse, WatcherServiceRequestBuilder> {
|
||||||
|
|
||||||
public static final WatcherServiceAction INSTANCE = new WatcherServiceAction();
|
public static final WatcherServiceAction INSTANCE = new WatcherServiceAction();
|
||||||
public static final String NAME = "cluster:admin/watcher/service";
|
public static final String NAME = "cluster:admin/xpack/watcher/service";
|
||||||
|
|
||||||
private WatcherServiceAction() {
|
private WatcherServiceAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.elasticsearch.client.ElasticsearchClient;
|
||||||
public class WatcherStatsAction extends Action<WatcherStatsRequest, WatcherStatsResponse, WatcherStatsRequestBuilder> {
|
public class WatcherStatsAction extends Action<WatcherStatsRequest, WatcherStatsResponse, WatcherStatsRequestBuilder> {
|
||||||
|
|
||||||
public static final WatcherStatsAction INSTANCE = new WatcherStatsAction();
|
public static final WatcherStatsAction INSTANCE = new WatcherStatsAction();
|
||||||
public static final String NAME = "cluster:monitor/watcher/stats";
|
public static final String NAME = "cluster:monitor/xpack/watcher/stats";
|
||||||
|
|
||||||
private WatcherStatsAction() {
|
private WatcherStatsAction() {
|
||||||
super(NAME);
|
super(NAME);
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// transport_client is the default user
|
// transport_client is the default user
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:monitor/watcher/stats] is unauthorized for user [transport_client]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:monitor/xpack/watcher/stats] is unauthorized for user [transport_client]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:monitor/watcher/stats] is unauthorized for user [test]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:monitor/xpack/watcher/stats] is unauthorized for user [test]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -70,7 +70,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:monitor/watcher/watch/get] is unauthorized for user [test]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:monitor/xpack/watcher/watch/get] is unauthorized for user [test]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// stats and get watch are allowed by role monitor:
|
// stats and get watch are allowed by role monitor:
|
||||||
|
@ -89,7 +89,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:admin/watcher/watch/put] is unauthorized for user [monitor]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:admin/xpack/watcher/watch/put] is unauthorized for user [monitor]"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:admin/watcher/watch/put] is unauthorized for user [test]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:admin/xpack/watcher/watch/put] is unauthorized for user [test]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TriggerEvent triggerEvent = new ScheduleTriggerEvent(new DateTime(UTC), new DateTime(UTC));
|
TriggerEvent triggerEvent = new ScheduleTriggerEvent(new DateTime(UTC), new DateTime(UTC));
|
||||||
|
@ -112,7 +112,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:admin/watcher/watch/execute] is unauthorized for user [test]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:admin/xpack/watcher/watch/execute] is unauthorized for user [test]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -120,7 +120,7 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.get();
|
.get();
|
||||||
fail("authentication failure should have occurred");
|
fail("authentication failure should have occurred");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
assertThat(e.getMessage(), equalTo("action [cluster:admin/watcher/watch/delete] is unauthorized for user [test]"));
|
assertThat(e.getMessage(), equalTo("action [cluster:admin/xpack/watcher/watch/delete] is unauthorized for user [test]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// put, execute and delete watch apis are allowed by role admin:
|
// put, execute and delete watch apis are allowed by role admin:
|
||||||
|
|
Loading…
Reference in New Issue