blob: 1a0e759babd09af2a6cb5abcc121b7c9ab4cfe4d [file] [log] [blame]
Serge Bazanski9ffa1f92021-09-01 15:42:23 +02001syntax = "proto3";
2package metropolis.proto.ext;
3option go_package = "source.monogon.dev/metropolis/proto/ext";
4
5import "google/protobuf/descriptor.proto";
6
7extend google.protobuf.MethodOptions {
8 // Set authorization policy for this RPC. If not set but the service is
9 // configured to use authorization, the default/zero value of the
10 // Authorization message will be used (effectively allowing all
11 // authenticated users).
12 Authorization authorization = 1000;
13}
14
15
16// Permission is a combined activity/object that an identity can perform in the
17// cluster.
18//
19// MVP: this might get replaced with a full activity/object split later on.
20enum Permission {
21 PERMISSION_UNSPECIFIED = 0;
22 PERMISSION_GET_REGISTER_TICKET = 1;
Serge Bazanskid7d6e022021-09-01 15:03:06 +020023 PERMISSION_READ_CLUSTER_STATUS = 2;
Serge Bazanski2893e982021-09-09 13:06:16 +020024 PERMISSION_UPDATE_NODE_SELF = 3;
Serge Bazanski1612d4b2021-11-12 13:54:15 +010025 PERMISSION_APPROVE_NODE = 4;
Mateusz Zalegabb2edbe2022-06-08 11:57:09 +020026 PERMISSION_UPDATE_NODE_ROLES = 5;
Serge Bazanskib91938f2023-03-29 14:31:22 +020027 PERMISSION_READ_NODE_LOGS = 6;
Lorenz Brun35fcf032023-06-29 04:15:58 +020028 PERMISSION_UPDATE_NODE = 7;
Serge Bazanski8456ddf2023-10-30 18:56:59 +010029 PERMISSION_DECOMMISSION_NODE = 8;
30 PERMISSION_DELETE_NODE = 9;
Serge Bazanski9ffa1f92021-09-01 15:42:23 +020031}
32
33// Authorization policy for an RPC method. This message/API does not have the
34// same stability guarantees as the rest of Metropolis APIs - it is internal,
35// might change in wire and text incompatible ways and should not be used by
36// consumers of the API.
37message Authorization {
38 // Set of permissions required from the caller.
39 repeated Permission need = 1;
40 // If set, this API can be called unauthorized and unauthenticated, thereby
41 // allowing full access to anyone, including public access by anyone with
42 // network connectivity to the cluster.. Ignored if `need` is non-empty.
43 bool allow_unauthenticated = 2;
44}