Skip to content

Commit dad665f

Browse files
committed
Merge branch 'graylog-6.3.7'
2 parents 23ee8b8 + b16923a commit dad665f

File tree

9 files changed

+2525
-5602
lines changed

9 files changed

+2525
-5602
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [6.3.0](https://github.com/airbus-cyber/graylog-plugin-logging-alert/compare/6.1.7...6.3.0)
6+
### Changes
7+
* Change Graylog minimum version to 6.3.7
8+
9+
510
## [6.1.8](https://github.com/airbus-cyber/graylog-plugin-logging-alert/compare/6.1.7...6.1.8)
611
### Bug Fixes
712
* Fix notification creation error ([issue #60](https://github.com/airbus-cyber/graylog-plugin-logging-alert/issues/60))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Alert example recorded as an internal log message:
2222

2323
| Plugin Version | Graylog Version |
2424
|----------------|-----------------|
25+
| 6.3.x | 6.3.7 |
2526
| 6.1.3+ | 6.1.4+ |
2627
| 6.1.0 to 6.1.2 | 6.1.0+ |
2728
| 6.0.0 | 6.0.x |

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"name": "LoggingAlert",
3-
"version": "6.1.8",
3+
"version": "6.3.0",
44
"description": "Graylog plugin LoggingAlert Web Interface",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/airbus-cyber/graylog-plugin-logging-alert"
88
},
99
"scripts": {
1010
"build": "webpack --bail",
11-
"test": "jest"
11+
"test": "jest",
12+
"generate:apidefs": "echo skipGenerateApiDefs"
1213
},
1314
"keywords": [
1415
"graylog"
1516
],
1617
"author": "Airbus CyberSecurity",
1718
"license": "SSPL-1.0",
18-
"dependencies": {},
1919
"devDependencies": {
2020
"graylog-web-plugin": "file:../graylog2-server/graylog2-web-interface/packages/graylog-web-plugin",
2121
"urijs": "^1.19.11"

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
<parent>
2424
<groupId>org.graylog.plugins</groupId>
2525
<artifactId>graylog-plugin-web-parent</artifactId>
26-
<version>6.1.4</version>
26+
<version>6.3.7</version>
2727
</parent>
2828

2929
<groupId>com.airbus-cyber-security.graylog</groupId>
3030
<artifactId>graylog-plugin-logging-alert</artifactId>
31-
<version>6.1.8</version>
31+
<version>6.3.0</version>
3232
<packaging>jar</packaging>
3333
<name>${project.artifactId}</name>
3434
<description>Graylog ${project.artifactId} plugin.</description>

runtime/docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ services:
88
mongo:
99
image: "mongo:6.0"
1010
container_name: mongo
11+
# uncomment to expose mongodb on localhost:27017
12+
ports:
13+
- 27017:27017
1114

1215
# OpenSearch:
1316
# * https://hub.docker.com/r/opensearchproject/opensearch

src/web/components/event-notifications/LoggingAlertForm.tsx

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
* along with this program. If not, see
1515
* <http://www.mongodb.com/licensing/server-side-public-license>.
1616
*/
17-
import React from 'react';
18-
import PropTypes from 'prop-types';
1917

18+
import React from 'react';
2019
import { ControlLabel, FormGroup, HelpBlock } from 'components/bootstrap';
2120
import lodash from 'lodash';
2221
// TODO this works, but should rather load the SourceCodeEditor from the index (it will then use lazy-loading)
@@ -46,50 +45,50 @@ class LoggingAlertForm extends React.Component<Props> {
4645
this.state = {};
4746
}
4847

49-
componentDidMount() {
48+
componentDidMount() {
5049
ConfigurationsActions.list(LOGGING_ALERT_CONFIG);
51-
}
52-
50+
}
51+
5352
propagateChange = (key, value) => {
54-
const { config, onChange } = this.props;
55-
const nextConfig = lodash.cloneDeep(config);
56-
nextConfig[key] = value;
57-
onChange(nextConfig);
53+
const { config, onChange } = this.props;
54+
const nextConfig = lodash.cloneDeep(config);
55+
nextConfig[key] = value;
56+
onChange(nextConfig);
5857
};
5958

6059
handleChange = (event) => {
61-
const { name } = event.target;
62-
this.propagateChange(name, FormsUtils.getValueFromInput(event.target));
60+
const { name } = event.target;
61+
this.propagateChange(name, FormsUtils.getValueFromInput(event.target));
6362
};
6463

6564
handleBodyTemplateChange = (nextValue) => {
66-
this.propagateChange('log_body', nextValue);
65+
this.propagateChange('log_body', nextValue);
6766
};
6867

6968
handleFieldsChange = (key) => {
70-
return nextValue => {
71-
this.propagateChange(key, nextValue === '' ? [] : nextValue.split(','));
72-
};
69+
return nextValue => {
70+
this.propagateChange(key, nextValue === '' ? [] : nextValue.split(','));
71+
};
7372
};
7473

7574
getAlertConfig = (configuration) => {
76-
if (configuration && configuration[LOGGING_ALERT_CONFIG]) {
77-
if (this.props.config.log_body === undefined) {
78-
this.handleBodyTemplateChange(configuration[LOGGING_ALERT_CONFIG].log_body);
79-
}
80-
if (this.props.config.alert_tag === undefined) {
81-
this.propagateChange('alert_tag', configuration[LOGGING_ALERT_CONFIG].alert_tag);
82-
}
83-
return configuration[LOGGING_ALERT_CONFIG];
84-
} else {
85-
return {
86-
log_body: DEFAULT_BODY_TEMPLATE,
87-
alert_tag: 'LoggingAlert',
88-
single_notification: false,
89-
}
90-
}
75+
if (configuration && configuration[LOGGING_ALERT_CONFIG]) {
76+
if (this.props.config.log_body === undefined) {
77+
this.handleBodyTemplateChange(configuration[LOGGING_ALERT_CONFIG].log_body);
78+
}
79+
if (this.props.config.alert_tag === undefined) {
80+
this.propagateChange('alert_tag', configuration[LOGGING_ALERT_CONFIG].alert_tag);
81+
}
82+
return configuration[LOGGING_ALERT_CONFIG];
83+
} else {
84+
return {
85+
log_body: DEFAULT_BODY_TEMPLATE,
86+
alert_tag: 'LoggingAlert',
87+
single_notification: false,
88+
}
89+
}
9190
};
92-
91+
9392
render() {
9493
const { config, validation } = this.props;
9594

@@ -100,17 +99,18 @@ class LoggingAlertForm extends React.Component<Props> {
10099
<React.Fragment>
101100
<FormGroup controlId="log_body" validationState={validation.errors.log_body ? 'error' : null}>
102101
<ControlLabel>Body Template</ControlLabel>
103-
<SourceCodeEditor id="log_body"
104-
mode="text"
105-
theme="light"
106-
value={config.log_body? config.log_body : alertConfig.log_body}
107-
onChange={this.handleBodyTemplateChange} />
102+
<SourceCodeEditor
103+
id="log_body"
104+
mode="text"
105+
theme="light"
106+
value={config.log_body? config.log_body : alertConfig.log_body}
107+
onChange={this.handleBodyTemplateChange} />
108108
<HelpBlock>
109109
{lodash.get(validation, 'errors.log_body[0]', 'The template to generate the log content form')}
110110
</HelpBlock>
111111
</FormGroup>
112112

113-
<ControlLabel>Alert Tag <small className="text-muted">(Optional)</small></ControlLabel>
113+
<ControlLabel>Alert Tag <small className="text-muted">(Optional)</small></ControlLabel>
114114
<Input
115115
id="alert_tag"
116116
type="text"
@@ -119,7 +119,7 @@ class LoggingAlertForm extends React.Component<Props> {
119119
value={config.alert_tag? config.alert_tag : alertConfig.alert_tag}
120120
onChange={this.handleChange}
121121
/>
122-
<div>
122+
<div>
123123
<Input
124124
id="single_notification"
125125
type="checkbox"
@@ -132,12 +132,12 @@ class LoggingAlertForm extends React.Component<Props> {
132132
<HelpBlock>
133133
Check this box to send only one message by alert
134134
</HelpBlock>
135-
</div>
136-
</React.Fragment>
135+
</div>
136+
</React.Fragment>
137137
);
138138
}
139139
}
140140

141141
export default connect(LoggingAlertForm, {
142142
configurationsStore: ConfigurationsStore
143-
});
143+
});

src/web/components/event-notifications/LoggingAlertFormContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ const LoggingAlertFormContainer = (props: Props) => {
2626
return <LoggingAlertForm {...props} />;
2727
}
2828

29-
export default LoggingAlertFormContainer;
29+
export default LoggingAlertFormContainer;

validation/end_to_end/test_end_to_end.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pytest import fixture
22
from graylog.driver import Driver
3+
import re
34

45
from playwright.sync_api import Page, expect
56

@@ -60,5 +61,5 @@ def test_plugin_logging_alert_configuration_cancel_button_should_close_popup_iss
6061
def test_plugin_logging_alert_configuration_window_close_should_close_popup_issue_50(page: Page):
6162
_go_to_plugin_configuration(page)
6263
page.get_by_role('button', name='Edit configuration').click()
63-
page.get_by_text("×Close").click()
64+
page.get_by_label('Update Logging Alert').get_by_role('button').filter(has_text=re.compile(r'^$')).click()
6465
expect(page.get_by_text('Update Logging Alert Notification Configuration')).not_to_be_attached()

0 commit comments

Comments
 (0)