[PR #6239] [MERGED] [management] BYOP + private-service endpoints in management REST client #29219

Open
opened 2026-08-05 08:07:41 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6239
Author: @mlsmaycon
Created: 5/21/2026
Status: Merged
Merged: 5/25/2026
Merged by: @mlsmaycon

Base: feat/private-service-expose-publicHead: feat/private-service-expose-rest-client


📝 Commits (1)

  • 665f254 feat(rest): BYOP + private-service endpoints in management REST client

📊 Changes

6 files changed (+331 additions, -13 deletions)

View changed files

📝 shared/management/client/rest/client.go (+5 -0)
📝 shared/management/client/rest/reverse_proxy_clusters.go (+20 -1)
shared/management/client/rest/reverse_proxy_clusters_test.go (+90 -0)
📝 shared/management/client/rest/reverse_proxy_services_test.go (+13 -12)
shared/management/client/rest/reverse_proxy_tokens.go (+72 -0)
shared/management/client/rest/reverse_proxy_tokens_test.go (+131 -0)

📄 Description

Describe your changes

Add the wrappers needed to drive the bring-your-own-proxy + private- service flows from external tooling (CI, IaC, dashboards built against the REST client). The existing Service / ProxyCluster types already carry Private / AccessGroups / direct_upstream via the openapi-generated shapes, so the new code is the API surface itself — not field-level plumbing.

  • ReverseProxyClustersAPI.Delete(clusterAddress): DELETE /api/reverse-proxies/clusters/{clusterAddress}. Removes every self-hosted (BYOP) proxy registration the calling account owns under that address. Shared clusters operated by NetBird are 404 here.
  • ReverseProxyTokensAPI (new file): List / Create / Delete against /api/reverse-proxies/proxy-tokens. Tokens are account-scoped and used by netbird proxy to register against management. Create returns api.ProxyTokenCreated, whose PlainToken is the one-shot secret; List and Delete operate on metadata only.

Tests cover the success + error paths for each new operation and pin the cluster List response to round-trip the private capability flag. Existing reverse_proxy_services_test.go was failing to build on the parent commit because the regenerated api types switched Service.Auth to *ServiceAuthConfig and Service.Targets to *[]ServiceTarget; fixed the literals (&api.ServiceAuthConfig{}, &[]api.ServiceTarget{...}, (*req.Targets)[0]) so the integration tag builds again — necessary to even run the new tests.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • This change does not modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — OR I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__


🔄 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/netbirdio/netbird/pull/6239 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 5/21/2026 **Status:** ✅ Merged **Merged:** 5/25/2026 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `feat/private-service-expose-public` ← **Head:** `feat/private-service-expose-rest-client` --- ### 📝 Commits (1) - [`665f254`](https://github.com/netbirdio/netbird/commit/665f254a55718a45296f85cf14306dc2bdb596c0) feat(rest): BYOP + private-service endpoints in management REST client ### 📊 Changes **6 files changed** (+331 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `shared/management/client/rest/client.go` (+5 -0) 📝 `shared/management/client/rest/reverse_proxy_clusters.go` (+20 -1) ➕ `shared/management/client/rest/reverse_proxy_clusters_test.go` (+90 -0) 📝 `shared/management/client/rest/reverse_proxy_services_test.go` (+13 -12) ➕ `shared/management/client/rest/reverse_proxy_tokens.go` (+72 -0) ➕ `shared/management/client/rest/reverse_proxy_tokens_test.go` (+131 -0) </details> ### 📄 Description ## Describe your changes Add the wrappers needed to drive the bring-your-own-proxy + private- service flows from external tooling (CI, IaC, dashboards built against the REST client). The existing Service / ProxyCluster types already carry Private / AccessGroups / direct_upstream via the openapi-generated shapes, so the new code is the API surface itself — not field-level plumbing. - ReverseProxyClustersAPI.Delete(clusterAddress): DELETE /api/reverse-proxies/clusters/{clusterAddress}. Removes every self-hosted (BYOP) proxy registration the calling account owns under that address. Shared clusters operated by NetBird are 404 here. - ReverseProxyTokensAPI (new file): List / Create / Delete against /api/reverse-proxies/proxy-tokens. Tokens are account-scoped and used by `netbird proxy` to register against management. Create returns api.ProxyTokenCreated, whose PlainToken is the one-shot secret; List and Delete operate on metadata only. Tests cover the success + error paths for each new operation and pin the cluster List response to round-trip the `private` capability flag. Existing reverse_proxy_services_test.go was failing to build on the parent commit because the regenerated api types switched Service.Auth to *ServiceAuthConfig and Service.Targets to *[]ServiceTarget; fixed the literals (`&api.ServiceAuthConfig{}`, `&[]api.ServiceTarget{...}`, `(*req.Targets)[0]`) so the integration tag builds again — necessary to even run the new tests. ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] This change does **not** modify the public API, gRPC protocols, functionality behavior, CLI / service flags, or introduce a new feature — **OR** I have discussed it with the NetBird team beforehand (link the issue / Slack thread in the description). See [CONTRIBUTING.md](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTING.md#discuss-changes-with-the-netbird-team-first). > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [ ] I added/updated documentation for this change - [x] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:07:41 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#29219