Skip to content

Commit

Permalink
Adjust versions for yaml test of clearing app privileges cache (#58886)
Browse files Browse the repository at this point in the history
The version needs to be adjusted to v7.9.0 after backport #58798
  • Loading branch information
ywangd authored Jul 3, 2020
1 parent 50ed781 commit 2a0010e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,14 @@ public NativePrivilegeStore(Settings settings, Client client, SecurityIndexManag
public void getPrivileges(Collection<String> applications, Collection<String> names,
ActionListener<Collection<ApplicationPrivilegeDescriptor>> listener) {

// TODO: We should have a way to express true Zero applications
final Set<String> applicationNamesCacheKey = (isEmpty(applications) || applications.contains("*")) ?
Set.of("*") : Set.copyOf(applications);

// Always fetch for the concrete application names even when the passed-in application names has no wildcard.
// This serves as a negative lookup, i.e. when a passed-in non-wildcard application does not exist.
Set<String> concreteApplicationNames = applicationNamesCache == null ? null : applicationNamesCache.get(applicationNamesCacheKey);

if (concreteApplicationNames != null && concreteApplicationNames.size() == 0) {
if (concreteApplicationNames != null && concreteApplicationNames.isEmpty()) {
logger.debug("returning empty application privileges for [{}] as application names result in empty list",
applicationNamesCacheKey);
listener.onResponse(Collections.emptySet());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ teardown:
---
"Test clear privileges cache":
- skip:
version: " - 7.99.99"
reason: "backport pending https://github.com/elastic/elasticsearch/pull/55836"
version: " - 7.8.99"
reason: "application privileges cache is available since 7.9.0"

- do:
security.clear_cached_privileges:
Expand Down

0 comments on commit 2a0010e

Please sign in to comment.