[PR #2804] Expose pending interactive registrations via admin API #2868

Open
opened 2025-12-29 04:19:26 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2804
Author: @oneingan
Created: 10/18/2025
Status: 🔄 Open

Base: mainHead: pending-list


📝 Commits (1)

📊 Changes

6 files changed (+225 additions, -25 deletions)

View changed files

📝 gen/go/headscale/v1/headscale_grpc.pb.go (+65 -25)
gen/go/headscale/v1/pending.pb.go (+26 -0)
📝 hscontrol/grpcv1.go (+22 -0)
📝 hscontrol/state/state.go (+41 -0)
hscontrol/types/pending_registration.go (+48 -0)
📝 proto/headscale/v1/headscale.proto (+23 -0)

📄 Description

Closes #2736

Overview

Initial draft PR to expose pending interactive registrations via the admin API (gRPC endpoint). This enables external services to list pending registration IDs and details for approval workflows. CLI support is not yet included—feedback welcome on whether to add it here.

Not ready for merge; seeking early feedback on design and implementation.

Key Changes

  • gRPC API: Added ListPendingRegistrations RPC to retrieve pending registrations from in-memory cache (ID, hostname, machine/node keys, expiry).
  • State Management: New ListPendingRegistrations method in hscontrol/state to snapshot cache entries as PendingRegistration structs.
  • Protobuf: Added PendingRegistration message and related request/response types in proto/headscale/v1/headscale.proto.
  • Helpers: New hscontrol/types/pending_registration.go for proto construction.
  • Generated files updated accordingly.

No persistence changes; aligns with in-memory cache design.

Open Questions

  • Add CLI commands (e.g., headscale pending list / approve <id>)?
  • Filtering options (e.g., by expiry, hostname)?
  • Auth for new endpoint?
  • Testing/docs TODO.

Review diff and suggest improvements!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2804 **Author:** [@oneingan](https://github.com/oneingan) **Created:** 10/18/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pending-list` --- ### 📝 Commits (1) - [`47cc4d0`](https://github.com/juanfont/headscale/commit/47cc4d0f9c048b8be4fa6fc55ddb4e837968afac) wip ### 📊 Changes **6 files changed** (+225 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `gen/go/headscale/v1/headscale_grpc.pb.go` (+65 -25) ➕ `gen/go/headscale/v1/pending.pb.go` (+26 -0) 📝 `hscontrol/grpcv1.go` (+22 -0) 📝 `hscontrol/state/state.go` (+41 -0) ➕ `hscontrol/types/pending_registration.go` (+48 -0) 📝 `proto/headscale/v1/headscale.proto` (+23 -0) </details> ### 📄 Description Closes #2736 ## Overview Initial draft PR to expose pending interactive registrations via the admin API (gRPC endpoint). This enables external services to list pending registration IDs and details for approval workflows. CLI support is not yet included—feedback welcome on whether to add it here. Not ready for merge; seeking early feedback on design and implementation. ## Key Changes - **gRPC API**: Added `ListPendingRegistrations` RPC to retrieve pending registrations from in-memory cache (ID, hostname, machine/node keys, expiry). - **State Management**: New `ListPendingRegistrations` method in `hscontrol/state` to snapshot cache entries as `PendingRegistration` structs. - **Protobuf**: Added `PendingRegistration` message and related request/response types in `proto/headscale/v1/headscale.proto`. - **Helpers**: New `hscontrol/types/pending_registration.go` for proto construction. - Generated files updated accordingly. No persistence changes; aligns with in-memory cache design. ## Open Questions - Add CLI commands (e.g., `headscale pending list` / `approve <id>`)? - Filtering options (e.g., by expiry, hostname)? - Auth for new endpoint? - Testing/docs TODO. Review diff and suggest improvements! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2868