Serge Bazanski | 6bd4159 | 2021-08-23 13:18:37 +0200 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package metropolis.proto.api; |
| 3 | option go_package = "source.monogon.dev/metropolis/proto/api"; |
| 4 | |
Serge Bazanski | bc671d0 | 2021-10-05 17:53:32 +0200 | [diff] [blame] | 5 | import "metropolis/proto/common/common.proto"; |
Serge Bazanski | 9ffa1f9 | 2021-09-01 15:42:23 +0200 | [diff] [blame] | 6 | import "metropolis/proto/ext/authorization.proto"; |
| 7 | |
Serge Bazanski | 6bd4159 | 2021-08-23 13:18:37 +0200 | [diff] [blame] | 8 | // Management service available to Cluster Managers. |
| 9 | service Management { |
| 10 | // GetRegisterTicket retrieves the current RegisterTicket which is required |
| 11 | // for new nodes to register into the cluster. Presenting this ticket on |
| 12 | // registration does not automatically grant access to arbitrary node |
| 13 | // registration. Instead, it is used to guard the API surface of the |
| 14 | // Register RPC from potential denial of service attacks, and can be |
| 15 | // regenerated at any time in case it leaks. |
Serge Bazanski | 9ffa1f9 | 2021-09-01 15:42:23 +0200 | [diff] [blame] | 16 | rpc GetRegisterTicket(GetRegisterTicketRequest) returns (GetRegisterTicketResponse) { |
| 17 | option (metropolis.proto.ext.authorization) = { |
| 18 | need: PERMISSION_GET_REGISTER_TICKET |
| 19 | }; |
| 20 | } |
Serge Bazanski | bc671d0 | 2021-10-05 17:53:32 +0200 | [diff] [blame] | 21 | // GetClusterInfo retrieves publicly available summary information about |
| 22 | // this cluster, notably data required for nodes to register into a cluster |
| 23 | // or join it (other than the Register Ticket, which is gated by an |
| 24 | // additional permission). |
| 25 | rpc GetClusterInfo(GetClusterInfoRequest) returns (GetClusterInfoResponse) { |
| 26 | option (metropolis.proto.ext.authorization) = { |
| 27 | need: PERMISSION_READ_CLUSTER_STATUS |
| 28 | }; |
| 29 | } |
Serge Bazanski | 6bd4159 | 2021-08-23 13:18:37 +0200 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | message GetRegisterTicketRequest { |
| 33 | } |
| 34 | |
| 35 | message GetRegisterTicketResponse { |
| 36 | // Opaque bytes that comprise the RegisterTicket. |
| 37 | bytes ticket = 1; |
Serge Bazanski | 2893e98 | 2021-09-09 13:06:16 +0200 | [diff] [blame] | 38 | } |
Serge Bazanski | bc671d0 | 2021-10-05 17:53:32 +0200 | [diff] [blame] | 39 | |
| 40 | message GetClusterInfoRequest { |
| 41 | } |
| 42 | |
| 43 | message GetClusterInfoResponse { |
| 44 | // cluster_directory contains information about individual nodes in the |
| 45 | // cluster that can be used to dial the cluster's services. |
| 46 | metropolis.proto.common.ClusterDirectory cluster_directory = 1; |
| 47 | } |