change shield in log messages to security
Original commit: elastic/x-pack-elasticsearch@9c5acc488a
This commit is contained in:
parent
759d99de9c
commit
03be6e3a62
|
@ -218,7 +218,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
if (t instanceof IndexNotFoundException) {
|
if (t instanceof IndexNotFoundException) {
|
||||||
logger.trace("could not retrieve users because shield index does not exist");
|
logger.trace("could not retrieve users because security index does not exist");
|
||||||
} else {
|
} else {
|
||||||
logger.info("failed to retrieve users", t);
|
logger.info("failed to retrieve users", t);
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
if (t instanceof IndexNotFoundException) {
|
if (t instanceof IndexNotFoundException) {
|
||||||
logger.trace("could not retrieve user because shield index does not exist", t);
|
logger.trace("could not retrieve user because security index does not exist", t);
|
||||||
} else {
|
} else {
|
||||||
logger.info("failed to retrieve user", t);
|
logger.info("failed to retrieve user", t);
|
||||||
}
|
}
|
||||||
|
@ -279,7 +279,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (IndexNotFoundException infe) {
|
} catch (IndexNotFoundException infe) {
|
||||||
logger.trace("could not retrieve user because shield index does not exist");
|
logger.trace("could not retrieve user because security index does not exist");
|
||||||
listener.onResponse(null);
|
listener.onResponse(null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("unable to retrieve user", e);
|
logger.error("unable to retrieve user", e);
|
||||||
|
@ -361,7 +361,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
|
|
||||||
if (clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) {
|
if (clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) {
|
||||||
// wait until the gateway has recovered from disk, otherwise we
|
// wait until the gateway has recovered from disk, otherwise we
|
||||||
// think may not have the .shield index but they it may not have
|
// think may not have the .security index but they it may not have
|
||||||
// been restored from the cluster state on disk yet
|
// been restored from the cluster state on disk yet
|
||||||
logger.debug("native users store waiting until gateway has recovered from disk");
|
logger.debug("native users store waiting until gateway has recovered from disk");
|
||||||
return false;
|
return false;
|
||||||
|
@ -375,12 +375,12 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
|
|
||||||
IndexMetaData metaData = clusterState.metaData().index(ShieldTemplateService.SECURITY_INDEX_NAME);
|
IndexMetaData metaData = clusterState.metaData().index(ShieldTemplateService.SECURITY_INDEX_NAME);
|
||||||
if (metaData == null) {
|
if (metaData == null) {
|
||||||
logger.debug("shield user index [{}] does not exist, so service can start", ShieldTemplateService.SECURITY_INDEX_NAME);
|
logger.debug("security index [{}] does not exist, so service can start", ShieldTemplateService.SECURITY_INDEX_NAME);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clusterState.routingTable().index(ShieldTemplateService.SECURITY_INDEX_NAME).allPrimaryShardsActive()) {
|
if (clusterState.routingTable().index(ShieldTemplateService.SECURITY_INDEX_NAME).allPrimaryShardsActive()) {
|
||||||
logger.debug("shield user index [{}] all primary shards started, so service can start",
|
logger.debug("security index [{}] all primary shards started, so service can start",
|
||||||
ShieldTemplateService.SECURITY_INDEX_NAME);
|
ShieldTemplateService.SECURITY_INDEX_NAME);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -399,7 +399,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
try {
|
try {
|
||||||
poller.doRun();
|
poller.doRun();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn("failed to do initial poll of shield users", e);
|
logger.warn("failed to do initial poll of users", e);
|
||||||
}
|
}
|
||||||
versionChecker = threadPool.scheduleWithFixedDelay(poller,
|
versionChecker = threadPool.scheduleWithFixedDelay(poller,
|
||||||
settings.getAsTime("shield.authc.native.reload.interval", TimeValue.timeValueSeconds(30L)));
|
settings.getAsTime("shield.authc.native.reload.interval", TimeValue.timeValueSeconds(30L)));
|
||||||
|
@ -476,7 +476,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
final boolean exists = event.state().metaData().indices().get(ShieldTemplateService.SECURITY_INDEX_NAME) != null;
|
final boolean exists = event.state().metaData().indices().get(ShieldTemplateService.SECURITY_INDEX_NAME) != null;
|
||||||
// make sure all the primaries are active
|
// make sure all the primaries are active
|
||||||
if (exists && event.state().routingTable().index(ShieldTemplateService.SECURITY_INDEX_NAME).allPrimaryShardsActive()) {
|
if (exists && event.state().routingTable().index(ShieldTemplateService.SECURITY_INDEX_NAME).allPrimaryShardsActive()) {
|
||||||
logger.debug("shield user index [{}] all primary shards started, so polling can start",
|
logger.debug("security index [{}] all primary shards started, so polling can start",
|
||||||
ShieldTemplateService.SECURITY_INDEX_NAME);
|
ShieldTemplateService.SECURITY_INDEX_NAME);
|
||||||
shieldIndexExists = true;
|
shieldIndexExists = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -528,7 +528,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (shieldIndexExists == false) {
|
if (shieldIndexExists == false) {
|
||||||
logger.trace("cannot poll for user changes since shield admin index [{}] does not exist", ShieldTemplateService
|
logger.trace("cannot poll for user changes since security index [{}] does not exist", ShieldTemplateService
|
||||||
.SECURITY_INDEX_NAME);
|
.SECURITY_INDEX_NAME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -635,7 +635,7 @@ public class ESNativeUsersStore extends AbstractComponent implements ClusterStat
|
||||||
keepScrolling = response.getHits().getHits().length > 0;
|
keepScrolling = response.getHits().getHits().length > 0;
|
||||||
}
|
}
|
||||||
} catch (IndexNotFoundException e) {
|
} catch (IndexNotFoundException e) {
|
||||||
logger.trace("shield user index does not exist", e);
|
logger.trace("security index does not exist", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
ClearScrollRequest clearScrollRequest = client.prepareClearScroll().addScrollId(response.getScrollId()).request();
|
ClearScrollRequest clearScrollRequest = client.prepareClearScroll().addScrollId(response.getScrollId()).request();
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class ESNativeRolesStore extends AbstractComponent implements RolesStore,
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable t) {
|
public void onFailure(Throwable t) {
|
||||||
if (t instanceof IndexNotFoundException) {
|
if (t instanceof IndexNotFoundException) {
|
||||||
logger.trace("could not retrieve roles because shield index does not exist");
|
logger.trace("could not retrieve roles because security index does not exist");
|
||||||
} else {
|
} else {
|
||||||
logger.info("failed to retrieve roles", t);
|
logger.info("failed to retrieve roles", t);
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ public class ESNativeRolesStore extends AbstractComponent implements RolesStore,
|
||||||
|
|
||||||
if (clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) {
|
if (clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK)) {
|
||||||
// wait until the gateway has recovered from disk, otherwise we
|
// wait until the gateway has recovered from disk, otherwise we
|
||||||
// think may not have the .shield index but they it may not have
|
// think may not have the .security index but they it may not have
|
||||||
// been restored from the cluster state on disk yet
|
// been restored from the cluster state on disk yet
|
||||||
logger.debug("native roles store waiting until gateway has recovered from disk");
|
logger.debug("native roles store waiting until gateway has recovered from disk");
|
||||||
return false;
|
return false;
|
||||||
|
@ -429,7 +429,7 @@ public class ESNativeRolesStore extends AbstractComponent implements RolesStore,
|
||||||
final boolean exists = event.state().metaData().indices().get(ShieldTemplateService.SECURITY_INDEX_NAME) != null;
|
final boolean exists = event.state().metaData().indices().get(ShieldTemplateService.SECURITY_INDEX_NAME) != null;
|
||||||
// make sure all the primaries are active
|
// make sure all the primaries are active
|
||||||
if (exists && event.state().routingTable().index(ShieldTemplateService.SECURITY_INDEX_NAME).allPrimaryShardsActive()) {
|
if (exists && event.state().routingTable().index(ShieldTemplateService.SECURITY_INDEX_NAME).allPrimaryShardsActive()) {
|
||||||
logger.debug("shield roles index [{}] all primary shards started, so polling can start",
|
logger.debug("security index [{}] all primary shards started, so polling can start",
|
||||||
ShieldTemplateService.SECURITY_INDEX_NAME);
|
ShieldTemplateService.SECURITY_INDEX_NAME);
|
||||||
shieldIndexExists = true;
|
shieldIndexExists = true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -459,7 +459,7 @@ public class ESNativeRolesStore extends AbstractComponent implements RolesStore,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (shieldIndexExists == false) {
|
if (shieldIndexExists == false) {
|
||||||
logger.trace("cannot poll for role changes since shield admin index [{}] does not exist",
|
logger.trace("cannot poll for role changes since security index [{}] does not exist",
|
||||||
ShieldTemplateService.SECURITY_INDEX_NAME);
|
ShieldTemplateService.SECURITY_INDEX_NAME);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -519,7 +519,7 @@ public class ESNativeRolesStore extends AbstractComponent implements RolesStore,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IndexNotFoundException e) {
|
} catch (IndexNotFoundException e) {
|
||||||
logger.trace("shield roles index does not exist", e);
|
logger.trace("security index does not exist", e);
|
||||||
} finally {
|
} finally {
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
ClearScrollRequest clearScrollRequest = client.prepareClearScroll().addScrollId(response.getScrollId()).request();
|
ClearScrollRequest clearScrollRequest = client.prepareClearScroll().addScrollId(response.getScrollId()).request();
|
||||||
|
|
Loading…
Reference in New Issue