Skip to content

Commit c149e2b

Browse files
authored
Merge branch 'master' into feat/forwarded-for-httpinput
2 parents c8e9d86 + d7c7d27 commit c149e2b

File tree

249 files changed

+3972
-1344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+3972
-1344
lines changed

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
# under the License.
1717
wrapperVersion=3.3.2
1818
distributionType=only-script
19-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
type = "security"
2+
message = "Fix permission check for creating a new API-token. See [GHSA-3m86-c9x3-vwm9](https://github.com/Graylog2/graylog2-server/security/advisories/GHSA-3m86-c9x3-vwm9) for details."
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type = "f"
2+
message = "Improve structure of auto-correct suggestions in search query input."
3+
4+
pulls = ["22944"]
5+
issues = ["21392"]

changelog/unreleased/pr-22918.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type = "fixed"
2+
message = "Fix editing a existing Event Definition not showing update button."
3+
4+
issues = ["22916"]
5+
pulls = ["22918"]

changelog/unreleased/pr-22942.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type = "a"
2+
message = "Adding pluggable 'aside' element (`views.elements.aside`) which can be used to show right sidebar on search/dashboard pages."
3+
4+
pulls = ["22942"]

data-node/src/main/java/org/graylog/datanode/docs/ConfigurationBeansSPI.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,17 @@
1616
*/
1717
package org.graylog.datanode.docs;
1818

19-
import java.util.ArrayList;
20-
import java.util.Iterator;
19+
import java.util.Collection;
2120
import java.util.List;
2221
import java.util.ServiceLoader;
2322

2423
public class ConfigurationBeansSPI {
2524
public static List<Object> loadConfigurationBeans() {
26-
final ServiceLoader<DocumentedBeansService> configurationBeansLoader = ServiceLoader.load(DocumentedBeansService.class);
27-
final Iterator<DocumentedBeansService> iterator = configurationBeansLoader.iterator();
28-
List<Object> configurationBeans = new ArrayList<>();
29-
while (iterator.hasNext()) {
30-
final DocumentedBeansService service = iterator.next();
31-
configurationBeans.addAll(service.getDocumentedConfigurationBeans());
32-
}
33-
return configurationBeans;
25+
return ServiceLoader.load(DocumentedBeansService.class).stream()
26+
.map(ServiceLoader.Provider::get)
27+
.map(DocumentedBeansService::getDocumentedConfigurationBeans)
28+
.flatMap(Collection::stream)
29+
.distinct()
30+
.toList();
3431
}
3532
}

graylog-project-parent/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@
622622
<plugin>
623623
<groupId>com.mebigfatguy.fb-contrib</groupId>
624624
<artifactId>fb-contrib</artifactId>
625-
<version>7.6.10</version>
625+
<version>7.6.11</version>
626626
</plugin>
627627
</plugins>
628628
</configuration>

graylog2-server/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,10 +793,6 @@
793793
<groupId>io.grpc</groupId>
794794
<artifactId>grpc-services</artifactId>
795795
</dependency>
796-
<dependency>
797-
<groupId>io.opentelemetry.proto</groupId>
798-
<artifactId>opentelemetry-proto</artifactId>
799-
</dependency>
800796

801797
<!-- our basic test libraries, please only add infrastructure dependencies here -->
802798
<dependency>

graylog2-server/src/main/java/org/graylog/events/rest/EventDefinitionsResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ public record GetByIdRequest(List<String> eventDefinitionIds) {}
268268
@ApiOperation("Get multiple event definitions by id")
269269
@NoAuditEvent("Bulk retrieval, no data is changed.")
270270
public List<EventDefinitionDto> getById(@ApiParam(name = "JSON body") @Valid GetByIdRequest request) {
271-
for (String id : request.eventDefinitionIds()) {
272-
checkPermission(RestPermissions.EVENT_DEFINITIONS_READ, id);
273-
}
271+
final Set<String> permittedIds = request.eventDefinitionIds().stream()
272+
.filter(id -> isPermitted(RestPermissions.EVENT_DEFINITIONS_READ, id))
273+
.collect(Collectors.toSet());
274274

275-
return dbService.getByIds(request.eventDefinitionIds());
275+
return dbService.getByIds(permittedIds);
276276
}
277277

278278
@POST

graylog2-server/src/main/java/org/graylog/events/search/EventsSearchService.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public EventsSearchResult search(EventsSearchParameters parameters, Subject subj
9797
}).collect(Collectors.toList());
9898

9999
final EventsSearchResult.Context context = EventsSearchResult.Context.create(
100-
lookupEventDefinitions(eventDefinitionIdsBuilder.build()),
101-
lookupStreams(streamIdsBuilder.build())
100+
lookupEventDefinitions(eventDefinitionIdsBuilder.build(), subject),
101+
lookupStreams(streamIdsBuilder.build(), subject)
102102
);
103103

104104
return EventsSearchResult.builder()
@@ -157,14 +157,18 @@ private Set<String> forbiddenSourceStreams(Subject subject) {
157157
.collect(Collectors.toSet());
158158
}
159159

160-
private Map<String, EventsSearchResult.ContextEntity> lookupStreams(Set<String> streams) {
161-
return streamService.loadByIds(streams)
160+
private Map<String, EventsSearchResult.ContextEntity> lookupStreams(Set<String> streams, final Subject subject) {
161+
final var allowedStreams = streams.stream().filter(streamId -> subject.isPermitted(String.join(":", RestPermissions.STREAMS_READ, streamId))).collect(Collectors.toSet());
162+
163+
return streamService.loadByIds(allowedStreams)
162164
.stream()
163165
.collect(Collectors.toMap(Persisted::getId, s -> EventsSearchResult.ContextEntity.create(s.getId(), s.getTitle(), s.getDescription())));
164166
}
165167

166-
private Map<String, EventsSearchResult.ContextEntity> lookupEventDefinitions(Set<String> eventDefinitions) {
167-
return eventDefinitionService.getByIds(eventDefinitions)
168+
private Map<String, EventsSearchResult.ContextEntity> lookupEventDefinitions(Set<String> eventDefinitions, final Subject subject) {
169+
final var allowedEventDefinitions = eventDefinitions.stream().filter(eventDefinitionId -> subject.isPermitted(String.join(":", RestPermissions.EVENT_DEFINITIONS_READ, eventDefinitionId))).collect(Collectors.toSet());
170+
171+
return eventDefinitionService.getByIds(allowedEventDefinitions)
168172
.stream()
169173
.collect(Collectors.toMap(EventDefinitionDto::id,
170174
d -> EventsSearchResult.ContextEntity.create(d.id(), d.title(), d.description(), d.remediationSteps())));

0 commit comments

Comments
 (0)