security: use correct time unit for role cache expire after write

The role cache was previously using the wrong time unit for its expire after write time; the
value passed to the cache was milliseconds instead of nanoseconds.

Original commit: elastic/x-pack-elasticsearch@65f7b08763
This commit is contained in:
Jay Modi 2016-10-12 08:04:49 -04:00 committed by GitHub
parent 7ba55a4c99
commit 6284db3a4d
1 changed files with 1 additions and 1 deletions

View File

@ -135,7 +135,7 @@ public class NativeRolesStore extends AbstractComponent implements RolesStore, C
this.client = client;
this.roleCache = CacheBuilder.<String, RoleAndVersion>builder()
.setMaximumWeight(CACHE_SIZE_SETTING.get(settings))
.setExpireAfterWrite(CACHE_TTL_SETTING.get(settings).getMillis())
.setExpireAfterWrite(CACHE_TTL_SETTING.get(settings).getNanos())
.build();
this.isTribeNode = settings.getGroups("tribe", true).isEmpty() == false;
}