@Test public void inheritedRoleWithWhitelistedDataRootDoSelect() { givenRoleIsWhitelisted("inherited", Permission.SELECT, DataResource.root()); givenRolesOfRequest("primary", "inherited"); AuditEntry auditEntry = givenAuditEntry(Collections.singleton(Permission.SELECT), DataResource.fromName("data/ks/tbl")); assertThat(filter.isWhitelisted(auditEntry)).isTrue(); }
@Override public boolean isWhitelisted(AuditEntry logEntry) { RoleAuditFilterCacheKey cacheKey = new RoleAuditFilterCacheKey(logEntry.getUser(), logEntry.getResource(), logEntry.getPermissions()); try { return filterCache.isWhitelisted(cacheKey); } catch (UncheckedExecutionException e) { throw Exceptions.tryGetCassandraExceptionCause(e); } }
RoleAuditFilter implements AuditFilter { @Override public boolean isWhitelisted(AuditEntry logEntry) { RoleAuditFilterCacheKey cacheKey = new RoleAuditFilterCacheKey(logEntry.getUser(), logEntry.getResource(), logEntry.getPermissions()); try { return filterCache.isWhitelisted(cacheKey); } catch (UncheckedExecutionException e) { throw Exceptions.tryGetCassandraExceptionCause(e); } } }
RoleAuditFilter implements AuditFilter { @Override public boolean isWhitelisted(AuditEntry logEntry) { RoleAuditFilterCacheKey cacheKey = new RoleAuditFilterCacheKey(logEntry.getUser(), logEntry.getResource(), logEntry.getPermissions()); try { return filterCache.isWhitelisted(cacheKey); } catch (UncheckedExecutionException e) { throw Exceptions.tryGetCassandraExceptionCause(e); } } RoleAuditFilter(); @VisibleForTesting  RoleAuditFilter(Function<RoleResource, Set<RoleResource>> getRolesFunction, WhitelistDataAccess whitelistDataAccess, AuditFilterAuthorizer auditFilterAuthorizer); }
RoleAuditFilter implements AuditFilter { @Override public boolean isWhitelisted(AuditEntry logEntry) { RoleAuditFilterCacheKey cacheKey = new RoleAuditFilterCacheKey(logEntry.getUser(), logEntry.getResource(), logEntry.getPermissions()); try { return filterCache.isWhitelisted(cacheKey); } catch (UncheckedExecutionException e) { throw Exceptions.tryGetCassandraExceptionCause(e); } } RoleAuditFilter(); @VisibleForTesting  RoleAuditFilter(Function<RoleResource, Set<RoleResource>> getRolesFunction, WhitelistDataAccess whitelistDataAccess, AuditFilterAuthorizer auditFilterAuthorizer); @Override void setup(); @Override boolean isWhitelisted(AuditEntry logEntry); }
RoleAuditFilter implements AuditFilter { @Override public boolean isWhitelisted(AuditEntry logEntry) { RoleAuditFilterCacheKey cacheKey = new RoleAuditFilterCacheKey(logEntry.getUser(), logEntry.getResource(), logEntry.getPermissions()); try { return filterCache.isWhitelisted(cacheKey); } catch (UncheckedExecutionException e) { throw Exceptions.tryGetCassandraExceptionCause(e); } } RoleAuditFilter(); @VisibleForTesting  RoleAuditFilter(Function<RoleResource, Set<RoleResource>> getRolesFunction, WhitelistDataAccess whitelistDataAccess, AuditFilterAuthorizer auditFilterAuthorizer); @Override void setup(); @Override boolean isWhitelisted(AuditEntry logEntry);  }