Skip to content

Commit

Permalink
fix type errors from rebase with master, update index names after cha…
Browse files Browse the repository at this point in the history
…nges were merged into master regarding naming conventions for alerts as data index
  • Loading branch information
dhurley14 committed Jul 8, 2021
1 parent 1ae051c commit 220a8e9
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const createRuleDataPluginServiceMock = (_: RuleDataPluginServiceConstructorOpti
createOrUpdateIndexTemplate: jest.fn(),
createOrUpdateLifecyclePolicy: jest.fn(),
getRuleDataClient: jest.fn(),
updateIndexMappingsMatchingPattern: jest.fn(),
};
return mocked;
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/rule_registry/server/utils/rbac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
export const mapConsumerToIndexName = {
apm: '.alerts-observability-apm',
observability: '.alerts-observability',
siem: ['.alerts-security-solution', '.siem-signals'],
siem: ['.alerts-security.alerts', '.siem-signals'],
};
export type ValidFeatureId = keyof typeof mapConsumerToIndexName;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/security_solution/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
});

ruleDataClient = ruleDataService.getRuleDataClient(
ruleDataService.getFullAssetName('security.alerts'),
SERVER_APP_ID,
ruleDataService.getFullAssetName('security.alerts'),
() => initializeRuleDataTemplatesPromise
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "doc",
"value": {
"index": ".alerts-security-solution",
"index": ".alerts-security.alerts",
"id": "020202",
"source": {
"@timestamp": "2020-12-16T15:16:18.570Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"type": "index",
"value": {
"index": ".alerts-security-solution",
"index": ".alerts-security.alerts",
"mappings": {
"properties": {
"message": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default ({ getService }: FtrProviderContext) => {
const APM_ALERT_ID = 'NoxgpHkBqbdrfX07MqXV';
const APM_ALERT_INDEX = '.alerts-observability-apm';
const SECURITY_SOLUTION_ALERT_ID = '020202';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security-solution';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security.alerts';

const getAPMIndexName = async (user: User) => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default ({ getService }: FtrProviderContext) => {
const APM_ALERT_ID = 'NoxgpHkBqbdrfX07MqXV';
const APM_ALERT_INDEX = '.alerts-observability-apm';
const SECURITY_SOLUTION_ALERT_ID = '020202';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security-solution';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security.alerts';
const ALERT_VERSION = Buffer.from(JSON.stringify([0, 1]), 'utf8').toString('base64'); // required for optimistic concurrency control

const getAPMIndexName = async (user: User) => {
Expand Down Expand Up @@ -155,7 +155,7 @@ export default ({ getService }: FtrProviderContext) => {
ids: [APM_ALERT_ID],
status: 'closed',
index: 'this index does not exist',
_version: Buffer.from(JSON.stringify([0, 1]), 'utf8').toString('base64'),
_version: ALERT_VERSION,
})
.expect(404);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default ({ getService }: FtrProviderContext) => {
const SPACE2 = 'space2';
const APM_ALERT_ID = 'NoxgpHkBqbdrfX07MqXV';
const APM_ALERT_INDEX = '.alerts-observability-apm';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security-solution';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security.alerts';

const getAPMIndexName = async (user: User) => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default ({ getService }: FtrProviderContext) => {
const SPACE2 = 'space2';
const APM_ALERT_ID = 'NoxgpHkBqbdrfX07MqXV';
const APM_ALERT_INDEX = '.alerts-observability-apm';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security-solution';
const SECURITY_SOLUTION_ALERT_INDEX = '.alerts-security.alerts';
const ALERT_VERSION = Buffer.from(JSON.stringify([0, 1]), 'utf8').toString('base64'); // required for optimistic concurrency control

const getAPMIndexName = async (user: User) => {
Expand Down

0 comments on commit 220a8e9

Please sign in to comment.