1
0
mirror of https://github.com/juanfont/headscale.git synced 2025-10-28 10:51:44 +01: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"; syntax = "proto3";
package headscale.v1; 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 "google/protobuf/timestamp.proto";
message ApiKey { message ApiKey {
uint64 id = 1; uint64 id = 1;
string prefix = 2; string prefix = 2;
google.protobuf.Timestamp expiration = 3; google.protobuf.Timestamp expiration = 3;
google.protobuf.Timestamp created_at = 4; google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp last_seen = 5; google.protobuf.Timestamp last_seen = 5;
} }
message CreateApiKeyRequest { message CreateApiKeyRequest { google.protobuf.Timestamp expiration = 1; }
google.protobuf.Timestamp expiration = 1;
}
message CreateApiKeyResponse { message CreateApiKeyResponse { string api_key = 1; }
string api_key = 1;
}
message ExpireApiKeyRequest { message ExpireApiKeyRequest { string prefix = 1; }
string prefix = 1;
}
message ExpireApiKeyResponse { message ExpireApiKeyResponse {}
}
message ListApiKeysRequest { message ListApiKeysRequest {}
}
message ListApiKeysResponse { message ListApiKeysResponse { repeated ApiKey api_keys = 1; }
repeated ApiKey api_keys = 1;
}
message DeleteApiKeyRequest { message DeleteApiKeyRequest { string prefix = 1; }
string prefix = 1;
}
message DeleteApiKeyResponse { message DeleteApiKeyResponse {}
}

View File

@ -1,6 +1,6 @@
syntax = "proto3"; syntax = "proto3";
package headscale.v1; 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 "google/protobuf/timestamp.proto";
@ -8,76 +8,69 @@ import "google/protobuf/timestamp.proto";
// https://github.com/tailscale/tailscale/blob/main/api.md // https://github.com/tailscale/tailscale/blob/main/api.md
message Latency { message Latency {
float latency_ms = 1; float latency_ms = 1;
bool preferred = 2; bool preferred = 2;
} }
message ClientSupports { message ClientSupports {
bool hair_pinning = 1; bool hair_pinning = 1;
bool ipv6 = 2; bool ipv6 = 2;
bool pcp = 3; bool pcp = 3;
bool pmp = 4; bool pmp = 4;
bool udp = 5; bool udp = 5;
bool upnp = 6; bool upnp = 6;
} }
message ClientConnectivity { message ClientConnectivity {
repeated string endpoints = 1; repeated string endpoints = 1;
string derp = 2; string derp = 2;
bool mapping_varies_by_dest_ip = 3; bool mapping_varies_by_dest_ip = 3;
map<string, Latency> latency = 4; map<string, Latency> latency = 4;
ClientSupports client_supports = 5; ClientSupports client_supports = 5;
} }
message GetDeviceRequest { message GetDeviceRequest { string id = 1; }
string id = 1;
}
message GetDeviceResponse { message GetDeviceResponse {
repeated string addresses = 1; repeated string addresses = 1;
string id = 2; string id = 2;
string user = 3; string user = 3;
string name = 4; string name = 4;
string hostname = 5; string hostname = 5;
string client_version = 6; string client_version = 6;
bool update_available = 7; bool update_available = 7;
string os = 8; string os = 8;
google.protobuf.Timestamp created = 9; google.protobuf.Timestamp created = 9;
google.protobuf.Timestamp last_seen = 10; google.protobuf.Timestamp last_seen = 10;
bool key_expiry_disabled = 11; bool key_expiry_disabled = 11;
google.protobuf.Timestamp expires = 12; google.protobuf.Timestamp expires = 12;
bool authorized = 13; bool authorized = 13;
bool is_external = 14; bool is_external = 14;
string machine_key = 15; string machine_key = 15;
string node_key = 16; string node_key = 16;
bool blocks_incoming_connections = 17; bool blocks_incoming_connections = 17;
repeated string enabled_routes = 18; repeated string enabled_routes = 18;
repeated string advertised_routes = 19; repeated string advertised_routes = 19;
ClientConnectivity client_connectivity = 20; ClientConnectivity client_connectivity = 20;
} }
message DeleteDeviceRequest { message DeleteDeviceRequest { string id = 1; }
string id = 1;
}
message DeleteDeviceResponse { message DeleteDeviceResponse {}
}
message GetDeviceRoutesRequest { message GetDeviceRoutesRequest { string id = 1; }
string id = 1;
}
message GetDeviceRoutesResponse { message GetDeviceRoutesResponse {
repeated string enabled_routes = 1; repeated string enabled_routes = 1;
repeated string advertised_routes = 2; repeated string advertised_routes = 2;
} }
message EnableDeviceRoutesRequest { message EnableDeviceRoutesRequest {
string id = 1; string id = 1;
repeated string routes = 2; repeated string routes = 2;
} }
message EnableDeviceRoutesResponse { message EnableDeviceRoutesResponse {
repeated string enabled_routes = 1; repeated string enabled_routes = 1;
repeated string advertised_routes = 2; 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"; option go_package = "github.com/juanfont/headscale/gen/go/v1";
enum RegisterMethod { enum RegisterMethod {
REGISTER_METHOD_UNSPECIFIED = 0; REGISTER_METHOD_UNSPECIFIED = 0;
REGISTER_METHOD_AUTH_KEY = 1; REGISTER_METHOD_AUTH_KEY = 1;
REGISTER_METHOD_CLI = 2; REGISTER_METHOD_CLI = 2;
REGISTER_METHOD_OIDC = 3; REGISTER_METHOD_OIDC = 3;
} }
message Node { message Node {
// 9: removal of last_successful_update // 9: removal of last_successful_update
reserved 9; reserved 9;
uint64 id = 1; uint64 id = 1;
string machine_key = 2; string machine_key = 2;
string node_key = 3; string node_key = 3;
string disco_key = 4; string disco_key = 4;
repeated string ip_addresses = 5; repeated string ip_addresses = 5;
string name = 6; string name = 6;
User user = 7; User user = 7;
google.protobuf.Timestamp last_seen = 8; google.protobuf.Timestamp last_seen = 8;
google.protobuf.Timestamp expiry = 10; 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; reserved 14 to 17;
// google.protobuf.Timestamp updated_at = 14; // google.protobuf.Timestamp updated_at = 14;
// google.protobuf.Timestamp deleted_at = 15; // google.protobuf.Timestamp deleted_at = 15;
// bytes host_info = 15; // bytes host_info = 15;
// bytes endpoints = 16; // bytes endpoints = 16;
// bytes enabled_routes = 17; // bytes enabled_routes = 17;
repeated string forced_tags = 18; repeated string forced_tags = 18;
repeated string invalid_tags = 19; repeated string invalid_tags = 19;
repeated string valid_tags = 20; repeated string valid_tags = 20;
string given_name = 21; string given_name = 21;
bool online = 22; bool online = 22;
} }
message RegisterNodeRequest { message RegisterNodeRequest {
string user = 1; string user = 1;
string key = 2; string key = 2;
} }
message RegisterNodeResponse { message RegisterNodeResponse { Node node = 1; }
Node node = 1;
}
message GetNodeRequest { message GetNodeRequest { uint64 node_id = 1; }
uint64 node_id = 1;
}
message GetNodeResponse { message GetNodeResponse { Node node = 1; }
Node node = 1;
}
message SetTagsRequest { message SetTagsRequest {
uint64 node_id = 1; uint64 node_id = 1;
repeated string tags = 2; repeated string tags = 2;
} }
message SetTagsResponse { message SetTagsResponse { Node node = 1; }
Node node = 1;
}
message DeleteNodeRequest { message DeleteNodeRequest { uint64 node_id = 1; }
uint64 node_id = 1;
}
message DeleteNodeResponse {} message DeleteNodeResponse {}
message ExpireNodeRequest { message ExpireNodeRequest { uint64 node_id = 1; }
uint64 node_id = 1;
}
message ExpireNodeResponse { message ExpireNodeResponse { Node node = 1; }
Node node = 1;
}
message RenameNodeRequest { message RenameNodeRequest {
uint64 node_id = 1; uint64 node_id = 1;
string new_name = 2; string new_name = 2;
} }
message RenameNodeResponse { message RenameNodeResponse { Node node = 1; }
Node node = 1;
}
message ListNodesRequest { message ListNodesRequest { string user = 1; }
string user = 1;
}
message ListNodesResponse { message ListNodesResponse { repeated Node nodes = 1; }
repeated Node nodes = 1;
}
message MoveNodeRequest { message MoveNodeRequest {
uint64 node_id = 1; uint64 node_id = 1;
string user = 2; string user = 2;
} }
message MoveNodeResponse { message MoveNodeResponse { Node node = 1; }
Node node = 1;
}
message DebugCreateNodeRequest { message DebugCreateNodeRequest {
string user = 1; string user = 1;
string key = 2; string key = 2;
string name = 3; string name = 3;
repeated string routes = 4; repeated string routes = 4;
} }
message DebugCreateNodeResponse { message DebugCreateNodeResponse { Node node = 1; }
Node node = 1;
}
message BackfillNodeIPsRequest { message BackfillNodeIPsRequest { bool confirmed = 1; }
bool confirmed = 1;
}
message BackfillNodeIPsResponse { message BackfillNodeIPsResponse { repeated string changes = 1; }
repeated string changes = 1;
}

View File

@ -1,21 +1,19 @@
syntax = "proto3"; syntax = "proto3";
package headscale.v1; 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 "google/protobuf/timestamp.proto";
message SetPolicyRequest { message SetPolicyRequest { string policy = 1; }
string policy = 1;
}
message SetPolicyResponse { message SetPolicyResponse {
string policy = 1; string policy = 1;
google.protobuf.Timestamp updated_at = 2; google.protobuf.Timestamp updated_at = 2;
} }
message GetPolicyRequest {} message GetPolicyRequest {}
message GetPolicyResponse { message GetPolicyResponse {
string policy = 1; string policy = 1;
google.protobuf.Timestamp updated_at = 2; google.protobuf.Timestamp updated_at = 2;
} }

View File

@ -1,45 +1,38 @@
syntax = "proto3"; syntax = "proto3";
package headscale.v1; 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 "google/protobuf/timestamp.proto";
message PreAuthKey { message PreAuthKey {
string user = 1; string user = 1;
string id = 2; string id = 2;
string key = 3; string key = 3;
bool reusable = 4; bool reusable = 4;
bool ephemeral = 5; bool ephemeral = 5;
bool used = 6; bool used = 6;
google.protobuf.Timestamp expiration = 7; google.protobuf.Timestamp expiration = 7;
google.protobuf.Timestamp created_at = 8; google.protobuf.Timestamp created_at = 8;
repeated string acl_tags = 9; repeated string acl_tags = 9;
} }
message CreatePreAuthKeyRequest { message CreatePreAuthKeyRequest {
string user = 1; string user = 1;
bool reusable = 2; bool reusable = 2;
bool ephemeral = 3; bool ephemeral = 3;
google.protobuf.Timestamp expiration = 4; google.protobuf.Timestamp expiration = 4;
repeated string acl_tags = 5; repeated string acl_tags = 5;
} }
message CreatePreAuthKeyResponse { message CreatePreAuthKeyResponse { PreAuthKey pre_auth_key = 1; }
PreAuthKey pre_auth_key = 1;
}
message ExpirePreAuthKeyRequest { message ExpirePreAuthKeyRequest {
string user = 1; string user = 1;
string key = 2; string key = 2;
} }
message ExpirePreAuthKeyResponse { message ExpirePreAuthKeyResponse {}
}
message ListPreAuthKeysRequest { message ListPreAuthKeysRequest { string user = 1; }
string user = 1;
}
message ListPreAuthKeysResponse { message ListPreAuthKeysResponse { repeated PreAuthKey pre_auth_keys = 1; }
repeated PreAuthKey pre_auth_keys = 1;
}

View File

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