1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-10-23 11:19:19 +02:00

format protobuf with new settings

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2024-12-05 09:51:22 +01:00
parent 273483a310
commit 15b26c9231
No known key found for this signature in database
6 changed files with 161 additions and 234 deletions

View File

@ -1,42 +1,29 @@
syntax = "proto3";
package headscale.v1;
option go_package = "github.com/juanfont/headscale/gen/go/v1";
option go_package = "github.com/juanfont/headscale/gen/go/v1";
import "google/protobuf/timestamp.proto";
message ApiKey {
uint64 id = 1;
string prefix = 2;
google.protobuf.Timestamp expiration = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp last_seen = 5;
uint64 id = 1;
string prefix = 2;
google.protobuf.Timestamp expiration = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp last_seen = 5;
}
message CreateApiKeyRequest {
google.protobuf.Timestamp expiration = 1;
}
message CreateApiKeyRequest { google.protobuf.Timestamp expiration = 1; }
message CreateApiKeyResponse {
string api_key = 1;
}
message CreateApiKeyResponse { string api_key = 1; }
message ExpireApiKeyRequest {
string prefix = 1;
}
message ExpireApiKeyRequest { string prefix = 1; }
message ExpireApiKeyResponse {
}
message ExpireApiKeyResponse {}
message ListApiKeysRequest {
}
message ListApiKeysRequest {}
message ListApiKeysResponse {
repeated ApiKey api_keys = 1;
}
message ListApiKeysResponse { repeated ApiKey api_keys = 1; }
message DeleteApiKeyRequest {
string prefix = 1;
}
message DeleteApiKeyRequest { string prefix = 1; }
message DeleteApiKeyResponse {
}
message DeleteApiKeyResponse {}

View File

@ -1,6 +1,6 @@
syntax = "proto3";
package headscale.v1;
option go_package = "github.com/juanfont/headscale/gen/go/v1";
option go_package = "github.com/juanfont/headscale/gen/go/v1";
import "google/protobuf/timestamp.proto";
@ -8,76 +8,69 @@ import "google/protobuf/timestamp.proto";
// https://github.com/tailscale/tailscale/blob/main/api.md
message Latency {
float latency_ms = 1;
bool preferred = 2;
float latency_ms = 1;
bool preferred = 2;
}
message ClientSupports {
bool hair_pinning = 1;
bool ipv6 = 2;
bool pcp = 3;
bool pmp = 4;
bool udp = 5;
bool upnp = 6;
bool hair_pinning = 1;
bool ipv6 = 2;
bool pcp = 3;
bool pmp = 4;
bool udp = 5;
bool upnp = 6;
}
message ClientConnectivity {
repeated string endpoints = 1;
string derp = 2;
bool mapping_varies_by_dest_ip = 3;
map<string, Latency> latency = 4;
ClientSupports client_supports = 5;
repeated string endpoints = 1;
string derp = 2;
bool mapping_varies_by_dest_ip = 3;
map<string, Latency> latency = 4;
ClientSupports client_supports = 5;
}
message GetDeviceRequest {
string id = 1;
}
message GetDeviceRequest { string id = 1; }
message GetDeviceResponse {
repeated string addresses = 1;
string id = 2;
string user = 3;
string name = 4;
string hostname = 5;
string client_version = 6;
bool update_available = 7;
string os = 8;
google.protobuf.Timestamp created = 9;
google.protobuf.Timestamp last_seen = 10;
bool key_expiry_disabled = 11;
google.protobuf.Timestamp expires = 12;
bool authorized = 13;
bool is_external = 14;
string machine_key = 15;
string node_key = 16;
bool blocks_incoming_connections = 17;
repeated string enabled_routes = 18;
repeated string advertised_routes = 19;
ClientConnectivity client_connectivity = 20;
repeated string addresses = 1;
string id = 2;
string user = 3;
string name = 4;
string hostname = 5;
string client_version = 6;
bool update_available = 7;
string os = 8;
google.protobuf.Timestamp created = 9;
google.protobuf.Timestamp last_seen = 10;
bool key_expiry_disabled = 11;
google.protobuf.Timestamp expires = 12;
bool authorized = 13;
bool is_external = 14;
string machine_key = 15;
string node_key = 16;
bool blocks_incoming_connections = 17;
repeated string enabled_routes = 18;
repeated string advertised_routes = 19;
ClientConnectivity client_connectivity = 20;
}
message DeleteDeviceRequest {
string id = 1;
}
message DeleteDeviceRequest { string id = 1; }
message DeleteDeviceResponse {
}
message DeleteDeviceResponse {}
message GetDeviceRoutesRequest {
string id = 1;
}
message GetDeviceRoutesRequest { string id = 1; }
message GetDeviceRoutesResponse {
repeated string enabled_routes = 1;
repeated string advertised_routes = 2;
repeated string enabled_routes = 1;
repeated string advertised_routes = 2;
}
message EnableDeviceRoutesRequest {
string id = 1;
repeated string routes = 2;
string id = 1;
repeated string routes = 2;
}
message EnableDeviceRoutesResponse {
repeated string enabled_routes = 1;
repeated string advertised_routes = 2;
repeated string enabled_routes = 1;
repeated string advertised_routes = 2;
}

View File

@ -8,129 +8,101 @@ import "headscale/v1/user.proto";
option go_package = "github.com/juanfont/headscale/gen/go/v1";
enum RegisterMethod {
REGISTER_METHOD_UNSPECIFIED = 0;
REGISTER_METHOD_AUTH_KEY = 1;
REGISTER_METHOD_CLI = 2;
REGISTER_METHOD_OIDC = 3;
REGISTER_METHOD_UNSPECIFIED = 0;
REGISTER_METHOD_AUTH_KEY = 1;
REGISTER_METHOD_CLI = 2;
REGISTER_METHOD_OIDC = 3;
}
message Node {
// 9: removal of last_successful_update
reserved 9;
// 9: removal of last_successful_update
reserved 9;
uint64 id = 1;
string machine_key = 2;
string node_key = 3;
string disco_key = 4;
repeated string ip_addresses = 5;
string name = 6;
User user = 7;
uint64 id = 1;
string machine_key = 2;
string node_key = 3;
string disco_key = 4;
repeated string ip_addresses = 5;
string name = 6;
User user = 7;
google.protobuf.Timestamp last_seen = 8;
google.protobuf.Timestamp expiry = 10;
google.protobuf.Timestamp last_seen = 8;
google.protobuf.Timestamp expiry = 10;
PreAuthKey pre_auth_key = 11;
PreAuthKey pre_auth_key = 11;
google.protobuf.Timestamp created_at = 12;
google.protobuf.Timestamp created_at = 12;
RegisterMethod register_method = 13;
RegisterMethod register_method = 13;
reserved 14 to 17;
// google.protobuf.Timestamp updated_at = 14;
// google.protobuf.Timestamp deleted_at = 15;
reserved 14 to 17;
// google.protobuf.Timestamp updated_at = 14;
// google.protobuf.Timestamp deleted_at = 15;
// bytes host_info = 15;
// bytes endpoints = 16;
// bytes enabled_routes = 17;
// bytes host_info = 15;
// bytes endpoints = 16;
// bytes enabled_routes = 17;
repeated string forced_tags = 18;
repeated string invalid_tags = 19;
repeated string valid_tags = 20;
string given_name = 21;
bool online = 22;
repeated string forced_tags = 18;
repeated string invalid_tags = 19;
repeated string valid_tags = 20;
string given_name = 21;
bool online = 22;
}
message RegisterNodeRequest {
string user = 1;
string key = 2;
string user = 1;
string key = 2;
}
message RegisterNodeResponse {
Node node = 1;
}
message RegisterNodeResponse { Node node = 1; }
message GetNodeRequest {
uint64 node_id = 1;
}
message GetNodeRequest { uint64 node_id = 1; }
message GetNodeResponse {
Node node = 1;
}
message GetNodeResponse { Node node = 1; }
message SetTagsRequest {
uint64 node_id = 1;
repeated string tags = 2;
uint64 node_id = 1;
repeated string tags = 2;
}
message SetTagsResponse {
Node node = 1;
}
message SetTagsResponse { Node node = 1; }
message DeleteNodeRequest {
uint64 node_id = 1;
}
message DeleteNodeRequest { uint64 node_id = 1; }
message DeleteNodeResponse {}
message ExpireNodeRequest {
uint64 node_id = 1;
}
message ExpireNodeRequest { uint64 node_id = 1; }
message ExpireNodeResponse {
Node node = 1;
}
message ExpireNodeResponse { Node node = 1; }
message RenameNodeRequest {
uint64 node_id = 1;
string new_name = 2;
uint64 node_id = 1;
string new_name = 2;
}
message RenameNodeResponse {
Node node = 1;
}
message RenameNodeResponse { Node node = 1; }
message ListNodesRequest {
string user = 1;
}
message ListNodesRequest { string user = 1; }
message ListNodesResponse {
repeated Node nodes = 1;
}
message ListNodesResponse { repeated Node nodes = 1; }
message MoveNodeRequest {
uint64 node_id = 1;
string user = 2;
uint64 node_id = 1;
string user = 2;
}
message MoveNodeResponse {
Node node = 1;
}
message MoveNodeResponse { Node node = 1; }
message DebugCreateNodeRequest {
string user = 1;
string key = 2;
string name = 3;
repeated string routes = 4;
string user = 1;
string key = 2;
string name = 3;
repeated string routes = 4;
}
message DebugCreateNodeResponse {
Node node = 1;
}
message DebugCreateNodeResponse { Node node = 1; }
message BackfillNodeIPsRequest {
bool confirmed = 1;
}
message BackfillNodeIPsRequest { bool confirmed = 1; }
message BackfillNodeIPsResponse {
repeated string changes = 1;
}
message BackfillNodeIPsResponse { repeated string changes = 1; }

View File

@ -1,21 +1,19 @@
syntax = "proto3";
package headscale.v1;
option go_package = "github.com/juanfont/headscale/gen/go/v1";
option go_package = "github.com/juanfont/headscale/gen/go/v1";
import "google/protobuf/timestamp.proto";
message SetPolicyRequest {
string policy = 1;
}
message SetPolicyRequest { string policy = 1; }
message SetPolicyResponse {
string policy = 1;
google.protobuf.Timestamp updated_at = 2;
string policy = 1;
google.protobuf.Timestamp updated_at = 2;
}
message GetPolicyRequest {}
message GetPolicyResponse {
string policy = 1;
google.protobuf.Timestamp updated_at = 2;
}
string policy = 1;
google.protobuf.Timestamp updated_at = 2;
}

View File

@ -1,45 +1,38 @@
syntax = "proto3";
package headscale.v1;
option go_package = "github.com/juanfont/headscale/gen/go/v1";
option go_package = "github.com/juanfont/headscale/gen/go/v1";
import "google/protobuf/timestamp.proto";
message PreAuthKey {
string user = 1;
string id = 2;
string key = 3;
bool reusable = 4;
bool ephemeral = 5;
bool used = 6;
google.protobuf.Timestamp expiration = 7;
google.protobuf.Timestamp created_at = 8;
repeated string acl_tags = 9;
string user = 1;
string id = 2;
string key = 3;
bool reusable = 4;
bool ephemeral = 5;
bool used = 6;
google.protobuf.Timestamp expiration = 7;
google.protobuf.Timestamp created_at = 8;
repeated string acl_tags = 9;
}
message CreatePreAuthKeyRequest {
string user = 1;
bool reusable = 2;
bool ephemeral = 3;
google.protobuf.Timestamp expiration = 4;
repeated string acl_tags = 5;
string user = 1;
bool reusable = 2;
bool ephemeral = 3;
google.protobuf.Timestamp expiration = 4;
repeated string acl_tags = 5;
}
message CreatePreAuthKeyResponse {
PreAuthKey pre_auth_key = 1;
}
message CreatePreAuthKeyResponse { PreAuthKey pre_auth_key = 1; }
message ExpirePreAuthKeyRequest {
string user = 1;
string key = 2;
string user = 1;
string key = 2;
}
message ExpirePreAuthKeyResponse {
}
message ExpirePreAuthKeyResponse {}
message ListPreAuthKeysRequest {
string user = 1;
}
message ListPreAuthKeysRequest { string user = 1; }
message ListPreAuthKeysResponse {
repeated PreAuthKey pre_auth_keys = 1;
}
message ListPreAuthKeysResponse { repeated PreAuthKey pre_auth_keys = 1; }

View File

@ -1,55 +1,39 @@
syntax = "proto3";
package headscale.v1;
option go_package = "github.com/juanfont/headscale/gen/go/v1";
option go_package = "github.com/juanfont/headscale/gen/go/v1";
import "google/protobuf/timestamp.proto";
import "headscale/v1/node.proto";
message Route {
uint64 id = 1;
Node node = 2;
string prefix = 3;
bool advertised = 4;
bool enabled = 5;
bool is_primary = 6;
uint64 id = 1;
Node node = 2;
string prefix = 3;
bool advertised = 4;
bool enabled = 5;
bool is_primary = 6;
google.protobuf.Timestamp created_at = 7;
google.protobuf.Timestamp updated_at = 8;
google.protobuf.Timestamp deleted_at = 9;
google.protobuf.Timestamp created_at = 7;
google.protobuf.Timestamp updated_at = 8;
google.protobuf.Timestamp deleted_at = 9;
}
message GetRoutesRequest {
}
message GetRoutesRequest {}
message GetRoutesResponse {
repeated Route routes = 1;
}
message GetRoutesResponse { repeated Route routes = 1; }
message EnableRouteRequest {
uint64 route_id = 1;
}
message EnableRouteRequest { uint64 route_id = 1; }
message EnableRouteResponse {
}
message EnableRouteResponse {}
message DisableRouteRequest {
uint64 route_id = 1;
}
message DisableRouteRequest { uint64 route_id = 1; }
message DisableRouteResponse {
}
message DisableRouteResponse {}
message GetNodeRoutesRequest {
uint64 node_id = 1;
}
message GetNodeRoutesRequest { uint64 node_id = 1; }
message GetNodeRoutesResponse {
repeated Route routes = 1;
}
message GetNodeRoutesResponse { repeated Route routes = 1; }
message DeleteRouteRequest {
uint64 route_id = 1;
}
message DeleteRouteRequest { uint64 route_id = 1; }
message DeleteRouteResponse {
}
message DeleteRouteResponse {}