-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support AWS custom Input UI in Forwarder #736
Conversation
@cobaltclaudia @waab76 I added you for review since you have more knowledge about this code than we do. Let me know if you see any concerns with the general approach as well. We could send the final form data to the AWS plugin backend if we needed to do some extra verification or transformation of the data (all the Forwarder code cares about is receiving an Input back that can be saved), but I thought this was not needed at this point. I think this Input should run on the cloud side at some point, since it seems that running it on the Forwarder is an unnecessary redirect. At the moment we have no good way of achieving that, so this is still better than nothing. |
- Clean up `Routes` object, since only one route in that object was being mounted and used - Remove unused props from the previous cleanup
- Move state update in `CloudWatch` inside `useEffect` - Fix linter errors in `CloudWatch` - Move styled component outside of render in `AWSAuthenticationTypes`, since that caused a console error
So far the custom Input UI was meant to be run in a full page on its own, but in Forwarders we will embed that UI into another page. The biggest change is removing page headers, but we may also do some styling or other modifications eventually.
This converts the form data into a generic InputCreate request that can be submitted to other resources, like the regular Inputs API or the Forwarder API.
We don't use flow annotations on this plugin.
47c1b80
to
7f3f6c8
Compare
Making tests easier to read and avoiding so much repetition.
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.
I have to admit, I'm not super familiar with this code. That said, I don't see any obvious issues.
Merged. thank @edmundoa |
* Bump package.json version to 4.0.0-rc.2 * [graylog-plugin-integrations] prepare release 4.0.0-rc.2 * Bump package.json version to 4.0.0-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Change license to SSPL (#654) See the following links for more details: - https://www.graylog.org/post/graylog-announces-4-0-release-of-its-log-management-platform - https://www.graylog.org/post/graylog-v4-0-licensing-sspl * Bump package.json version to 4.0.0 * [graylog-plugin-integrations] prepare release 4.0.0 * Bump package.json version to 4.0.1-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Slack Notification Plugin - add field Message Backlog Limit. (#639) (#659) * add backlog size in ui and adjust names * update unit tests * added debug statements * fix failing junit test * add input group for backlog size field * toggle backlog item messages * slack message backlog description * min and max backlog message size * added junit test for backlog * backlog textfield is numeric * null check and fix unit test * fix CheckReturnValue error in unit test * code clean up * pr feedback * remove backlog from slack message payload * reformat code * fix junit assert expectations * add code comments and fix unit test * reset default backlog size, fix help message * add ui field for toggling * toggling backlog * disable message backlog override * add min value and help block description * Update src/main/java/org/graylog/integrations/notifications/types/SlackEventNotification.java Co-authored-by: Bernd Ahlers <[email protected]> * making max limit to 50 * help block description * set max value * verbiage fix * refine help block * fix label for backlog * custom message description fix * custom message help block , invalid template error message * refine control label text * Update src/web/event-notifications/event-notification-types/SlackNotificationForm.jsx Co-authored-by: Rob Curtis <[email protected]> * fix label for message backlog * fix license header * Update src/test/java/org/graylog/integrations/notifications/types/SlackClientTest.java Co-authored-by: Rob Curtis <[email protected]> * fix unit test * remove max value * pf feedback * pr feedback * remove backlog references * backlog cannot be less than 0 * code and unit test clean up * fix comment * limit backlog when number is greater than zero * Update src/main/java/org/graylog/integrations/notifications/types/SlackEventNotification.java Co-authored-by: Rob Curtis <[email protected]> * ignoring failing junit test * Update src/web/event-notifications/event-notification-types/SlackNotificationForm.jsx Co-authored-by: Rob Curtis <[email protected]> * refine exception handling and enable ignored unit test * fix spacing * junit clean up * add unit test for exception scenario * import cleanup * cleanup unit test * reformat code, optimize imports, increase junit test coverage * seperate exception blocks to handle temporary,permanent,runtime exceptions * fix exception mapping * pr feedback * remove log.error * fix comment Co-authored-by: Bernd Ahlers <[email protected]> Co-authored-by: Rob Curtis <[email protected]> Co-authored-by: Bernd Ahlers <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Backport #658 to 4.0.1 (#663) * Update Slack plugin to allow Discord webhooks (#661) (#665) * Update Slack plugin to allow Discord webhooks with Slack formatting * Expand Discord url support * Bump package.json version to 4.0.1 * [graylog-plugin-integrations] prepare release 4.0.1 * Bump package.json version to 4.0.2-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Disable cloudwatch on cloud Do not register cloudwatch input on cloud environments, since that is not supported yet. Fixes Graylog2/graylog-plugin-cloud#619 * Update Guice config to split forwarder and server (#686) * Sync cloud 4.0 (#712) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration Co-authored-by: Jenkins <[email protected]> * Sync cloud 4.0 (#739) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Initial version of USERID parsing for Palo9x input (#719) (#729) * Bump package.json version to 4.0.3 * [graylog-plugin-integrations] prepare release 4.0.3 * Bump package.json version to 4.0.4-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Refactor PaloAltoTypeParser to improve performance (#737) Refs #726 Co-authored-by: Jenkins <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Support AWS custom Input UI in Forwarder (#736) * Re-enable AWS input for cloud * Clean up URLs - Clean up `Routes` object, since only one route in that object was being mounted and used - Remove unused props from the previous cleanup * Update Icon name * Fix issues in components - Move state update in `CloudWatch` inside `useEffect` - Fix linter errors in `CloudWatch` - Move styled component outside of render in `AWSAuthenticationTypes`, since that caused a console error * Provide an embeddable version of CloudWatchApp So far the custom Input UI was meant to be run in a full page on its own, but in Forwarders we will embed that UI into another page. The biggest change is removing page headers, but we may also do some styling or other modifications eventually. * Set up test environment * Add option to submit Input externally This converts the form data into a generic InputCreate request that can be submitted to other resources, like the regular Inputs API or the Forwarder API. * Use formDataAdapter to AWS requests from form data * Add frontend test to maven build * Remove flow check from build We don't use flow annotations on this plugin. * Move form data into a fixture Making tests easier to read and avoiding so much repetition. * Sync cloud 4.0 (#748) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Initial version of USERID parsing for Palo9x input (#719) (#729) * Bump package.json version to 4.0.3 * [graylog-plugin-integrations] prepare release 4.0.3 * Bump package.json version to 4.0.4-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Refactor PaloAltoTypeParser to improve performance (#737) Refs #726 * Bump package.json version to 4.0.4 * [graylog-plugin-integrations] prepare release 4.0.4 * Bump package.json version to 4.0.5-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Bump package.json version to 4.0.5 * [graylog-plugin-integrations] prepare release 4.0.5 * Bump package.json version to 4.0.6-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration Co-authored-by: Jenkins <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Bump elliptic to 6.5.4 (#771) Fixes: GHSA-r9p9-mrjm-926w * Sync cloud 4.0 (#797) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Initial version of USERID parsing for Palo9x input (#719) (#729) * Bump package.json version to 4.0.3 * [graylog-plugin-integrations] prepare release 4.0.3 * Bump package.json version to 4.0.4-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Refactor PaloAltoTypeParser to improve performance (#737) Refs #726 * Bump package.json version to 4.0.4 * [graylog-plugin-integrations] prepare release 4.0.4 * Bump package.json version to 4.0.5-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Bump package.json version to 4.0.5 * [graylog-plugin-integrations] prepare release 4.0.5 * Bump package.json version to 4.0.6-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Bump package.json version to 4.0.6 * [graylog-plugin-integrations] prepare release 4.0.6 * Bump package.json version to 4.0.7-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration Co-authored-by: Jenkins <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Update web configuration * Fix test Co-authored-by: Jenkins <[email protected]> Co-authored-by: Bernd Ahlers <[email protected]> Co-authored-by: Priya <[email protected]> Co-authored-by: Rob Curtis <[email protected]> Co-authored-by: Marco Pfatschbacher <[email protected]> Co-authored-by: Donald Morton <[email protected]>
…s#823) * Bump package.json version to 4.0.0-rc.2 * [graylog-plugin-integrations] prepare release 4.0.0-rc.2 * Bump package.json version to 4.0.0-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Change license to SSPL (Graylog2/graylog-plugin-integrations#654) See the following links for more details: - https://www.graylog.org/post/graylog-announces-4-0-release-of-its-log-management-platform - https://www.graylog.org/post/graylog-v4-0-licensing-sspl * Bump package.json version to 4.0.0 * [graylog-plugin-integrations] prepare release 4.0.0 * Bump package.json version to 4.0.1-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Slack Notification Plugin - add field Message Backlog Limit. (Graylog2/graylog-plugin-integrations#639) (Graylog2/graylog-plugin-integrations#659) * add backlog size in ui and adjust names * update unit tests * added debug statements * fix failing junit test * add input group for backlog size field * toggle backlog item messages * slack message backlog description * min and max backlog message size * added junit test for backlog * backlog textfield is numeric * null check and fix unit test * fix CheckReturnValue error in unit test * code clean up * pr feedback * remove backlog from slack message payload * reformat code * fix junit assert expectations * add code comments and fix unit test * reset default backlog size, fix help message * add ui field for toggling * toggling backlog * disable message backlog override * add min value and help block description * Update src/main/java/org/graylog/integrations/notifications/types/SlackEventNotification.java Co-authored-by: Bernd Ahlers <[email protected]> * making max limit to 50 * help block description * set max value * verbiage fix * refine help block * fix label for backlog * custom message description fix * custom message help block , invalid template error message * refine control label text * Update src/web/event-notifications/event-notification-types/SlackNotificationForm.jsx Co-authored-by: Rob Curtis <[email protected]> * fix label for message backlog * fix license header * Update src/test/java/org/graylog/integrations/notifications/types/SlackClientTest.java Co-authored-by: Rob Curtis <[email protected]> * fix unit test * remove max value * pf feedback * pr feedback * remove backlog references * backlog cannot be less than 0 * code and unit test clean up * fix comment * limit backlog when number is greater than zero * Update src/main/java/org/graylog/integrations/notifications/types/SlackEventNotification.java Co-authored-by: Rob Curtis <[email protected]> * ignoring failing junit test * Update src/web/event-notifications/event-notification-types/SlackNotificationForm.jsx Co-authored-by: Rob Curtis <[email protected]> * refine exception handling and enable ignored unit test * fix spacing * junit clean up * add unit test for exception scenario * import cleanup * cleanup unit test * reformat code, optimize imports, increase junit test coverage * seperate exception blocks to handle temporary,permanent,runtime exceptions * fix exception mapping * pr feedback * remove log.error * fix comment Co-authored-by: Bernd Ahlers <[email protected]> Co-authored-by: Rob Curtis <[email protected]> Co-authored-by: Bernd Ahlers <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Backport Graylog2/graylog-plugin-integrations#658 to 4.0.1 (Graylog2/graylog-plugin-integrations#663) * Update Slack plugin to allow Discord webhooks (Graylog2/graylog-plugin-integrations#661) (Graylog2/graylog-plugin-integrations#665) * Update Slack plugin to allow Discord webhooks with Slack formatting * Expand Discord url support * Bump package.json version to 4.0.1 * [graylog-plugin-integrations] prepare release 4.0.1 * Bump package.json version to 4.0.2-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Disable cloudwatch on cloud Do not register cloudwatch input on cloud environments, since that is not supported yet. Fixes Graylog2/graylog-plugin-cloudGraylog2/graylog-plugin-integrations#619 * Update Guice config to split forwarder and server (Graylog2/graylog-plugin-integrations#686) * Sync cloud 4.0 (Graylog2/graylog-plugin-integrations#712) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration Co-authored-by: Jenkins <[email protected]> * Sync cloud 4.0 (Graylog2/graylog-plugin-integrations#739) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Initial version of USERID parsing for Palo9x input (Graylog2/graylog-plugin-integrations#719) (Graylog2/graylog-plugin-integrations#729) * Bump package.json version to 4.0.3 * [graylog-plugin-integrations] prepare release 4.0.3 * Bump package.json version to 4.0.4-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Refactor PaloAltoTypeParser to improve performance (Graylog2/graylog-plugin-integrations#737) Refs Graylog2/graylog-plugin-integrations#726 Co-authored-by: Jenkins <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Support AWS custom Input UI in Forwarder (Graylog2/graylog-plugin-integrations#736) * Re-enable AWS input for cloud * Clean up URLs - Clean up `Routes` object, since only one route in that object was being mounted and used - Remove unused props from the previous cleanup * Update Icon name * Fix issues in components - Move state update in `CloudWatch` inside `useEffect` - Fix linter errors in `CloudWatch` - Move styled component outside of render in `AWSAuthenticationTypes`, since that caused a console error * Provide an embeddable version of CloudWatchApp So far the custom Input UI was meant to be run in a full page on its own, but in Forwarders we will embed that UI into another page. The biggest change is removing page headers, but we may also do some styling or other modifications eventually. * Set up test environment * Add option to submit Input externally This converts the form data into a generic InputCreate request that can be submitted to other resources, like the regular Inputs API or the Forwarder API. * Use formDataAdapter to AWS requests from form data * Add frontend test to maven build * Remove flow check from build We don't use flow annotations on this plugin. * Move form data into a fixture Making tests easier to read and avoiding so much repetition. * Sync cloud 4.0 (Graylog2/graylog-plugin-integrations#748) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Initial version of USERID parsing for Palo9x input (Graylog2/graylog-plugin-integrations#719) (Graylog2/graylog-plugin-integrations#729) * Bump package.json version to 4.0.3 * [graylog-plugin-integrations] prepare release 4.0.3 * Bump package.json version to 4.0.4-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Refactor PaloAltoTypeParser to improve performance (Graylog2/graylog-plugin-integrations#737) Refs Graylog2/graylog-plugin-integrations#726 * Bump package.json version to 4.0.4 * [graylog-plugin-integrations] prepare release 4.0.4 * Bump package.json version to 4.0.5-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Bump package.json version to 4.0.5 * [graylog-plugin-integrations] prepare release 4.0.5 * Bump package.json version to 4.0.6-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration Co-authored-by: Jenkins <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Bump elliptic to 6.5.4 (Graylog2/graylog-plugin-integrations#771) Fixes: GHSA-r9p9-mrjm-926w * Sync cloud 4.0 (Graylog2/graylog-plugin-integrations#797) * Bump package.json version to 4.0.2 * [graylog-plugin-integrations] prepare release 4.0.2 * Bump package.json version to 4.0.3-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Initial version of USERID parsing for Palo9x input (Graylog2/graylog-plugin-integrations#719) (Graylog2/graylog-plugin-integrations#729) * Bump package.json version to 4.0.3 * [graylog-plugin-integrations] prepare release 4.0.3 * Bump package.json version to 4.0.4-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Refactor PaloAltoTypeParser to improve performance (Graylog2/graylog-plugin-integrations#737) Refs Graylog2/graylog-plugin-integrations#726 * Bump package.json version to 4.0.4 * [graylog-plugin-integrations] prepare release 4.0.4 * Bump package.json version to 4.0.5-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Bump package.json version to 4.0.5 * [graylog-plugin-integrations] prepare release 4.0.5 * Bump package.json version to 4.0.6-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration * Bump package.json version to 4.0.6 * [graylog-plugin-integrations] prepare release 4.0.6 * Bump package.json version to 4.0.7-SNAPSHOT * [graylog-plugin-integrations] prepare for next development iteration Co-authored-by: Jenkins <[email protected]> Co-authored-by: Rob Curtis <[email protected]> * Update web configuration * Fix test Co-authored-by: Jenkins <[email protected]> Co-authored-by: Bernd Ahlers <[email protected]> Co-authored-by: Priya <[email protected]> Co-authored-by: Rob Curtis <[email protected]> Co-authored-by: Marco Pfatschbacher <[email protected]> Co-authored-by: Donald Morton <[email protected]>
This PR adapts the existing AWS custom Input UI for the Forwarder. The main changes consist in:
Needs https://github.com/Graylog2/graylog-plugin-cloud/pull/741 for the forwarder input UI to work.
/jenkins-pr-deps Graylog2/graylog2-server#10072,Graylog2/graylog-plugin-cloud#741