[PR #1113] [MERGED] Handle user delete #13317

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

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1113
Author: @gigovich
Created: 8/30/2023
Status: Merged
Merged: 9/19/2023
Merged by: @pappz

Base: mainHead: handle-user-delete


📝 Commits (10+)

📊 Changes

35 files changed (+744 additions, -112 deletions)

View changed files

📝 client/cmd/testutil.go (+1 -1)
📝 client/internal/engine_test.go (+1 -1)
📝 management/client/client_test.go (+1 -1)
📝 management/cmd/management.go (+32 -3)
📝 management/cmd/root.go (+2 -0)
📝 management/server/account.go (+20 -30)
📝 management/server/account_test.go (+1 -1)
📝 management/server/activity/codes.go (+3 -0)
📝 management/server/activity/event.go (+11 -7)
management/server/activity/sqlite/crypt.go (+81 -0)
management/server/activity/sqlite/crypt_test.go (+63 -0)
📝 management/server/activity/sqlite/sqlite.go (+106 -20)
📝 management/server/activity/sqlite/sqlite_test.go (+2 -1)
📝 management/server/config.go (+2 -1)
📝 management/server/dns_test.go (+1 -1)
📝 management/server/http/api/generate.sh (+0 -0)
📝 management/server/http/api/openapi.yml (+5 -0)
📝 management/server/http/api/types.gen.go (+3 -0)
📝 management/server/http/events_handler.go (+45 -11)
📝 management/server/http/events_handler_test.go (+3 -0)

...and 15 more files

📄 Description

Describe your changes

Implement user deletion across all IDP-ss. Expires all user peers
when the user is deleted. Users are permanently removed from a local
store, but in IDP, we remove Netbird attributes for the user
untilUserDeleteFromIDPEnabled setting is not enabled for the account.

To test, an admin user should remove any additional users.

Until the UI incorporates this feature, use a curl DELETE request
targeting the /users/<USER_ID> management endpoint. Note that this
request only removes user attributes and doesn't trigger a delete
from the IDP.

To enable user removal from the IdP, set UserDeleteFromIDPEnabled
to true in account settings. Until we have a UI for this, make this
change directly in the store file.

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)
  • Extended the README / documentation, if necessary

🔄 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/1113 **Author:** [@gigovich](https://github.com/gigovich) **Created:** 8/30/2023 **Status:** ✅ Merged **Merged:** 9/19/2023 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `main` ← **Head:** `handle-user-delete` --- ### 📝 Commits (10+) - [`b3c4ceb`](https://github.com/netbirdio/netbird/commit/b3c4ceb2ff72c4ca8189234c7e89ecc8a351e53a) Delete user - [`536a1e2`](https://github.com/netbirdio/netbird/commit/536a1e218d193cc49337905ebaf9655b5f5dcc56) Refactor user remove - [`d102ba8`](https://github.com/netbirdio/netbird/commit/d102ba86faec4227d295fd535d88220b25591d52) Squash commit - [`f9069d5`](https://github.com/netbirdio/netbird/commit/f9069d5ad275a789b618358992fbe353ade0e6d5) Handle delete in Keycloak - [`34e50ad`](https://github.com/netbirdio/netbird/commit/34e50adb05edc3fdbacf16fcc030355dfa7f2529) Implement user deletion across all IdPs - [`8c33f20`](https://github.com/netbirdio/netbird/commit/8c33f20d12250e6f7f5d0dfb0575c83d01c8a3c5) Add new command line flag to mgm server - [`c6b0b9f`](https://github.com/netbirdio/netbird/commit/c6b0b9f9977a2ae1ab7d668b7d45f814322b69da) Fix user delete workflow - [`c48f849`](https://github.com/netbirdio/netbird/commit/c48f849cc09a15d6b8e556ced5bf18079bbfeb41) Extend activity store with deleted emails (#1133) - [`2553c58`](https://github.com/netbirdio/netbird/commit/2553c585eb3f73da25e0044da0485005f8120085) Close body - [`190e809`](https://github.com/netbirdio/netbird/commit/190e8090f1cfd320709cf15a9b13a0aec35fd4bd) Fix lint ### 📊 Changes **35 files changed** (+744 additions, -112 deletions) <details> <summary>View changed files</summary> 📝 `client/cmd/testutil.go` (+1 -1) 📝 `client/internal/engine_test.go` (+1 -1) 📝 `management/client/client_test.go` (+1 -1) 📝 `management/cmd/management.go` (+32 -3) 📝 `management/cmd/root.go` (+2 -0) 📝 `management/server/account.go` (+20 -30) 📝 `management/server/account_test.go` (+1 -1) 📝 `management/server/activity/codes.go` (+3 -0) 📝 `management/server/activity/event.go` (+11 -7) ➕ `management/server/activity/sqlite/crypt.go` (+81 -0) ➕ `management/server/activity/sqlite/crypt_test.go` (+63 -0) 📝 `management/server/activity/sqlite/sqlite.go` (+106 -20) 📝 `management/server/activity/sqlite/sqlite_test.go` (+2 -1) 📝 `management/server/config.go` (+2 -1) 📝 `management/server/dns_test.go` (+1 -1) 📝 `management/server/http/api/generate.sh` (+0 -0) 📝 `management/server/http/api/openapi.yml` (+5 -0) 📝 `management/server/http/api/types.gen.go` (+3 -0) 📝 `management/server/http/events_handler.go` (+45 -11) 📝 `management/server/http/events_handler_test.go` (+3 -0) _...and 15 more files_ </details> ### 📄 Description ## Describe your changes Implement user deletion across all IDP-ss. Expires all user peers when the user is deleted. Users are permanently removed from a local store, but in IDP, we remove Netbird attributes for the user untilUserDeleteFromIDPEnabled setting is not enabled for the account. To test, an admin user should remove any additional users. Until the UI incorporates this feature, use a curl **DELETE** request targeting the **/users/<USER_ID>** management endpoint. Note that this request only removes user attributes and doesn't trigger a delete from the IDP. To enable user removal from the IdP, set **UserDeleteFromIDPEnabled** to true in account settings. Until we have a UI for this, make this change directly in the store file. ## Issue ticket number and link ### 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) - [ ] Extended the README / documentation, if necessary --- <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 02:08:05 -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#13317