-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.proto
117 lines (95 loc) · 4.29 KB
/
config.proto
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
syntax = "proto3";
package config;
import "apikeys.proto";
option go_package = "github.com/overmindtech/sdp-go;sdp";
// a simple key-value store to store configuration data for accounts and users (TODO)
service ConfigurationService {
// Get the account config for the user's account
rpc GetAccountConfig(GetAccountConfigRequest) returns (GetAccountConfigResponse);
// Update the account config for the user's account
rpc UpdateAccountConfig(UpdateAccountConfigRequest) returns (UpdateAccountConfigResponse);
// Create a new HCP Terraform config for the user's account. This follows
// the same flow as CreateAPIKey, to create a new API key that is then used
// for the HCP Terraform endpoint URL.
rpc CreateHcpConfig(CreateHcpConfigRequest) returns (CreateHcpConfigResponse);
// Get the existing HCP Terraform config for the user's account.
rpc GetHcpConfig(GetHcpConfigRequest) returns (GetHcpConfigResponse);
// Remove the existing HCP Terraform config from the user's account.
rpc DeleteHcpConfig(DeleteHcpConfigRequest) returns (DeleteHcpConfigResponse);
}
// The config that is used when calculating the blast radius for a change, this
// does not affect manually requested blast radii vie the "Explore" view or the
// API
message BlastRadiusConfig {
// The maximum number of items that can be returned in a single blast radius
// request. Once a request has hit this limit, all currently running
// requests will be cancelled and the blast radius returned as-is
int32 maxItems = 1;
// How deeply to link when calculating the blast radius for a change
int32 linkDepth = 2;
}
// This account config is stored in the `kv.Store` protobuf key-value store in
// the api-server database. This means that as long as we don't have any
// *breaking* changes to the protobuf, we shouldn't need to do a migration. If
// however we do need to change this message in a breaking way, we will need to
// do some kind of a migration (depending on the change)
message AccountConfig {
enum BlastRadiusPreset {
// Customise advanced limits.
CUSTOM = 0;
// Runs a shallow scan for dependencies. Reduces time takes to calculate
// blast radius, but might mean some dependencies are missed
QUICK = 1;
// An optimised balance between time taken and discovery.
DETAILED = 2;
// Discovers all possible dependencies, might take a long time and
// discover items that are less likely to be relevant to a change.
FULL = 3;
}
// The preset that we should use when calculating the blast radius for a
// change. If this is set to "CUSTOM" then the `blastRadius` config should be
// set
BlastRadiusPreset blastRadiusPreset = 2;
// The blast radius config for this account, this is only required if the
// preset is "CUSTOM"
optional BlastRadiusConfig blastRadius = 1;
// If this is set to true, changes that weren't able to be mapped to real
// infrastructure won't be considered for risk calculations. This usually
// reduces the number low-quality and low-severity risks, and focuses more
// on risks that we have additional context for. If you find that Overmind's
// risks are "too obvious" then this might be a good setting to enable.
bool skipUnmappedChangesForRisks = 3;
}
message GetAccountConfigRequest {}
message GetAccountConfigResponse {
AccountConfig config = 1;
}
// Updates the account config for the user's account.
message UpdateAccountConfigRequest {
AccountConfig config = 1;
}
message UpdateAccountConfigResponse {
AccountConfig config = 1;
}
message CreateHcpConfigRequest {
// The URL that the user should be redirected to after the whole process is
// over. This should be a page in the frontend, probably the HCP Terraform
// Integration page.
string finalFrontendRedirect = 1;
}
message CreateHcpConfigResponse {
HcpConfig config = 1;
apikeys.CreateAPIKeyResponse apiKey = 2;
}
message HcpConfig {
// the Endpoint URL for the HCP Run Task configuration
string endpoint = 1;
// the HMAC secret for the HCP Run Task configuration
string secret = 2;
}
message GetHcpConfigRequest {}
message GetHcpConfigResponse {
HcpConfig config = 1;
}
message DeleteHcpConfigRequest {}
message DeleteHcpConfigResponse {}