forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.ts
More file actions
39 lines (35 loc) · 1.84 KB
/
constants.ts
File metadata and controls
39 lines (35 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type { IntervalSchedule } from '@kbn/task-manager-plugin/server';
export const PROVISION_UIAM_API_KEYS_FLAG = 'alerting.rules.provisionUiamApiKeys';
export const API_KEY_PROVISIONING_TASK_ID = 'api_key_provisioning';
export const API_KEY_PROVISIONING_TASK_TYPE = `alerting:${API_KEY_PROVISIONING_TASK_ID}`;
export const API_KEY_PROVISIONING_TASK_SCHEDULE: IntervalSchedule = { interval: '1d' };
export const TASK_TIMEOUT = '5m';
/** Delay before the next run when more batches are pending (10 minutes) */
export const RESCHEDULE_DELAY_MS = 600000;
export const TAGS = ['serverless', 'alerting', 'uiam-api-key-provisioning', 'background-task'];
export const GET_RULES_BATCH_SIZE = 300;
export const GET_STATUS_BATCH_SIZE = 500;
/**
* UIAM convert error codes that indicate a permanent failure: rules with any of
* these codes persisted on their `uiam_api_keys_provisioning_status` doc are
* excluded from future provisioning attempts.
*
* Source: https://github.com/elastic/uiam/blob/main/modules/domain/src/main/java/co/elastic/cloud/uiam/domain/errors/ErrorCode.java
*/
export const NON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE = '0x357391';
export const API_KEY_CREATOR_NOT_ORG_MEMBER_ERROR_CODE = '0xBE2B58';
export const PERMANENT_UIAM_CONVERSION_ERROR_CODES: readonly string[] = [
NON_CLOUD_USER_API_KEY_CREATOR_ERROR_CODE,
API_KEY_CREATOR_NOT_ORG_MEMBER_ERROR_CODE,
];
/**
* Max number of rule IDs per KQL `or` clause when building the exclude filter.
* Keeps each bool.should below Elasticsearch's indices.query.bool.max_clause_count (default 4096).
*/
export const EXCLUDE_FILTER_CLAUSE_BATCH_SIZE = 1024;