From ecc82f25d96431de55da573db3716fae52a82ee7 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 18 Feb 2026 14:57:06 +0100 Subject: [PATCH] proto: add AuthRegister and AuthApprove RPCs Add auth.proto with AuthRegister{Request,Response} and AuthApprove{Request,Response} messages. Add AuthRegister and AuthApprove RPCs to the HeadscaleService in headscale.proto. These RPCs align the gRPC API with the new CLI commands (headscale auth register, headscale auth approve) that the HTML templates already reference. Updates #1850 --- proto/headscale/v1/auth.proto | 20 ++++++++++++++++++++ proto/headscale/v1/headscale.proto | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 proto/headscale/v1/auth.proto diff --git a/proto/headscale/v1/auth.proto b/proto/headscale/v1/auth.proto new file mode 100644 index 00000000..8292400e --- /dev/null +++ b/proto/headscale/v1/auth.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package headscale.v1; +option go_package = "github.com/juanfont/headscale/gen/go/v1"; + +import "headscale/v1/node.proto"; + +message AuthRegisterRequest { + string user = 1; + string auth_id = 2; +} + +message AuthRegisterResponse { + Node node = 1; +} + +message AuthApproveRequest { + string auth_id = 1; +} + +message AuthApproveResponse {} diff --git a/proto/headscale/v1/headscale.proto b/proto/headscale/v1/headscale.proto index 5e556255..5a0dd288 100644 --- a/proto/headscale/v1/headscale.proto +++ b/proto/headscale/v1/headscale.proto @@ -8,6 +8,7 @@ import "headscale/v1/user.proto"; import "headscale/v1/preauthkey.proto"; import "headscale/v1/node.proto"; import "headscale/v1/apikey.proto"; +import "headscale/v1/auth.proto"; import "headscale/v1/policy.proto"; service HeadscaleService { @@ -139,6 +140,22 @@ service HeadscaleService { // --- Node end --- + // --- Auth start --- + rpc AuthRegister(AuthRegisterRequest) returns (AuthRegisterResponse) { + option (google.api.http) = { + post : "/api/v1/auth/register" + body : "*" + }; + } + + rpc AuthApprove(AuthApproveRequest) returns (AuthApproveResponse) { + option (google.api.http) = { + post : "/api/v1/auth/approve" + body : "*" + }; + } + // --- Auth end --- + // --- ApiKeys start --- rpc CreateApiKey(CreateApiKeyRequest) returns (CreateApiKeyResponse) { option (google.api.http) = {