[PR #6750] [MERGED] [management] require dashboard_features.agent_network when enabling agent_network_only #29863

Closed
opened 2026-08-05 08:09:12 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6750
Author: @mlsmaycon
Created: 7/13/2026
Status: Merged
Merged: 7/13/2026
Merged by: @mlsmaycon

Base: mainHead: feature/agent-network-only-dashboard-constraint


📝 Commits (1)

  • 1d6c829 [management] require dashboard_features.agent_network when enabling agent_network_only

📊 Changes

4 files changed (+27 additions, -8 deletions)

View changed files

📝 management/server/http/handlers/accounts/accounts_handler.go (+7 -0)
📝 management/server/http/handlers/accounts/accounts_handler_test.go (+16 -4)
📝 shared/management/http/api/openapi.yml (+2 -2)
📝 shared/management/http/api/types.gen.go (+2 -2)

📄 Description

Describe your changes

Adds a settings constraint: enabling agent_network_only requires dashboard_features.agent_network to be true in the same account update. Without the Agent Network menu flag, a focused account that later turns the focused view off would lose access to the Agent Network menu entirely, so the two must be set together.

The check runs in updateAccountRequestSettings against the parsed request state: if the resulting settings have agent_network_only == true but dashboard_features.agent_network is not true, the update is rejected with status.InvalidArgument (HTTP 422) before anything is persisted.

The OpenAPI field descriptions for agent_network_only and dashboard_features.agent_network document the requirement. Only the descriptions changed — required and the schema $ref are untouched — and types.gen.go was regenerated from the spec (diff is the two comment lines).

N/A — follow-up to netbirdio/netbird#6742 (dashboard_features setting) and the dashboard signup flow.

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)

The generated API reference picks up the updated OpenAPI field descriptions automatically; there is no separate user-facing doc for this account setting.

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/__

Summary by CodeRabbit

  • Bug Fixes

    • Account settings now reject enabling agent_network_only unless the dashboard_features.agent_network feature is explicitly provided and enabled.
    • Invalid configurations return a clear 422 Unprocessable Entity response instead of being accepted.
  • Documentation

    • Updated account settings documentation to explain the required relationship between agent_network_only and the agent_network dashboard feature.

🔄 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/6750 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 7/13/2026 **Status:** ✅ Merged **Merged:** 7/13/2026 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `feature/agent-network-only-dashboard-constraint` --- ### 📝 Commits (1) - [`1d6c829`](https://github.com/netbirdio/netbird/commit/1d6c829e351d94b624f7a4e058992509d7a74f02) [management] require dashboard_features.agent_network when enabling agent_network_only ### 📊 Changes **4 files changed** (+27 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `management/server/http/handlers/accounts/accounts_handler.go` (+7 -0) 📝 `management/server/http/handlers/accounts/accounts_handler_test.go` (+16 -4) 📝 `shared/management/http/api/openapi.yml` (+2 -2) 📝 `shared/management/http/api/types.gen.go` (+2 -2) </details> ### 📄 Description ## Describe your changes Adds a settings constraint: enabling `agent_network_only` requires `dashboard_features.agent_network` to be `true` in the same account update. Without the Agent Network menu flag, a focused account that later turns the focused view off would lose access to the Agent Network menu entirely, so the two must be set together. The check runs in `updateAccountRequestSettings` against the parsed request state: if the resulting settings have `agent_network_only == true` but `dashboard_features.agent_network` is not `true`, the update is rejected with `status.InvalidArgument` (HTTP 422) before anything is persisted. The OpenAPI field descriptions for `agent_network_only` and `dashboard_features.agent_network` document the requirement. Only the descriptions changed — `required` and the schema `$ref` are untouched — and `types.gen.go` was regenerated from the spec (diff is the two comment lines). ## Issue ticket number and link N/A — follow-up to netbirdio/netbird#6742 (dashboard_features setting) and the dashboard signup flow. ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [x] Created tests that fail without the change (if possible) - [x] 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) The generated API reference picks up the updated OpenAPI field descriptions automatically; there is no separate user-facing doc for this account setting. ### 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 is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Account settings now reject enabling `agent_network_only` unless the `dashboard_features.agent_network` feature is explicitly provided and enabled. - Invalid configurations return a clear `422 Unprocessable Entity` response instead of being accepted. - **Documentation** - Updated account settings documentation to explain the required relationship between `agent_network_only` and the `agent_network` dashboard feature. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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:09:12 -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#29863