@Test public void testQueryComponentAccessQuery() throws Exception { ResponseBuilder responseBuilder = getResponseBuilder(); prepareCollAndUser(core, responseBuilder.req, "queryCollection", "junit"); QueryIndexAuthorizationComponent query = new QueryIndexAuthorizationComponent(sentryInstance); query.prepare(responseBuilder); }
@Override public void prepare(ResponseBuilder rb) throws IOException { sentryInstance.authorizeCollectionAction( rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME); String collections = rb.req.getParams().get("collection"); if (collections != null) { List<String> collectionList = StrUtils.splitSmart(collections, ",", true); for (String coll : collectionList) { sentryInstance.authorizeCollectionAction(rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME, coll, true); } } }
QueryIndexAuthorizationComponent extends SearchComponent { @Override public void prepare(ResponseBuilder rb) throws IOException { sentryInstance.authorizeCollectionAction( rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME); String collections = rb.req.getParams().get("collection"); if (collections != null) { List<String> collectionList = StrUtils.splitSmart(collections, ",", true); for (String coll : collectionList) { sentryInstance.authorizeCollectionAction(rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME, coll, true); } } } }
QueryIndexAuthorizationComponent extends SearchComponent { @Override public void prepare(ResponseBuilder rb) throws IOException { sentryInstance.authorizeCollectionAction( rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME); String collections = rb.req.getParams().get("collection"); if (collections != null) { List<String> collectionList = StrUtils.splitSmart(collections, ",", true); for (String coll : collectionList) { sentryInstance.authorizeCollectionAction(rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME, coll, true); } } } QueryIndexAuthorizationComponent(); @VisibleForTesting  QueryIndexAuthorizationComponent(SentryIndexAuthorizationSingleton sentryInstance); }
QueryIndexAuthorizationComponent extends SearchComponent { @Override public void prepare(ResponseBuilder rb) throws IOException { sentryInstance.authorizeCollectionAction( rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME); String collections = rb.req.getParams().get("collection"); if (collections != null) { List<String> collectionList = StrUtils.splitSmart(collections, ",", true); for (String coll : collectionList) { sentryInstance.authorizeCollectionAction(rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME, coll, true); } } } QueryIndexAuthorizationComponent(); @VisibleForTesting  QueryIndexAuthorizationComponent(SentryIndexAuthorizationSingleton sentryInstance); @Override void prepare(ResponseBuilder rb); @Override void process(ResponseBuilder rb); @Override String getDescription(); @Override String getSource(); }
QueryIndexAuthorizationComponent extends SearchComponent { @Override public void prepare(ResponseBuilder rb) throws IOException { sentryInstance.authorizeCollectionAction( rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME); String collections = rb.req.getParams().get("collection"); if (collections != null) { List<String> collectionList = StrUtils.splitSmart(collections, ",", true); for (String coll : collectionList) { sentryInstance.authorizeCollectionAction(rb.req, EnumSet.of(SearchModelAction.QUERY), OPERATION_NAME, coll, true); } } } QueryIndexAuthorizationComponent(); @VisibleForTesting  QueryIndexAuthorizationComponent(SentryIndexAuthorizationSingleton sentryInstance); @Override void prepare(ResponseBuilder rb); @Override void process(ResponseBuilder rb); @Override String getDescription(); @Override String getSource();  }