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; |
| 23 | } |
| 24 | |
| 25 | // Authorization policy for an RPC method. This message/API does not have the |
| 26 | // same stability guarantees as the rest of Metropolis APIs - it is internal, |
| 27 | // might change in wire and text incompatible ways and should not be used by |
| 28 | // consumers of the API. |
| 29 | message Authorization { |
| 30 | // Set of permissions required from the caller. |
| 31 | repeated Permission need = 1; |
| 32 | // If set, this API can be called unauthorized and unauthenticated, thereby |
| 33 | // allowing full access to anyone, including public access by anyone with |
| 34 | // network connectivity to the cluster.. Ignored if `need` is non-empty. |
| 35 | bool allow_unauthenticated = 2; |
| 36 | } |