[PR #6919] [management] network map from nmap data type #30025

Open
opened 2026-08-05 08:09:46 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/6919
Author: @pascal-fischer
Created: 7/27/2026
Status: 🔄 Open

Base: mainHead: revert/component-types


📝 Commits (10+)

  • 7ed3737 revert component types
  • a6603a2 have explicit network map data type and do calculation from there
  • 2af3a5f do not send resource policies map over the wire
  • 1500325 networkmap read-only interface for pgsql
  • 25e8820 added retrieval of policies
  • 23a5c0d added support for routes
  • 4525014 support for nameservergroups
  • 9dee2d6 added support for networkresources
  • e620c86 added support for networkrouters
  • 42ce83a added support for account network

📊 Changes

130 files changed (+10621 additions, -2631 deletions)

View changed files

📝 client/cmd/debug.go (+2 -2)
📝 client/cmd/up.go (+1 -1)
📝 client/server/network.go (+0 -1)
📝 go.mod (+1 -1)
📝 go.sum (+2 -2)
integration_tests/management/network_map_db/pgsql/base_data.sql (+10 -0)
integration_tests/management/network_map_db/pgsql/dns_settings_test.go (+23 -0)
integration_tests/management/network_map_db/pgsql/domain_test.go (+40 -0)
integration_tests/management/network_map_db/pgsql/group_test.go (+63 -0)
integration_tests/management/network_map_db/pgsql/main_test.go (+149 -0)
integration_tests/management/network_map_db/pgsql/network_resource_test.go (+67 -0)
integration_tests/management/network_map_db/pgsql/network_router_test.go (+35 -0)
integration_tests/management/network_map_db/pgsql/network_test.go (+58 -0)
integration_tests/management/network_map_db/pgsql/networks_test.go (+27 -0)
📝 management/internals/controllers/network_map/controller/controller.go (+329 -19)
management/internals/network_map_db/db_store.go (+166 -0)
management/internals/network_map_db/pgsql/account_settings.go (+84 -0)
management/internals/network_map_db/pgsql/dns.go (+124 -0)
management/internals/network_map_db/pgsql/dns_settings.go (+53 -0)
management/internals/network_map_db/pgsql/dns_test.go (+38 -0)

...and 80 more files

📄 Description

Describe your changes

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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes

    • Improved network map generation and syncing for peers, routes, DNS, network resources, routers, and peer login handling.
    • Fixed accessible-peer listing to correctly use the right peer context for online/offline status.
    • Refined firewall/SSH behavior, including IPv6 expansion, port-range handling, and legacy SSH implication evaluation.
    • Improved posture minimum-version checks with prerelease suffix handling.
  • Refactor

    • Standardized network map data handling across encoding/decoding and gRPC responses using a shared “slim twin” model.
  • Tests

    • Updated and extended coverage for the new network map encoding/decoding rules and SSH/posture logic.

🔄 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/6919 **Author:** [@pascal-fischer](https://github.com/pascal-fischer) **Created:** 7/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `revert/component-types` --- ### 📝 Commits (10+) - [`7ed3737`](https://github.com/netbirdio/netbird/commit/7ed3737cda16e83951db0b27efd6e219edbc0789) revert component types - [`a6603a2`](https://github.com/netbirdio/netbird/commit/a6603a2e0a183a90f6d76fa54a81ca9150615c04) have explicit network map data type and do calculation from there - [`2af3a5f`](https://github.com/netbirdio/netbird/commit/2af3a5fba59c2d9471d4c1cadd8676ec34aa3db0) do not send resource policies map over the wire - [`1500325`](https://github.com/netbirdio/netbird/commit/15003258d2ab080a098a1df911a4c5400e612c5c) networkmap read-only interface for pgsql - [`25e8820`](https://github.com/netbirdio/netbird/commit/25e882004f1118517cc4a5b26021896071018943) added retrieval of policies - [`23a5c0d`](https://github.com/netbirdio/netbird/commit/23a5c0de4b0bc3e503fbfa07d1410e7bc7bd3fb6) added support for routes - [`4525014`](https://github.com/netbirdio/netbird/commit/452501463231d8495d7e1c894613b6f8cbbfa298) support for nameservergroups - [`9dee2d6`](https://github.com/netbirdio/netbird/commit/9dee2d60b9540f7b01ca4ab6ce28e9cbf642d367) added support for networkresources - [`e620c86`](https://github.com/netbirdio/netbird/commit/e620c86cd4d5eff5a2e05b5e2aa033bf7808e797) added support for networkrouters - [`42ce83a`](https://github.com/netbirdio/netbird/commit/42ce83a8f322fd1e955de03c63c145d5c03da7ad) added support for account network ### 📊 Changes **130 files changed** (+10621 additions, -2631 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/debug.go` (+2 -2) 📝 `client/cmd/up.go` (+1 -1) 📝 `client/server/network.go` (+0 -1) 📝 `go.mod` (+1 -1) 📝 `go.sum` (+2 -2) ➕ `integration_tests/management/network_map_db/pgsql/base_data.sql` (+10 -0) ➕ `integration_tests/management/network_map_db/pgsql/dns_settings_test.go` (+23 -0) ➕ `integration_tests/management/network_map_db/pgsql/domain_test.go` (+40 -0) ➕ `integration_tests/management/network_map_db/pgsql/group_test.go` (+63 -0) ➕ `integration_tests/management/network_map_db/pgsql/main_test.go` (+149 -0) ➕ `integration_tests/management/network_map_db/pgsql/network_resource_test.go` (+67 -0) ➕ `integration_tests/management/network_map_db/pgsql/network_router_test.go` (+35 -0) ➕ `integration_tests/management/network_map_db/pgsql/network_test.go` (+58 -0) ➕ `integration_tests/management/network_map_db/pgsql/networks_test.go` (+27 -0) 📝 `management/internals/controllers/network_map/controller/controller.go` (+329 -19) ➕ `management/internals/network_map_db/db_store.go` (+166 -0) ➕ `management/internals/network_map_db/pgsql/account_settings.go` (+84 -0) ➕ `management/internals/network_map_db/pgsql/dns.go` (+124 -0) ➕ `management/internals/network_map_db/pgsql/dns_settings.go` (+53 -0) ➕ `management/internals/network_map_db/pgsql/dns_test.go` (+38 -0) _...and 80 more files_ </details> ### 📄 Description ## Describe your changes ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] 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/__ <!-- codesmith:footer --> --- <a href="https://app.blacksmith.sh/netbirdio/codesmith/netbird/pr/6919"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-light-v2.svg"><img alt="View with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v2.svg"></picture></a> <a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1787753305&installation_model_id=427504&pr_number=6919&repository=netbirdio%2Fnetbird&return_to=https%3A%2F%2Fgithub.com%2Fnetbirdio%2Fnetbird%2Fpull%2F6919&signature=c47e3ed05bd4dcbe0f2f23e97a36e60abf0a52de339fcab4459336b617efd685"><picture><source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"><img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"></picture></a> <sup>Need help on this PR? Tag <code>@codesmith-bot</code> with what you need. Autofix is disabled.</sup> <!-- codesmith:autofix:disabled --> <!-- /codesmith:footer --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved network map generation and syncing for peers, routes, DNS, network resources, routers, and peer login handling. * Fixed accessible-peer listing to correctly use the right peer context for online/offline status. * Refined firewall/SSH behavior, including IPv6 expansion, port-range handling, and legacy SSH implication evaluation. * Improved posture minimum-version checks with prerelease suffix handling. * **Refactor** * Standardized network map data handling across encoding/decoding and gRPC responses using a shared “slim twin” model. * **Tests** * Updated and extended coverage for the new network map encoding/decoding rules and SSH/posture logic. <!-- 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:46 -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#30025