| Serge Bazanski | 9ffa1f9 | 2021-09-01 15:42:23 +0200 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package metropolis.proto.ext; |
| 3 | option go_package = "source.monogon.dev/metropolis/proto/ext"; |
| 4 | |
| 5 | import "google/protobuf/descriptor.proto"; |
| 6 | |
| 7 | extend 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. |
| 20 | enum Permission { |
| 21 | PERMISSION_UNSPECIFIED = 0; |
| 22 | PERMISSION_GET_REGISTER_TICKET = 1; |
| Serge Bazanski | d7d6e02 | 2021-09-01 15:03:06 +0200 | [diff] [blame] | 23 | PERMISSION_READ_CLUSTER_STATUS = 2; |
| Serge Bazanski | 2893e98 | 2021-09-09 13:06:16 +0200 | [diff] [blame] | 24 | PERMISSION_UPDATE_NODE_SELF = 3; |
| Serge Bazanski | 1612d4b | 2021-11-12 13:54:15 +0100 | [diff] [blame] | 25 | PERMISSION_APPROVE_NODE = 4; |
| Mateusz Zalega | bb2edbe | 2022-06-08 11:57:09 +0200 | [diff] [blame] | 26 | PERMISSION_UPDATE_NODE_ROLES = 5; |
| Serge Bazanski | b91938f | 2023-03-29 14:31:22 +0200 | [diff] [blame] | 27 | PERMISSION_READ_NODE_LOGS = 6; |
| Lorenz Brun | 35fcf03 | 2023-06-29 04:15:58 +0200 | [diff] [blame] | 28 | PERMISSION_UPDATE_NODE = 7; |
| Serge Bazanski | 8456ddf | 2023-10-30 18:56:59 +0100 | [diff] [blame] | 29 | PERMISSION_DECOMMISSION_NODE = 8; |
| 30 | PERMISSION_DELETE_NODE = 9; |
| Serge Bazanski | 1f78954 | 2024-05-22 14:01:50 +0200 | [diff] [blame] | 31 | PERMISSION_UPDATE_NODE_LABELS = 10; |
| Lorenz Brun | 5a5c66b | 2024-08-22 16:11:44 +0200 | [diff] [blame] | 32 | PERMISSION_NODE_POWER_MANAGEMENT = 11; |
| Serge Bazanski | 1e39914 | 2024-10-22 10:58:15 +0000 | [diff] [blame^] | 33 | PERMISSION_CONFIGURE_CLUSTER = 12; |
| Serge Bazanski | 9ffa1f9 | 2021-09-01 15:42:23 +0200 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | // Authorization policy for an RPC method. This message/API does not have the |
| 37 | // same stability guarantees as the rest of Metropolis APIs - it is internal, |
| 38 | // might change in wire and text incompatible ways and should not be used by |
| 39 | // consumers of the API. |
| 40 | message Authorization { |
| 41 | // Set of permissions required from the caller. |
| 42 | repeated Permission need = 1; |
| 43 | // If set, this API can be called unauthorized and unauthenticated, thereby |
| 44 | // allowing full access to anyone, including public access by anyone with |
| 45 | // network connectivity to the cluster.. Ignored if `need` is non-empty. |
| 46 | bool allow_unauthenticated = 2; |
| 47 | } |