-
Notifications
You must be signed in to change notification settings - Fork 103
/
constants.js
82 lines (73 loc) · 2.32 KB
/
constants.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
export const DS_API_PREFIX = '/api/saved_objects';
export const OSD_TEST_DOMAIN_ENDPOINT_URL = 'https://opensearch.org';
export const OSD_TEST_DATA_SOURCE_ENDPOINT_NO_AUTH = Cypress.env(
'remoteDataSourceNoAuthUrl'
);
export const OSD_TEST_DATA_SOURCE_ENDPOINT_BASIC_AUTH = Cypress.env(
'remoteDataSourceBasicAuthUrl'
);
export const USERNAME = Cypress.env('remoteDataSourceBasicAuthUsername');
export const PASSWORD = Cypress.env('remoteDataSourceBasicAuthPassword');
export const OSD_INVALID_ENDPOINT_URL = 'test';
export const DS_API = {
DATA_SOURCES_LISTING: `${DS_API_PREFIX}/_find?fields=id&fields=description&fields=title&per_page=10000&type=data-source`,
CREATE_DATA_SOURCE: `${DS_API_PREFIX}/data-source`,
DELETE_DATA_SOURCE: `${DS_API_PREFIX}/data-source/`,
};
export const DS_NO_AUTH_LABEL = 'RemoteDataSourceNoAuth';
export const DEFAULT_DS_TITLE = 'DefaultDataSource';
export const TIMEOUT_OPTS = { timeout: 60000 };
export const FORCE_CLICK_OPTS = { force: true };
export const DATASOURCE_DELAY = 1000;
// test data
export const REGION = 'us-east-1';
export const ACCESS_KEY = 'accessKey';
export const SECRET_KEY = 'secretKey';
export const AUTH_TYPE_SIGV4 = 'sigv4';
export const AUTH_TYPE_NO_AUTH = 'no_auth';
export const AUTH_TYPE_BASIC_AUTH = 'username_password';
export const SERVICE_TYPE_OPENSEARCH = 'es';
export const SERVICE_TYPE_OPENSEARCH_SERVERLESS = 'aoss';
/* Mocks */
export const DS_JSON = {
attributes: {
title: 'ds_for_update_test',
description: 'test ds_description_update',
endpoint: OSD_TEST_DATA_SOURCE_ENDPOINT_NO_AUTH,
auth: {
type: AUTH_TYPE_NO_AUTH,
},
},
};
export const DS_JSON_2 = {
attributes: {
title: 'ds_dup_test',
description: 'test ds_description_update',
endpoint: OSD_TEST_DATA_SOURCE_ENDPOINT_NO_AUTH,
auth: {
type: AUTH_TYPE_NO_AUTH,
},
},
};
export const DS_JSON_UNIQUE_VALUES = {
attributes: {
title: 'ds_unique_title',
description: '',
endpoint: OSD_TEST_DATA_SOURCE_ENDPOINT_NO_AUTH,
auth: {
type: AUTH_TYPE_NO_AUTH,
credentials: {
username: 'a',
password: 'a',
region: REGION,
accessKey: 'a',
secretKey: 'a',
service: SERVICE_TYPE_OPENSEARCH_SERVERLESS,
},
},
},
};