Avoid creating duplicate groups with the same name (#1579)

Avoid creating groups with the same name via API calls. 

JWT and integrations still allowed to register groups with duplicated names
This commit is contained in:
Misha Bragin
2024-03-17 11:13:39 +01:00
committed by GitHub
parent 416f04c27a
commit abd57d1191
5 changed files with 82 additions and 10 deletions

View File

@@ -8,8 +8,6 @@ import (
"github.com/netbirdio/netbird/management/server/http/util"
"github.com/netbirdio/netbird/management/server/status"
"github.com/rs/xid"
"github.com/netbirdio/netbird/management/server"
"github.com/netbirdio/netbird/management/server/jwtclaims"
@@ -151,7 +149,6 @@ func (h *GroupsHandler) CreateGroup(w http.ResponseWriter, r *http.Request) {
peers = *req.Peers
}
group := server.Group{
ID: xid.New().String(),
Name: req.Name,
Peers: peers,
Issued: server.GroupIssuedAPI,