Github user janhoy commented on a diff in the pull request:

    https://github.com/apache/lucene-solr/pull/342#discussion_r176802667
  
    --- Diff: solr/core/src/java/org/apache/solr/core/CoreContainer.java ---
    @@ -328,6 +331,38 @@ private synchronized void 
initializeAuthorizationPlugin(Map<String, Object> auth
         }
       }
     
    +  private void initializeAuditloggerPlugin(Map<String, Object> auditConf) {
    +    auditConf = Utils.getDeepCopy(auditConf, 4);
    +    //Initialize the Auditlog module
    +    SecurityPluginHolder<AuditLoggerPlugin> old = auditloggerPlugin;
    +    SecurityPluginHolder<AuditLoggerPlugin> auditloggerPlugin = null;
    +    if (auditConf != null) {
    +      String klas = (String) auditConf.get("class");
    +      if (klas == null) {
    +        throw new SolrException(ErrorCode.SERVER_ERROR, "class is required 
for auditlogger plugin");
    +      }
    +      if (old != null && old.getZnodeVersion() == readVersion(auditConf)) {
    +        return;
    +      }
    +      log.info("Initializing auditlogger plugin: " + klas);
    +      auditloggerPlugin = new 
SecurityPluginHolder<>(readVersion(auditConf),
    +          getResourceLoader().newInstance(klas, AuditLoggerPlugin.class));
    +
    +      // Read and pass the authorization context to the plugin
    +      auditloggerPlugin.plugin.init(auditConf);
    +    } else {
    +      log.debug("Security conf doesn't exist. Skipping setup for audit 
logging module.");
    +    }
    +    this.auditloggerPlugin = auditloggerPlugin;
    +    if (old != null) {
    +      try {
    +        old.plugin.close();
    +      } catch (Exception e) {
    --- End diff --
    
    Hehe, this is a copy-paste from init of authplugin. Guess we could insert a 
`/* ignored */` at the very least to be explicit?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to