mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-17 15:56:39 +00:00
Merge branch 'feature/user-info-with-role-permissions' into feature/users-roles-endpoint
# Conflicts: # management/server/http/api/openapi.yml
This commit is contained in:
@@ -128,13 +128,7 @@ func (c *GrpcClient) Sync(ctx context.Context, sysInfo *system.Info, msgHandler
|
||||
return err
|
||||
}
|
||||
|
||||
streamErr := c.handleStream(ctx, *serverPubKey, sysInfo, msgHandler)
|
||||
if c.conn.GetState() != connectivity.Shutdown {
|
||||
if err := c.conn.Close(); err != nil {
|
||||
log.Warnf("failed closing connection to Management service: %s", err)
|
||||
}
|
||||
}
|
||||
return streamErr
|
||||
return c.handleStream(ctx, *serverPubKey, sysInfo, msgHandler)
|
||||
}
|
||||
|
||||
err := backoff.Retry(operation, defaultBackoff(ctx))
|
||||
|
||||
@@ -2033,6 +2033,32 @@ components:
|
||||
- policy_name
|
||||
- icmp_type
|
||||
- icmp_code
|
||||
NetworkTrafficEventsResponse:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
description: List of network traffic events
|
||||
items:
|
||||
$ref: "#/components/schemas/NetworkTrafficEvent"
|
||||
page:
|
||||
type: integer
|
||||
description: Current page number
|
||||
page_size:
|
||||
type: integer
|
||||
description: Number of items per page
|
||||
total_records:
|
||||
type: integer
|
||||
description: Total number of event records available
|
||||
total_pages:
|
||||
type: integer
|
||||
description: Total number of pages available
|
||||
required:
|
||||
- data
|
||||
- page
|
||||
- page_size
|
||||
- total_records
|
||||
- total_pages
|
||||
RolePermissions:
|
||||
type: object
|
||||
properties:
|
||||
@@ -4310,15 +4336,77 @@ paths:
|
||||
tags: [ Events ]
|
||||
x-cloud-only: true
|
||||
x-experimental: true
|
||||
parameters:
|
||||
- name: page
|
||||
in: query
|
||||
description: Page number
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 1
|
||||
- name: page_size
|
||||
in: query
|
||||
description: Number of items per page
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
maximum: 50000
|
||||
default: 1000
|
||||
- name: user_id
|
||||
in: query
|
||||
description: Filter by user ID
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: protocol
|
||||
in: query
|
||||
description: Filter by protocol
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
- name: type
|
||||
in: query
|
||||
description: Filter by event type
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum: [TYPE_UNKNOWN, TYPE_START, TYPE_END, TYPE_DROP]
|
||||
- name: direction
|
||||
in: query
|
||||
description: Filter by direction
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
enum: [INGRESS, EGRESS, DIRECTION_UNKNOWN]
|
||||
- name: search
|
||||
in: query
|
||||
description: Filters events with a partial match on user email, source and destination names and source and destination addresses
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: start_date
|
||||
in: query
|
||||
description: Start date for filtering events (ISO 8601 format, e.g., 2024-01-01T00:00:00Z).
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: end_date
|
||||
in: query
|
||||
description: End date for filtering events (ISO 8601 format, e.g., 2024-01-31T23:59:59Z).
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
responses:
|
||||
"200":
|
||||
description: List of network traffic events
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/NetworkTrafficEvent"
|
||||
$ref: "#/components/schemas/NetworkTrafficEventsResponse"
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
|
||||
@@ -178,6 +178,21 @@ const (
|
||||
UserStatusInvited UserStatus = "invited"
|
||||
)
|
||||
|
||||
// Defines values for GetApiEventsNetworkTrafficParamsType.
|
||||
const (
|
||||
GetApiEventsNetworkTrafficParamsTypeTYPEDROP GetApiEventsNetworkTrafficParamsType = "TYPE_DROP"
|
||||
GetApiEventsNetworkTrafficParamsTypeTYPEEND GetApiEventsNetworkTrafficParamsType = "TYPE_END"
|
||||
GetApiEventsNetworkTrafficParamsTypeTYPESTART GetApiEventsNetworkTrafficParamsType = "TYPE_START"
|
||||
GetApiEventsNetworkTrafficParamsTypeTYPEUNKNOWN GetApiEventsNetworkTrafficParamsType = "TYPE_UNKNOWN"
|
||||
)
|
||||
|
||||
// Defines values for GetApiEventsNetworkTrafficParamsDirection.
|
||||
const (
|
||||
GetApiEventsNetworkTrafficParamsDirectionDIRECTIONUNKNOWN GetApiEventsNetworkTrafficParamsDirection = "DIRECTION_UNKNOWN"
|
||||
GetApiEventsNetworkTrafficParamsDirectionEGRESS GetApiEventsNetworkTrafficParamsDirection = "EGRESS"
|
||||
GetApiEventsNetworkTrafficParamsDirectionINGRESS GetApiEventsNetworkTrafficParamsDirection = "INGRESS"
|
||||
)
|
||||
|
||||
// AccessiblePeer defines model for AccessiblePeer.
|
||||
type AccessiblePeer struct {
|
||||
// CityName Commonly used English name of the city
|
||||
@@ -915,6 +930,24 @@ type NetworkTrafficEvent struct {
|
||||
UserName *string `json:"user_name"`
|
||||
}
|
||||
|
||||
// NetworkTrafficEventsResponse defines model for NetworkTrafficEventsResponse.
|
||||
type NetworkTrafficEventsResponse struct {
|
||||
// Data List of network traffic events
|
||||
Data []NetworkTrafficEvent `json:"data"`
|
||||
|
||||
// Page Current page number
|
||||
Page int `json:"page"`
|
||||
|
||||
// PageSize Number of items per page
|
||||
PageSize int `json:"page_size"`
|
||||
|
||||
// TotalPages Total number of pages available
|
||||
TotalPages int `json:"total_pages"`
|
||||
|
||||
// TotalRecords Total number of event records available
|
||||
TotalRecords int `json:"total_records"`
|
||||
}
|
||||
|
||||
// NetworkTrafficLocation defines model for NetworkTrafficLocation.
|
||||
type NetworkTrafficLocation struct {
|
||||
// CityName Name of the city (if known).
|
||||
@@ -1741,6 +1774,42 @@ type UserRequest struct {
|
||||
Role string `json:"role"`
|
||||
}
|
||||
|
||||
// GetApiEventsNetworkTrafficParams defines parameters for GetApiEventsNetworkTraffic.
|
||||
type GetApiEventsNetworkTrafficParams struct {
|
||||
// Page Page number
|
||||
Page *int `form:"page,omitempty" json:"page,omitempty"`
|
||||
|
||||
// PageSize Number of items per page
|
||||
PageSize *int `form:"page_size,omitempty" json:"page_size,omitempty"`
|
||||
|
||||
// UserId Filter by user ID
|
||||
UserId *string `form:"user_id,omitempty" json:"user_id,omitempty"`
|
||||
|
||||
// Protocol Filter by protocol
|
||||
Protocol *int `form:"protocol,omitempty" json:"protocol,omitempty"`
|
||||
|
||||
// Type Filter by event type
|
||||
Type *GetApiEventsNetworkTrafficParamsType `form:"type,omitempty" json:"type,omitempty"`
|
||||
|
||||
// Direction Filter by direction
|
||||
Direction *GetApiEventsNetworkTrafficParamsDirection `form:"direction,omitempty" json:"direction,omitempty"`
|
||||
|
||||
// Search Filters events with a partial match on user email, source and destination names and source and destination addresses
|
||||
Search *string `form:"search,omitempty" json:"search,omitempty"`
|
||||
|
||||
// StartDate Start date for filtering events (ISO 8601 format, e.g., 2024-01-01T00:00:00Z).
|
||||
StartDate *time.Time `form:"start_date,omitempty" json:"start_date,omitempty"`
|
||||
|
||||
// EndDate End date for filtering events (ISO 8601 format, e.g., 2024-01-31T23:59:59Z).
|
||||
EndDate *time.Time `form:"end_date,omitempty" json:"end_date,omitempty"`
|
||||
}
|
||||
|
||||
// GetApiEventsNetworkTrafficParamsType defines parameters for GetApiEventsNetworkTraffic.
|
||||
type GetApiEventsNetworkTrafficParamsType string
|
||||
|
||||
// GetApiEventsNetworkTrafficParamsDirection defines parameters for GetApiEventsNetworkTraffic.
|
||||
type GetApiEventsNetworkTrafficParamsDirection string
|
||||
|
||||
// GetApiPeersParams defines parameters for GetApiPeers.
|
||||
type GetApiPeersParams struct {
|
||||
// Name Filter peers by name
|
||||
|
||||
Reference in New Issue
Block a user