SOLR-14198: Nullpointer exception in AuditEvent with AuthorizationContext (#1192)

(cherry picked from commit 75c64089a1)
This commit is contained in:
Jan Høydahl 2020-01-22 21:39:43 +01:00
parent 96863e54e7
commit 1f2212c8d8
2 changed files with 12 additions and 8 deletions

View File

@ -137,6 +137,10 @@ Bug Fixes
* SOLR-13089: Fix lsof edge cases in the solr CLI script (Martijn Koster via janhoy) * SOLR-13089: Fix lsof edge cases in the solr CLI script (Martijn Koster via janhoy)
* SOLR-14198: Nullpointer exception in AuditEvent when initialized from AuthorizationContext (janhoy)
* SOLR-6613: TextField.analyzeMultiTerm does not throw an exception when Analyzer returns no terms. (Bruno Roustant)
* SOLR-14192: Race condition between SchemaManager and ZkIndexSchemaReader. (ab) * SOLR-14192: Race condition between SchemaManager and ZkIndexSchemaReader. (ab)
* SOLR-12859: Fixed DocExpirationUpdateProcessorFactory to work with BasicAuth and other auth plugins * SOLR-12859: Fixed DocExpirationUpdateProcessorFactory to work with BasicAuth and other auth plugins
@ -389,8 +393,6 @@ Bug Fixes
affects splits triggered by the autoscale framework, which use async mode. affects splits triggered by the autoscale framework, which use async mode.
(Megan Carey, Andy Vuong, Bilal Waheed, Ilan Ginzburg, yonik) (Megan Carey, Andy Vuong, Bilal Waheed, Ilan Ginzburg, yonik)
* SOLR-6613: TextField.analyzeMultiTerm does not throw an exception when Analyzer returns no terms. (Bruno Roustant)
Other Changes Other Changes
--------------------- ---------------------

View File

@ -170,10 +170,12 @@ public class AuditEvent {
.stream().map(r -> r.collectionName).collect(Collectors.toList()); .stream().map(r -> r.collectionName).collect(Collectors.toList());
setResource(authorizationContext.getResource()); setResource(authorizationContext.getResource());
this.requestType = RequestType.convertType(authorizationContext.getRequestType()); this.requestType = RequestType.convertType(authorizationContext.getRequestType());
if (authorizationContext.getParams() != null) {
authorizationContext.getParams().forEach(p -> { authorizationContext.getParams().forEach(p -> {
this.solrParams.put(p.getKey(), Arrays.asList(p.getValue())); this.solrParams.put(p.getKey(), Arrays.asList(p.getValue()));
}); });
} }
}
/** /**
* Event to log completed requests. Takes time and status. Solr will fill in details * Event to log completed requests. Takes time and status. Solr will fill in details