Skip to content
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

Merged
merged 18 commits into from
Jun 21, 2024

Conversation

kodjo-anipah
Copy link
Contributor

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

@kodjo-anipah kodjo-anipah self-assigned this May 27, 2024
@bernd
Copy link
Member

bernd commented May 28, 2024

@kodjo-anipah We already have the "scoped database entities" concept. Can we use it for your use case?

@@ -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 -> {
Copy link
Member

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.

ousmaneo and others added 10 commits June 7, 2024 14:22
* 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
@kodjo-anipah kodjo-anipah requested a review from bernd June 12, 2024 19:11
Copy link
Member

@bernd bernd left a 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.

@bernd bernd merged commit 9508dfc into cold-tier Jun 21, 2024
6 checks passed
@bernd bernd deleted the stream_based_dwh_config branch June 21, 2024 13:55
bernd added a commit that referenced this pull request Jun 26, 2024
* 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>
ousmaneo added a commit that referenced this pull request Jun 26, 2024
#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants