mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 08:16:39 +00:00
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:
@@ -585,7 +585,10 @@ components:
|
||||
type: integer
|
||||
example: 2
|
||||
issued:
|
||||
description: How group was issued by API or from JWT token
|
||||
description: How the group was issued (api, integration, jwt)
|
||||
type: string
|
||||
enum: ["api", "integration", "jwt"]
|
||||
example: api
|
||||
type: string
|
||||
example: api
|
||||
required:
|
||||
@@ -1246,7 +1249,7 @@ paths:
|
||||
/api/accounts/{accountId}:
|
||||
delete:
|
||||
summary: Delete an Account
|
||||
description: Deletes an account and all its resources. Only administrators and account owners can delete accounts.
|
||||
description: Deletes an account and all its resources. Only account owners can delete accounts.
|
||||
tags: [ Accounts ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user