-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduced concept of stream guard to throw an exception on invalid s… #19454
Conversation
…tream deletion requests
@kodjo-anipah We already have the "scoped database entities" concept. Can we use it for your use case? |
...og2-server/src/main/java/org/graylog2/rest/resources/streams/DefaultStreamDeletionGuard.java
Outdated
Show resolved
Hide resolved
...og2-server/src/main/java/org/graylog2/rest/resources/streams/DefaultStreamDeletionGuard.java
Outdated
Show resolved
Hide resolved
@@ -378,6 +381,13 @@ public void delete(@ApiParam(name = "streamId", required = true) @PathParam("str | |||
private Stream deleteInner(String streamId, UserContext userContext) throws NotFoundException { | |||
checkPermission(RestPermissions.STREAMS_EDIT, streamId); | |||
checkNotEditableStream(streamId, "The stream cannot be deleted."); | |||
streamDeletionGuards.forEach(guard -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move the stream guard checks into the StreamService
to ensure we apply the guards for all stream deletions, not only the deletions via HTTP API.
* add api to get all connected piplines for a stream id * Add stream details page - add Stream pipeline list * update StreamDetailsPage * add alignActionsLeft to Section * add stream dataWarehouse - update design * fix StreamResource.java * add Mantine Text component * update StreamOverview - add TitleCell - hide description - update styles * Update stream details - fix linter error * fix linter * fix StreamOverview test * fix linters * fix linter * fix review * fix description * disable details button for not editable stream --------- Co-authored-by: Maxwell Anipah <maxwell.anipah@graylog.com> Co-authored-by: Maxwell <98284293+kodjo-anipah@users.noreply.github.com>
…ream_based_dwh_config # Conflicts: # graylog2-server/src/main/java/org/graylog2/rest/resources/streams/StreamResource.java
…ream_based_dwh_config
graylog2-server/src/main/java/org/graylog2/contentpacks/facades/StreamFacade.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/database/PersistedServiceImpl.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/plugin/inject/Graylog2Module.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fixes! 🙏 The backend looks good now.
* Add data warehouse metrics mappings to the default Prometheus exporter * Introduced the concept of stream guard to throw an exception on invalid stream deletion requests (#19454) * Implement Stream details page (#19342) * Add API to get all connected pipelines for a stream ID * Add StreamService#loadStreamTitles * Add PluginModule#addStreamDeletion guard method Co-authored-by: Maxwell Anipah <maxwell.anipah@graylog.com> Co-authored-by: Maxwell <98284293+kodjo-anipah@users.noreply.github.com> Co-authored-by: Ousmane SAMBA <ousmane@graylog.com> Co-authored-by: Mohamed OULD HOCINE <106236152+gally47@users.noreply.github.com> Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>
#19454) * introduced concept of stream guard to throw an exception on invalid stream deletion requests * Implement Stream details page (#19342) * add api to get all connected piplines for a stream id * Add stream details page - add Stream pipeline list * update StreamDetailsPage * add alignActionsLeft to Section * add stream dataWarehouse - update design * fix StreamResource.java * add Mantine Text component * update StreamOverview - add TitleCell - hide description - update styles * Update stream details - fix linter error * fix linter * fix StreamOverview test * fix linters * fix linter * fix review * fix description * disable details button for not editable stream --------- Co-authored-by: Maxwell Anipah <maxwell.anipah@graylog.com> Co-authored-by: Maxwell <98284293+kodjo-anipah@users.noreply.github.com> * move stream guard to service class and add test * move out streamGuardException inner class * add license header * clean up * remove unused import --------- Co-authored-by: Ousmane SAMBA <ousmane@graylog.com> Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com> Co-authored-by: Ousmane Samba <ousmanesamba@gmail.com>
Added stream deletion guard concept so that we can check in the enterprise plugin whether the stream should be allowed for deletion or not.
/nocl
/prd https://github.com/Graylog2/graylog-plugin-enterprise/pull/7260