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

Side by Side Diff: scheduler/appengine/messages/cron.proto

Issue 2986033003: [scheduler]: ACLs phase 1 - per Job ACL specification and enforcement. (Closed)
Patch Set: Review. Created 3 years, 4 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
« no previous file with comments | « scheduler/appengine/frontend/handler.go ('k') | scheduler/appengine/messages/cron.pb.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 syntax = "proto3"; 5 syntax = "proto3";
6 6
7 package messages; 7 package messages;
8 8
9 // A single access control rule.
10 //
11 // WARNING: until ACLs are fully deployed, DO NOT rely on READER Role
12 // limiting access to your project. Follow crbug/736770 if in doubt.
13 // TODO(tandrii): REMOVE THIS WARNING once deployment is complete.
14 message Acl {
15 enum Role {
16 // Can do read-only operations, such as listing invocations of a Job.
17 READER = 0;
18 // Same as READER + can modify state of a Job or Invocation such as
19 // triggering or aborting them.
20 // LUCI scheduler (this service) is an OWNER of each `Job` and `Trigger`, th us
21 // `Trigger`s are allowed to trigger all `Job`s defined in the s ame
22 // project, regardless of their respective ACLs.
23 OWNER = 1;
24 }
25 // Role denotes a list of actions that an identity can perform.
26 Role role = 1;
27 // Either email or "group:xyz" or auth service identity string "kind:name".
28 string granted_to = 2;
29 }
30
31 // A set of Acl messages. Can be referenced in a Job or Trigger by name.
32 message AclSet {
33 // A name of the ACL set, unique for a project.
34 // Required. Must match regex '^[0-9A-Za-z_\-\.]{1,100}$'.
35 string name = 1;
36 // List of access control rules.
37 // The order does not matter.
38 repeated Acl acls = 2;
39 }
9 40
10 // Job specifies a single regular job belonging to a project. 41 // Job specifies a single regular job belonging to a project.
11 // 42 //
12 // Such jobs runs on a schedule or can be triggered by some trigger. 43 // Such jobs runs on a schedule or can be triggered by some trigger.
13 message Job { 44 message Job {
14 // Id is a name of the job (unique for the project). 45 // Id is a name of the job (unique for the project).
15 // 46 //
16 // Must match '^[0-9A-Za-z_\-\.]{1,100}$'. 47 // Must match '^[0-9A-Za-z_\-\.]{1,100}$'.
17 string id = 1; 48 string id = 1;
18 49
19 // Schedule describes when to run the job. 50 // Schedule describes when to run the job.
20 // 51 //
21 // Supported kinds of schedules (illustrated by examples): 52 // Supported kinds of schedules (illustrated by examples):
22 // - "* 0 * * * *": standard cron-like expression. Cron engine will attempt 53 // - "* 0 * * * *": standard cron-like expression. Cron engine will attempt
23 // to start a job at specified moments in time (based on UTC clock). If 54 // to start a job at specified moments in time (based on UTC clock). If
24 // when triggering a job, previous invocation is still running, an overrun 55 // when triggering a job, previous invocation is still running, an overrun
25 // will be recorded (and next attempt to start a job happens based on the 56 // will be recorded (and next attempt to start a job happens based on the
26 // schedule, not when the previous invocation finishes). This is absolute 57 // schedule, not when the previous invocation finishes). This is absolute
27 // schedule (i.e. doesn't depend on job state). 58 // schedule (i.e. doesn't depend on job state).
28 // - "with 10s interval": runs invocations in a loop, waiting 10s after 59 // - "with 10s interval": runs invocations in a loop, waiting 10s after
29 // finishing invocation before starting a new one. This is relative 60 // finishing invocation before starting a new one. This is relative
30 // schedule. Overruns are not possible. 61 // schedule. Overruns are not possible.
31 // - "continuously" is alias for "with 0s interval", meaning the job will 62 // - "continuously" is alias for "with 0s interval", meaning the job will
32 // run in a loop without any pauses. 63 // run in a loop without any pauses.
33 // - "triggered" schedule indicates that job is always started via "Run now" 64 // - "triggered" schedule indicates that job is only started via "Run now"
34 // button or via a trigger. 65 // button or via a trigger.
35 // 66 //
36 // Default is "triggered". 67 // Default is "triggered".
37 string schedule = 2; 68 string schedule = 2;
38 69
39 // Disabled is true to disable this job. 70 // Disabled is true to disable this job.
40 bool disabled = 3; 71 bool disabled = 3;
41 72
42 // Task defines what exactly to execute. 73 // Task defines what exactly to execute.
43 // 74 //
44 // TODO(vadimsh): Remove this field once all configs are updated not to 75 // TODO(vadimsh): Remove this field once all configs are updated not to
45 // use it. 76 // use it.
46 TaskDefWrapper task = 4; 77 TaskDefWrapper task = 4;
47 78
79 // List of access control rules for the Job.
80 // The order does not matter.
81 // There can be at most 32 different acls for a Job, including those fro m
82 // acl_sets.
83 repeated Acl acls = 5;
84 // A list of ACL set names. Each ACL in each referenced ACL set will be
85 // included in this Job.
86 // The order does not matter.
87 repeated string acl_sets = 6;
88
48 // One and only one field below must be set. It defines what this job does. 89 // One and only one field below must be set. It defines what this job does.
49 90
50 // Noop is used for testing. It is "do nothing" task. 91 // Noop is used for testing. It is "do nothing" task.
51 NoopTask noop = 100; 92 NoopTask noop = 100;
52 // UrlFetch can be used to make a simple HTTP call. 93 // UrlFetch can be used to make a simple HTTP call.
53 UrlFetchTask url_fetch = 101; 94 UrlFetchTask url_fetch = 101;
54 // SwarmingTask can be used to schedule swarming job. 95 // SwarmingTask can be used to schedule swarming job.
55 SwarmingTask swarming = 102; 96 SwarmingTask swarming = 102;
56 // BuildbucketTask can be used to schedule buildbucket job. 97 // BuildbucketTask can be used to schedule buildbucket job.
57 BuildbucketTask buildbucket = 103; 98 BuildbucketTask buildbucket = 103;
(...skipping 11 matching lines...) Expand all
69 string id = 1; 110 string id = 1;
70 111
71 // Schedule describes when to run this triggering job. 112 // Schedule describes when to run this triggering job.
72 // 113 //
73 // See Job.schedule fro more info. Default is "with 30s interval". 114 // See Job.schedule fro more info. Default is "with 30s interval".
74 string schedule = 2; 115 string schedule = 2;
75 116
76 // Disabled is true to disable this job. 117 // Disabled is true to disable this job.
77 bool disabled = 3; 118 bool disabled = 3;
78 119
120 // List of access control rules for the Job.
121 // The order does not matter.
122 // There can be at most 32 different acls for a Job, including those fro m
123 // acl_sets.
124 repeated Acl acls = 4;
125 // A list of ACL set names. Each ACL in each referenced ACL set will be
126 // included in this Job.
127 // The order does not matter.
128 repeated string acl_sets = 5;
129
79 // One and only one field below must be set. It defines what this job does. 130 // One and only one field below must be set. It defines what this job does.
80 131
81 // Noop is used for testing. It is "do nothing" trigger. 132 // Noop is used for testing. It is "do nothing" trigger.
82 NoopTask noop = 100; 133 NoopTask noop = 100;
83 // Gitiles is used to trigger jobs for new commits on Gitiles. 134 // Gitiles is used to trigger jobs for new commits on Gitiles.
84 GitilesTask gitiles = 101; 135 GitilesTask gitiles = 101;
85 } 136 }
86 137
87 138
88 // NoopTask is used for testing. It is "do nothing" task. 139 // NoopTask is used for testing. It is "do nothing" task.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 215
165 216
166 // ProjectConfig defines a schema for config file that describe jobs belonging 217 // ProjectConfig defines a schema for config file that describe jobs belonging
167 // to some project. 218 // to some project.
168 message ProjectConfig { 219 message ProjectConfig {
169 // Job is a set of jobs defined in the project. 220 // Job is a set of jobs defined in the project.
170 repeated Job job = 1; 221 repeated Job job = 1;
171 222
172 // Trigger is a set of triggering jobs defined in the project. 223 // Trigger is a set of triggering jobs defined in the project.
173 repeated Trigger trigger = 2; 224 repeated Trigger trigger = 2;
225
226 // A list of ACL sets. Names must be unique.
227 repeated AclSet acl_sets = 3;
174 } 228 }
175 229
176 //////////////////////////////////////////////////////////////////////////////// 230 ////////////////////////////////////////////////////////////////////////////////
177 // Internal stuff. 231 // Internal stuff.
178 232
179 // TaskDefWrapper is a union type of all possible tasks known to the scheduler. 233 // TaskDefWrapper is a union type of all possible tasks known to the scheduler.
180 // 234 //
181 // It is used internally when storing jobs in the datastore. 235 // It is used internally when storing jobs in the datastore.
182 // 236 //
183 // TODO(vadimsh): Remove '_task' suffixes once TaskDefWrapper is no longer 237 // TODO(vadimsh): Remove '_task' suffixes once TaskDefWrapper is no longer
184 // a part of 'Job' proto. 238 // a part of 'Job' proto.
185 message TaskDefWrapper { 239 message TaskDefWrapper {
186 NoopTask noop = 1; 240 NoopTask noop = 1;
187 UrlFetchTask url_fetch = 2; 241 UrlFetchTask url_fetch = 2;
188 SwarmingTask swarming_task = 3; 242 SwarmingTask swarming_task = 3;
189 BuildbucketTask buildbucket_task = 4; 243 BuildbucketTask buildbucket_task = 4;
190 GitilesTask gitiles_task = 5; 244 GitilesTask gitiles_task = 5;
191 } 245 }
OLDNEW
« no previous file with comments | « scheduler/appengine/frontend/handler.go ('k') | scheduler/appengine/messages/cron.pb.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698