private static void verifyCoprocessors(ObserverContext<MasterCoprocessorEnvironment> ctx,
    TableDescriptor htd) throws IOException {
    Collection<String> paths = ctx.getEnvironment().getConfiguration()
      .getStringCollection(CP_COPROCESSOR_WHITELIST_PATHS_KEY);
    for (CoprocessorDescriptor cp : htd.getCoprocessorDescriptors()) {
      if (cp.getJarPath().isPresent()) {
        if (paths.stream().noneMatch(p -> {
          Path wlPath = new Path(p);
          if (validatePath(new Path(cp.getJarPath().get()), wlPath)) {
            LOG.debug(String.format("Coprocessor %s found in directory %s", cp.getClassName(), p));
            return true;
          }
          return false;
        })) {
          throw new IOException(String.format("Loading %s DENIED in %s", cp.getClassName(),
            CP_COPROCESSOR_WHITELIST_PATHS_KEY));
        }
      }
    }
  }
Perform the validation checks for a coprocessor to determine if the path is white listed or
not.
@throws IOException if path is not included in whitelist or a failure occurs in processing
@param ctx as passed in from the coprocessor
@param htd as passed in from the coprocessor
hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/CoprocessorWhitelistMasterObserver.java