-
Notifications
You must be signed in to change notification settings - Fork 822
/
types.ts
62 lines (53 loc) 路 1.54 KB
/
types.ts
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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { SavedObjectAttributes } from 'src/core/types';
export interface DataSourceAttributes extends SavedObjectAttributes {
title: string;
description?: string;
endpoint: string;
dataSourceVersion: string;
dataSourceEngineType?: DataSourceEngineType;
installedPlugins?: string[];
auth: {
type: AuthType | string;
credentials: UsernamePasswordTypedContent | SigV4Content | undefined | AuthTypeContent;
};
lastUpdatedTime?: string;
}
export interface AuthTypeContent {
[key: string]: string;
}
/**
* Multiple datasource supports authenticating as IAM user, it doesn't support IAM role.
* Because IAM role session requires temporary security credentials through assuming role,
* which makes no sense to store the credentials.
*/
export interface SigV4Content extends SavedObjectAttributes {
accessKey: string;
secretKey: string;
region: string;
service?: SigV4ServiceName;
sessionToken?: string;
}
export interface UsernamePasswordTypedContent extends SavedObjectAttributes {
username: string;
password: string;
}
export enum AuthType {
NoAuth = 'no_auth',
UsernamePasswordType = 'username_password',
SigV4 = 'sigv4',
}
export enum SigV4ServiceName {
OpenSearch = 'es',
OpenSearchServerless = 'aoss',
}
export { DataSourceError } from './error';
export enum DataSourceEngineType {
OpenSearch = 'OpenSearch',
OpenSearchServerless = 'OpenSearch Serverless',
Elasticsearch = 'Elasticsearch',
NA = 'No Engine Type Available',
}