-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathtypes.ts
More file actions
59 lines (49 loc) · 1.23 KB
/
types.ts
File metadata and controls
59 lines (49 loc) · 1.23 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { GitProxyConfig } from './generated/config';
export type ServerConfig = {
GIT_PROXY_SERVER_PORT: string | number;
GIT_PROXY_HTTPS_SERVER_PORT: string | number;
GIT_PROXY_UI_HOST: string;
GIT_PROXY_UI_PORT: string | number;
GIT_PROXY_HTTPS_UI_PORT: string | number;
GIT_PROXY_COOKIE_SECRET: string | undefined;
GIT_PROXY_MONGO_CONNECTION_STRING: string;
};
interface GitAuth {
type: 'ssh';
privateKeyPath: string;
}
interface HttpAuth {
type: 'bearer';
token: string;
}
interface BaseSource {
type: 'file' | 'http' | 'git';
enabled: boolean;
}
export interface FileSource extends BaseSource {
type: 'file';
path: string;
}
export interface HttpSource extends BaseSource {
type: 'http';
url: string;
headers?: Record<string, string>;
auth?: HttpAuth;
}
export interface GitSource extends BaseSource {
type: 'git';
repository: string;
branch?: string;
path: string;
auth?: GitAuth;
}
export type ConfigurationSource = FileSource | HttpSource | GitSource;
interface ConfigurationSources {
enabled: boolean;
sources: ConfigurationSource[];
reloadIntervalSeconds: number;
merge?: boolean;
}
export interface Configuration extends GitProxyConfig {
configurationSources?: ConfigurationSources;
}