Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: appengine/config_service/proto/service_config.proto

Issue 1221643020: config services: services.cfg and validation (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: nits Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Swarming Authors. All rights reserved. 1 // Copyright 2015 The Swarming Authors. All rights reserved.
2 // Use of this source code is governed by the Apache v2.0 license that can be 2 // Use of this source code is governed by the Apache v2.0 license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Schemas for config files in services/luci-config config set. 5 // Schemas for config files in services/luci-config config set.
6 // 6 //
7 // In this file, "string pattern" is an exact string (can't have a colon) or a 7 // In this file, "string pattern" is an exact string (can't have a colon) or a
8 // string that starts with "regex:", followed by a regular expression. In case 8 // string that starts with "regex:", followed by a regular expression. In case
9 // of regex, the pattern must match an entire string, as if it was sorrounded by 9 // of regex, the pattern must match an entire string, as if it was sorrounded by
10 // ^ and $. 10 // ^ and $.
(...skipping 29 matching lines...) Expand all
40 // Where to import "projects/<id>" config set from. 40 // Where to import "projects/<id>" config set from.
41 optional ConfigSetLocation config_location = 2; 41 optional ConfigSetLocation config_location = 2;
42 } 42 }
43 43
44 // Schema of projects.cfg file. Represents luci tenants registry. 44 // Schema of projects.cfg file. Represents luci tenants registry.
45 message ProjectsCfg { 45 message ProjectsCfg {
46 // All projects served by this instance of Luci. 46 // All projects served by this instance of Luci.
47 repeated Project projects = 1; 47 repeated Project projects = 1;
48 } 48 }
49 49
50 /******************************************************************************/
51 /* Services */
52 /******************************************************************************/
53
54 // Describes one luci service.
55 message Service {
56 // Globally unique id of the service. Required.
57 // Used in "services/<service_id>" config set name.
58 optional string id = 1;
59 // Email addresses of responsible and point-of-contacts for the service.
60 repeated string owners = 2;
61 // Where to import "services/<id>" config set from. If config_location.url is
62 // relative, it is relative to the current configuration file.
63 // If not specified, defaults to "../<id>/".
64 optional ConfigSetLocation config_location = 3;
65 // An HTTPS endpoint that returns JSON-encoded ServiceDynamicMetadata in body.
66 optional string metadata_url = 4;
67 }
68
69 // Machine-generated service metadata.
Vadim Sh. 2015/07/08 03:05:58 nit: Service metadata reported by the services its
nodir 2015/07/08 15:24:47 Done.
70 message ServiceDynamicMetadata {
71 // Format version. Supported versions: 1.0.
72 optional string version = 1;
73 // What configs this service can validate and how to validate them.
74 optional Validator validation = 2;
75 }
76
77 // Schema of services.cfg
78 message ServicesCfg {
79 // A list of all luci services. Should be sorted by id.
80 repeated Service services = 1;
81 }
82
83 /******************************************************************************/
84 /* Misc */
85 /******************************************************************************/
86
87
50 // Schema of acl.cfg file. 88 // Schema of acl.cfg file.
51 message AclCfg { 89 message AclCfg {
52 // Name of the group that has access to all services/* config sets. 90 // Name of the group that has access to all services/* config sets.
53 optional string service_access_group = 1; 91 optional string service_access_group = 1;
54 // Name of the group that has access to all projects/* config sets. 92 // Name of the group that has access to all projects/* config sets.
55 optional string project_access_group = 2; 93 optional string project_access_group = 2;
56 } 94 }
57 95
58 // Schema for import.cfg. It specified how to import configuration files from 96 // Schema for import.cfg. It specified how to import configuration files from
59 // external sources. 97 // external sources.
(...skipping 29 matching lines...) Expand all
89 } 127 }
90 // List of known schemas. They are available at /schemas/<name> as a short 128 // List of known schemas. They are available at /schemas/<name> as a short
91 // mutable link. 129 // mutable link.
92 repeated Schema schemas = 1; 130 repeated Schema schemas = 1;
93 } 131 }
94 132
95 /******************************************************************************/ 133 /******************************************************************************/
96 /* Validation */ 134 /* Validation */
97 /******************************************************************************/ 135 /******************************************************************************/
98 136
99 // Schema of validation.cfg 137 // Defines a pattern of a config identity. Both config_set and path must
100 message ValidationCfg { 138 // match.
101 // Defines one validation rule. It can match configs in different config-sets 139 message ConfigPattern {
102 // and paths. 140 // A string pattern for config_set.
103 message Rule { 141 optional string config_set = 1;
104 // A string pattern (see above) for config_set. 142 // A string pattern for config file path.
105 optional string config_set = 1; 143 optional string path = 2;
106 // A string pattern (see above) for config file path.
107 optional string path = 2;
108 // URL of a validation endpoint. The config service will send an HTTP POST
109 // request to the endpoint, where body is JSON-encoded
110 // ValidationRequestMessage. The endpoint is expected to respond with
111 // HTTP status 200 and JSON-encoded ValidationResponseMessage.
112 optional string url = 3;
113 }
114
115 // Defines validation rules for externally-validated configs.
116 // All rules that match a config by config_set and path must pass in order
117 // for a config to be considered valid.
118 repeated Rule rules = 1;
119 } 144 }
120 145
146 // Describes what configuration can be validated and how to validate them.
147 message Validator {
148 // A list of configuration patterns that this validator can validate.
149 repeated ConfigPattern patterns = 1;
150 // URL of a validation endpoint. The config service will send an HTTP POST
151 // request to the endpoint, where body is JSON-encoded
152 // ValidationRequestMessage. The endpoint is expected to respond with
153 // HTTP status 200 and JSON-encoded ValidationResponseMessage.
154 optional string url = 2;
155 }
121 156
122 // This message is used only in JSON form. It is sent as request body to an 157 // This message is used only in JSON form. It is sent as request body to an
123 // external validation endpoint in order to validate a config. 158 // external validation endpoint in order to validate a config.
124 message ValidationRequestMessage { 159 message ValidationRequestMessage {
125 // Config set of the config file to validate. 160 // Config set of the config file to validate.
126 optional string config_set = 1; 161 optional string config_set = 1;
127 // Path of the config file to validate. 162 // Path of the config file to validate.
128 optional string path = 2; 163 optional string path = 2;
129 // Base64-encoded contents of the file. 164 // Base64-encoded contents of the file.
130 optional string content = 3; 165 optional string content = 3;
(...skipping 14 matching lines...) Expand all
145 message Message { 180 message Message {
146 // Textual representation of the message. 181 // Textual representation of the message.
147 optional string text = 1; 182 optional string text = 1;
148 // If an error, a config is considered invalid. Defaults to INFO. 183 // If an error, a config is considered invalid. Defaults to INFO.
149 optional Severity severity = 2; 184 optional Severity severity = 2;
150 } 185 }
151 // Errors, warnings and other information found during validation. 186 // Errors, warnings and other information found during validation.
152 // If at least one error is found, the config is considered invalid. 187 // If at least one error is found, the config is considered invalid.
153 repeated Message messages = 1; 188 repeated Message messages = 1;
154 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698