mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 00:06:38 +00:00
merge main
This commit is contained in:
@@ -22,6 +22,7 @@ type Client interface {
|
||||
GetDeviceAuthorizationFlow(serverKey wgtypes.Key) (*proto.DeviceAuthorizationFlow, error)
|
||||
GetPKCEAuthorizationFlow(serverKey wgtypes.Key) (*proto.PKCEAuthorizationFlow, error)
|
||||
GetNetworkMap(sysInfo *system.Info) (*proto.NetworkMap, error)
|
||||
GetServerURL() string
|
||||
IsHealthy() bool
|
||||
SyncMeta(sysInfo *system.Info) error
|
||||
Logout() error
|
||||
|
||||
@@ -5,6 +5,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -29,6 +31,10 @@ import (
|
||||
const ConnectTimeout = 10 * time.Second
|
||||
|
||||
const (
|
||||
// EnvMaxRecvMsgSize overrides the default gRPC max receive message size (4 MB)
|
||||
// for the management client connection. Value is in bytes.
|
||||
EnvMaxRecvMsgSize = "NB_MANAGEMENT_GRPC_MAX_MSG_SIZE"
|
||||
|
||||
errMsgMgmtPublicKey = "failed getting Management Service public key: %s"
|
||||
errMsgNoMgmtConnection = "no connection to management"
|
||||
)
|
||||
@@ -46,6 +52,7 @@ type GrpcClient struct {
|
||||
conn *grpc.ClientConn
|
||||
connStateCallback ConnStateNotifier
|
||||
connStateCallbackLock sync.RWMutex
|
||||
serverURL string
|
||||
}
|
||||
|
||||
type ExposeRequest struct {
|
||||
@@ -56,21 +63,51 @@ type ExposeRequest struct {
|
||||
Pin string
|
||||
Password string
|
||||
UserGroups []string
|
||||
ListenPort uint16
|
||||
}
|
||||
|
||||
type ExposeResponse struct {
|
||||
ServiceName string
|
||||
Domain string
|
||||
ServiceURL string
|
||||
ServiceName string
|
||||
Domain string
|
||||
ServiceURL string
|
||||
PortAutoAssigned bool
|
||||
}
|
||||
|
||||
// MaxRecvMsgSize returns the configured max gRPC receive message size from
|
||||
// the environment, or 0 if unset (which uses the gRPC default of 4 MB).
|
||||
func MaxRecvMsgSize() int {
|
||||
val := os.Getenv(EnvMaxRecvMsgSize)
|
||||
if val == "" {
|
||||
return 0
|
||||
}
|
||||
|
||||
size, err := strconv.Atoi(val)
|
||||
if err != nil {
|
||||
log.Warnf("invalid %s value %q, using default: %v", EnvMaxRecvMsgSize, val, err)
|
||||
return 0
|
||||
}
|
||||
|
||||
if size <= 0 {
|
||||
log.Warnf("invalid %s value %d, must be positive, using default", EnvMaxRecvMsgSize, size)
|
||||
return 0
|
||||
}
|
||||
|
||||
return size
|
||||
}
|
||||
|
||||
// NewClient creates a new client to Management service
|
||||
func NewClient(ctx context.Context, addr string, ourPrivateKey wgtypes.Key, tlsEnabled bool) (*GrpcClient, error) {
|
||||
var conn *grpc.ClientConn
|
||||
|
||||
var extraOpts []grpc.DialOption
|
||||
if maxSize := MaxRecvMsgSize(); maxSize > 0 {
|
||||
extraOpts = append(extraOpts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxSize)))
|
||||
log.Infof("management gRPC max receive message size set to %d bytes", maxSize)
|
||||
}
|
||||
|
||||
operation := func() error {
|
||||
var err error
|
||||
conn, err = nbgrpc.CreateConnection(ctx, addr, tlsEnabled, wsproxy.ManagementComponent)
|
||||
conn, err = nbgrpc.CreateConnection(ctx, addr, tlsEnabled, wsproxy.ManagementComponent, extraOpts...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("create connection: %w", err)
|
||||
}
|
||||
@@ -91,9 +128,15 @@ func NewClient(ctx context.Context, addr string, ourPrivateKey wgtypes.Key, tlsE
|
||||
ctx: ctx,
|
||||
conn: conn,
|
||||
connStateCallbackLock: sync.RWMutex{},
|
||||
serverURL: addr,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetServerURL returns the management server URL
|
||||
func (c *GrpcClient) GetServerURL() string {
|
||||
return c.serverURL
|
||||
}
|
||||
|
||||
// Close closes connection to the Management Service
|
||||
func (c *GrpcClient) Close() error {
|
||||
return c.conn.Close()
|
||||
@@ -790,9 +833,10 @@ func (c *GrpcClient) StopExpose(ctx context.Context, domain string) error {
|
||||
|
||||
func fromProtoExposeResponse(resp *proto.ExposeServiceResponse) *ExposeResponse {
|
||||
return &ExposeResponse{
|
||||
ServiceName: resp.ServiceName,
|
||||
Domain: resp.Domain,
|
||||
ServiceURL: resp.ServiceUrl,
|
||||
ServiceName: resp.ServiceName,
|
||||
Domain: resp.Domain,
|
||||
ServiceURL: resp.ServiceUrl,
|
||||
PortAutoAssigned: resp.PortAutoAssigned,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,6 +852,8 @@ func toProtoExposeServiceRequest(req ExposeRequest) (*proto.ExposeServiceRequest
|
||||
protocol = proto.ExposeProtocol_EXPOSE_TCP
|
||||
case int(proto.ExposeProtocol_EXPOSE_UDP):
|
||||
protocol = proto.ExposeProtocol_EXPOSE_UDP
|
||||
case int(proto.ExposeProtocol_EXPOSE_TLS):
|
||||
protocol = proto.ExposeProtocol_EXPOSE_TLS
|
||||
default:
|
||||
return nil, fmt.Errorf("invalid expose protocol: %d", req.Protocol)
|
||||
}
|
||||
@@ -820,6 +866,7 @@ func toProtoExposeServiceRequest(req ExposeRequest) (*proto.ExposeServiceRequest
|
||||
Pin: req.Pin,
|
||||
Password: req.Password,
|
||||
UserGroups: req.UserGroups,
|
||||
ListenPort: uint32(req.ListenPort),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
95
shared/management/client/grpc_test.go
Normal file
95
shared/management/client/grpc_test.go
Normal file
@@ -0,0 +1,95 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
|
||||
mgmtProto "github.com/netbirdio/netbird/shared/management/proto"
|
||||
)
|
||||
|
||||
func TestMaxRecvMsgSize(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
envValue string
|
||||
expected int
|
||||
}{
|
||||
{name: "unset returns 0", envValue: "", expected: 0},
|
||||
{name: "valid value", envValue: "10485760", expected: 10485760},
|
||||
{name: "non-numeric returns 0", envValue: "abc", expected: 0},
|
||||
{name: "negative returns 0", envValue: "-1", expected: 0},
|
||||
{name: "zero returns 0", envValue: "0", expected: 0},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Setenv(EnvMaxRecvMsgSize, tt.envValue)
|
||||
if tt.envValue == "" {
|
||||
os.Unsetenv(EnvMaxRecvMsgSize)
|
||||
}
|
||||
assert.Equal(t, tt.expected, MaxRecvMsgSize())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// largeSyncServer implements just the Sync RPC, returning a response larger than the default 4MB limit.
|
||||
type largeSyncServer struct {
|
||||
mgmtProto.UnimplementedManagementServiceServer
|
||||
responseSize int
|
||||
}
|
||||
|
||||
func (s *largeSyncServer) GetServerKey(_ context.Context, _ *mgmtProto.Empty) (*mgmtProto.ServerKeyResponse, error) {
|
||||
// Return a response with a large WiretrusteeConfig to exceed the default limit.
|
||||
padding := strings.Repeat("x", s.responseSize)
|
||||
return &mgmtProto.ServerKeyResponse{
|
||||
Key: padding,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func TestMaxRecvMsgSizeIntegration(t *testing.T) {
|
||||
const payloadSize = 5 * 1024 * 1024 // 5MB, exceeds 4MB default
|
||||
|
||||
lis, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
require.NoError(t, err)
|
||||
|
||||
srv := grpc.NewServer()
|
||||
mgmtProto.RegisterManagementServiceServer(srv, &largeSyncServer{responseSize: payloadSize})
|
||||
go func() { _ = srv.Serve(lis) }()
|
||||
t.Cleanup(srv.Stop)
|
||||
|
||||
t.Run("default limit rejects large message", func(t *testing.T) {
|
||||
conn, err := grpc.NewClient(
|
||||
lis.Addr().String(),
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
defer conn.Close()
|
||||
|
||||
client := mgmtProto.NewManagementServiceClient(conn)
|
||||
_, err = client.GetServerKey(context.Background(), &mgmtProto.Empty{})
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "received message larger than max")
|
||||
})
|
||||
|
||||
t.Run("increased limit accepts large message", func(t *testing.T) {
|
||||
conn, err := grpc.NewClient(
|
||||
lis.Addr().String(),
|
||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10*1024*1024)),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
defer conn.Close()
|
||||
|
||||
client := mgmtProto.NewManagementServiceClient(conn)
|
||||
resp, err := client.GetServerKey(context.Background(), &mgmtProto.Empty{})
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, resp.Key, payloadSize)
|
||||
})
|
||||
}
|
||||
@@ -19,6 +19,7 @@ type MockClient struct {
|
||||
LoginFunc func(serverKey wgtypes.Key, info *system.Info, sshKey []byte, dnsLabels domain.List) (*proto.LoginResponse, error)
|
||||
GetDeviceAuthorizationFlowFunc func(serverKey wgtypes.Key) (*proto.DeviceAuthorizationFlow, error)
|
||||
GetPKCEAuthorizationFlowFunc func(serverKey wgtypes.Key) (*proto.PKCEAuthorizationFlow, error)
|
||||
GetServerURLFunc func() string
|
||||
SyncMetaFunc func(sysInfo *system.Info) error
|
||||
LogoutFunc func() error
|
||||
JobFunc func(ctx context.Context, msgHandler func(msg *proto.JobRequest) *proto.JobResponse) error
|
||||
@@ -92,6 +93,14 @@ func (m *MockClient) GetNetworkMap(_ *system.Info) (*proto.NetworkMap, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetServerURL mock implementation of GetServerURL from mgm.Client interface
|
||||
func (m *MockClient) GetServerURL() string {
|
||||
if m.GetServerURLFunc == nil {
|
||||
return ""
|
||||
}
|
||||
return m.GetServerURLFunc()
|
||||
}
|
||||
|
||||
func (m *MockClient) SyncMeta(sysInfo *system.Info) error {
|
||||
if m.SyncMetaFunc == nil {
|
||||
return nil
|
||||
|
||||
@@ -347,6 +347,10 @@ components:
|
||||
description: Set Clients auto-update version. "latest", "disabled", or a specific version (e.g "0.50.1")
|
||||
type: string
|
||||
example: "0.51.2"
|
||||
auto_update_always:
|
||||
description: When true, updates are installed automatically in the background. When false, updates require user interaction from the UI.
|
||||
type: boolean
|
||||
example: false
|
||||
embedded_idp_enabled:
|
||||
description: Indicates whether the embedded identity provider (Dex) is enabled for this account. This is a read-only field.
|
||||
type: boolean
|
||||
@@ -2822,6 +2826,10 @@ components:
|
||||
type: string
|
||||
description: "City name from geolocation"
|
||||
example: "San Francisco"
|
||||
subdivision_code:
|
||||
type: string
|
||||
description: "First-level administrative subdivision ISO code (e.g. state/province)"
|
||||
example: "CA"
|
||||
bytes_upload:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -2832,6 +2840,10 @@ components:
|
||||
format: int64
|
||||
description: "Bytes downloaded (response body size)"
|
||||
example: 8192
|
||||
protocol:
|
||||
type: string
|
||||
description: "Protocol type: http, tcp, or udp"
|
||||
example: "http"
|
||||
required:
|
||||
- id
|
||||
- service_id
|
||||
@@ -2944,12 +2956,32 @@ components:
|
||||
id:
|
||||
type: string
|
||||
description: Service ID
|
||||
example: "cs8i4ug6lnn4g9hqv7mg"
|
||||
name:
|
||||
type: string
|
||||
description: Service name
|
||||
example: "myapp.example.netbird.app"
|
||||
domain:
|
||||
type: string
|
||||
description: Domain for the service
|
||||
example: "myapp.example.netbird.app"
|
||||
mode:
|
||||
type: string
|
||||
description: Service mode. "http" for L7 reverse proxy, "tcp"/"udp"/"tls" for L4 passthrough.
|
||||
enum: [http, tcp, udp, tls]
|
||||
default: http
|
||||
example: "http"
|
||||
listen_port:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 65535
|
||||
description: Port the proxy listens on (L4/TLS only)
|
||||
example: 8443
|
||||
port_auto_assigned:
|
||||
type: boolean
|
||||
description: Whether the listen port was auto-assigned
|
||||
readOnly: true
|
||||
example: false
|
||||
proxy_cluster:
|
||||
type: string
|
||||
description: The proxy cluster handling this service (derived from domain)
|
||||
@@ -2962,14 +2994,19 @@ components:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether the service is enabled
|
||||
example: true
|
||||
pass_host_header:
|
||||
type: boolean
|
||||
description: When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address
|
||||
example: false
|
||||
rewrite_redirects:
|
||||
type: boolean
|
||||
description: When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain
|
||||
example: false
|
||||
auth:
|
||||
$ref: '#/components/schemas/ServiceAuthConfig'
|
||||
access_restrictions:
|
||||
$ref: '#/components/schemas/AccessRestrictions'
|
||||
meta:
|
||||
$ref: '#/components/schemas/ServiceMeta'
|
||||
required:
|
||||
@@ -3013,9 +3050,23 @@ components:
|
||||
name:
|
||||
type: string
|
||||
description: Service name
|
||||
example: "myapp.example.netbird.app"
|
||||
domain:
|
||||
type: string
|
||||
description: Domain for the service
|
||||
example: "myapp.example.netbird.app"
|
||||
mode:
|
||||
type: string
|
||||
description: Service mode. "http" for L7 reverse proxy, "tcp"/"udp"/"tls" for L4 passthrough.
|
||||
enum: [http, tcp, udp, tls]
|
||||
default: http
|
||||
example: "http"
|
||||
listen_port:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 65535
|
||||
description: Port the proxy listens on (L4/TLS only). Set to 0 for auto-assignment.
|
||||
example: 5432
|
||||
targets:
|
||||
type: array
|
||||
items:
|
||||
@@ -3025,19 +3076,22 @@ components:
|
||||
type: boolean
|
||||
description: Whether the service is enabled
|
||||
default: true
|
||||
example: true
|
||||
pass_host_header:
|
||||
type: boolean
|
||||
description: When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address
|
||||
example: false
|
||||
rewrite_redirects:
|
||||
type: boolean
|
||||
description: When true, Location headers in backend responses are rewritten to replace the backend address with the public-facing domain
|
||||
example: false
|
||||
auth:
|
||||
$ref: '#/components/schemas/ServiceAuthConfig'
|
||||
access_restrictions:
|
||||
$ref: '#/components/schemas/AccessRestrictions'
|
||||
required:
|
||||
- name
|
||||
- domain
|
||||
- targets
|
||||
- auth
|
||||
- enabled
|
||||
ServiceTargetOptions:
|
||||
type: object
|
||||
@@ -3045,13 +3099,16 @@ components:
|
||||
skip_tls_verify:
|
||||
type: boolean
|
||||
description: Skip TLS certificate verification for this backend
|
||||
example: false
|
||||
request_timeout:
|
||||
type: string
|
||||
description: Per-target response timeout as a Go duration string (e.g. "30s", "2m")
|
||||
example: "30s"
|
||||
path_rewrite:
|
||||
type: string
|
||||
description: Controls how the request path is rewritten before forwarding to the backend. Default strips the matched prefix. "preserve" keeps the full original request path.
|
||||
enum: [preserve]
|
||||
example: "preserve"
|
||||
custom_headers:
|
||||
type: object
|
||||
description: Extra headers sent to the backend. Hop-by-hop and proxy-managed headers (Host, Connection, Transfer-Encoding, etc.) are rejected.
|
||||
@@ -3061,32 +3118,50 @@ components:
|
||||
additionalProperties:
|
||||
type: string
|
||||
pattern: '^[^\r\n]*$'
|
||||
example: {"X-Custom-Header": "value"}
|
||||
proxy_protocol:
|
||||
type: boolean
|
||||
description: Send PROXY Protocol v2 header to this backend (TCP/TLS only)
|
||||
example: false
|
||||
session_idle_timeout:
|
||||
type: string
|
||||
description: Idle timeout before a UDP session is reaped, as a Go duration string (e.g. "30s", "2m").
|
||||
example: "2m"
|
||||
ServiceTarget:
|
||||
type: object
|
||||
properties:
|
||||
target_id:
|
||||
type: string
|
||||
description: Target ID
|
||||
example: "cs8i4ug6lnn4g9hqv7mg"
|
||||
target_type:
|
||||
type: string
|
||||
description: Target type (e.g., "peer", "resource")
|
||||
enum: [peer, resource]
|
||||
description: Target type
|
||||
enum: [peer, host, domain, subnet]
|
||||
example: "subnet"
|
||||
path:
|
||||
type: string
|
||||
description: URL path prefix for this target
|
||||
description: URL path prefix for this target (HTTP only)
|
||||
example: "/"
|
||||
protocol:
|
||||
type: string
|
||||
description: Protocol to use when connecting to the backend
|
||||
enum: [http, https]
|
||||
enum: [http, https, tcp, udp]
|
||||
example: "http"
|
||||
host:
|
||||
type: string
|
||||
description: Backend ip or domain for this target
|
||||
example: "10.10.0.1"
|
||||
port:
|
||||
type: integer
|
||||
description: Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https).
|
||||
minimum: 1
|
||||
maximum: 65535
|
||||
description: Backend port for this target
|
||||
example: 8080
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether this target is enabled
|
||||
example: true
|
||||
options:
|
||||
$ref: '#/components/schemas/ServiceTargetOptions'
|
||||
required:
|
||||
@@ -3106,15 +3181,73 @@ components:
|
||||
$ref: '#/components/schemas/BearerAuthConfig'
|
||||
link_auth:
|
||||
$ref: '#/components/schemas/LinkAuthConfig'
|
||||
header_auths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/HeaderAuthConfig'
|
||||
HeaderAuthConfig:
|
||||
type: object
|
||||
description: Static header-value authentication. The proxy checks that the named header matches the configured value.
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether header auth is enabled
|
||||
example: true
|
||||
header:
|
||||
type: string
|
||||
description: HTTP header name to check (e.g. "Authorization", "X-API-Key")
|
||||
example: "X-API-Key"
|
||||
value:
|
||||
type: string
|
||||
description: Expected header value. For Basic auth use "Basic base64(user:pass)". For Bearer use "Bearer token". Cleared in responses.
|
||||
example: "my-secret-api-key"
|
||||
required:
|
||||
- enabled
|
||||
- header
|
||||
- value
|
||||
AccessRestrictions:
|
||||
type: object
|
||||
description: Connection-level access restrictions based on IP address or geography. Applies to both HTTP and L4 services.
|
||||
properties:
|
||||
allowed_cidrs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
format: cidr
|
||||
example: "192.168.1.0/24"
|
||||
description: CIDR allowlist. If non-empty, only IPs matching these CIDRs are allowed.
|
||||
blocked_cidrs:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
format: cidr
|
||||
example: "10.0.0.0/8"
|
||||
description: CIDR blocklist. Connections from these CIDRs are rejected. Evaluated after allowed_cidrs.
|
||||
allowed_countries:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
pattern: '^[a-zA-Z]{2}$'
|
||||
example: "US"
|
||||
description: ISO 3166-1 alpha-2 country codes to allow. If non-empty, only these countries are permitted.
|
||||
blocked_countries:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
pattern: '^[a-zA-Z]{2}$'
|
||||
example: "DE"
|
||||
description: ISO 3166-1 alpha-2 country codes to block.
|
||||
PasswordAuthConfig:
|
||||
type: object
|
||||
properties:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether password auth is enabled
|
||||
example: true
|
||||
password:
|
||||
type: string
|
||||
description: Auth password
|
||||
example: "s3cret"
|
||||
required:
|
||||
- enabled
|
||||
- password
|
||||
@@ -3124,9 +3257,11 @@ components:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether PIN auth is enabled
|
||||
example: false
|
||||
pin:
|
||||
type: string
|
||||
description: PIN value
|
||||
example: "1234"
|
||||
required:
|
||||
- enabled
|
||||
- pin
|
||||
@@ -3136,10 +3271,12 @@ components:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether bearer auth is enabled
|
||||
example: true
|
||||
distribution_groups:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: "ch8i4ug6lnn4g9hqv7mg"
|
||||
description: List of group IDs that can use bearer auth
|
||||
required:
|
||||
- enabled
|
||||
@@ -3149,6 +3286,7 @@ components:
|
||||
enabled:
|
||||
type: boolean
|
||||
description: Whether link auth is enabled
|
||||
example: false
|
||||
required:
|
||||
- enabled
|
||||
ProxyTokenRequest:
|
||||
@@ -3234,17 +3372,29 @@ components:
|
||||
id:
|
||||
type: string
|
||||
description: Domain ID
|
||||
example: "ds8i4ug6lnn4g9hqv7mg"
|
||||
domain:
|
||||
type: string
|
||||
description: Domain name
|
||||
example: "example.netbird.app"
|
||||
validated:
|
||||
type: boolean
|
||||
description: Whether the domain has been validated
|
||||
example: true
|
||||
type:
|
||||
$ref: '#/components/schemas/ReverseProxyDomainType'
|
||||
target_cluster:
|
||||
type: string
|
||||
description: The proxy cluster this domain is validated against (only for custom domains)
|
||||
example: "eu.proxy.netbird.io"
|
||||
supports_custom_ports:
|
||||
type: boolean
|
||||
description: Whether the cluster supports binding arbitrary TCP/UDP ports
|
||||
example: true
|
||||
require_subdomain:
|
||||
type: boolean
|
||||
description: Whether a subdomain label is required in front of this domain. When true, the domain cannot be used bare.
|
||||
example: false
|
||||
required:
|
||||
- id
|
||||
- domain
|
||||
@@ -3256,9 +3406,11 @@ components:
|
||||
domain:
|
||||
type: string
|
||||
description: Domain name
|
||||
example: "myapp.example.com"
|
||||
target_cluster:
|
||||
type: string
|
||||
description: The proxy cluster this domain should be validated against
|
||||
example: "eu.proxy.netbird.io"
|
||||
required:
|
||||
- domain
|
||||
- target_cluster
|
||||
@@ -4328,6 +4480,12 @@ components:
|
||||
requires_authentication:
|
||||
description: Requires authentication
|
||||
content: { }
|
||||
conflict:
|
||||
description: Conflict
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
type: http
|
||||
@@ -9672,6 +9830,58 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorResponse'
|
||||
/api/reverse-proxies/clusters:
|
||||
get:
|
||||
summary: List available proxy clusters
|
||||
description: Returns a list of available proxy clusters with their connection status
|
||||
tags: [ Services ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Array of proxy clusters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ProxyCluster'
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/reverse-proxies/clusters/{clusterId}:
|
||||
delete:
|
||||
summary: Delete a self-hosted proxy cluster
|
||||
description: Removes a self-hosted (BYOP) proxy cluster and disconnects it. Only self-hosted clusters can be deleted.
|
||||
tags: [ Services ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
parameters:
|
||||
- in: path
|
||||
name: clusterId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
description: The unique identifier of the proxy cluster
|
||||
responses:
|
||||
'200':
|
||||
description: Proxy cluster deleted successfully
|
||||
content: { }
|
||||
'400':
|
||||
"$ref": "#/components/responses/bad_request"
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/reverse-proxies/proxy-tokens:
|
||||
get:
|
||||
summary: List Proxy Tokens
|
||||
@@ -9797,29 +10007,8 @@ paths:
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/reverse-proxies/clusters:
|
||||
get:
|
||||
summary: List available proxy clusters
|
||||
description: Returns a list of available proxy clusters with their connection status
|
||||
tags: [ Services ]
|
||||
security:
|
||||
- BearerAuth: [ ]
|
||||
- TokenAuth: [ ]
|
||||
responses:
|
||||
'200':
|
||||
description: A JSON Array of proxy clusters
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/ProxyCluster'
|
||||
'401':
|
||||
"$ref": "#/components/responses/requires_authentication"
|
||||
'403':
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'409':
|
||||
"$ref": "#/components/responses/conflict"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
/api/reverse-proxies/clusters/{clusterId}:
|
||||
@@ -9918,6 +10107,8 @@ paths:
|
||||
"$ref": "#/components/responses/forbidden"
|
||||
'404':
|
||||
"$ref": "#/components/responses/not_found"
|
||||
'409':
|
||||
"$ref": "#/components/responses/conflict"
|
||||
'500':
|
||||
"$ref": "#/components/responses/internal_error"
|
||||
delete:
|
||||
|
||||
@@ -880,6 +880,30 @@ func (e SentinelOneMatchAttributesNetworkStatus) Valid() bool {
|
||||
}
|
||||
}
|
||||
|
||||
// Defines values for ServiceMode.
|
||||
const (
|
||||
ServiceModeHttp ServiceMode = "http"
|
||||
ServiceModeTcp ServiceMode = "tcp"
|
||||
ServiceModeTls ServiceMode = "tls"
|
||||
ServiceModeUdp ServiceMode = "udp"
|
||||
)
|
||||
|
||||
// Valid indicates whether the value is a known member of the ServiceMode enum.
|
||||
func (e ServiceMode) Valid() bool {
|
||||
switch e {
|
||||
case ServiceModeHttp:
|
||||
return true
|
||||
case ServiceModeTcp:
|
||||
return true
|
||||
case ServiceModeTls:
|
||||
return true
|
||||
case ServiceModeUdp:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Defines values for ServiceMetaStatus.
|
||||
const (
|
||||
ServiceMetaStatusActive ServiceMetaStatus = "active"
|
||||
@@ -910,10 +934,36 @@ func (e ServiceMetaStatus) Valid() bool {
|
||||
}
|
||||
}
|
||||
|
||||
// Defines values for ServiceRequestMode.
|
||||
const (
|
||||
ServiceRequestModeHttp ServiceRequestMode = "http"
|
||||
ServiceRequestModeTcp ServiceRequestMode = "tcp"
|
||||
ServiceRequestModeTls ServiceRequestMode = "tls"
|
||||
ServiceRequestModeUdp ServiceRequestMode = "udp"
|
||||
)
|
||||
|
||||
// Valid indicates whether the value is a known member of the ServiceRequestMode enum.
|
||||
func (e ServiceRequestMode) Valid() bool {
|
||||
switch e {
|
||||
case ServiceRequestModeHttp:
|
||||
return true
|
||||
case ServiceRequestModeTcp:
|
||||
return true
|
||||
case ServiceRequestModeTls:
|
||||
return true
|
||||
case ServiceRequestModeUdp:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Defines values for ServiceTargetProtocol.
|
||||
const (
|
||||
ServiceTargetProtocolHttp ServiceTargetProtocol = "http"
|
||||
ServiceTargetProtocolHttps ServiceTargetProtocol = "https"
|
||||
ServiceTargetProtocolTcp ServiceTargetProtocol = "tcp"
|
||||
ServiceTargetProtocolUdp ServiceTargetProtocol = "udp"
|
||||
)
|
||||
|
||||
// Valid indicates whether the value is a known member of the ServiceTargetProtocol enum.
|
||||
@@ -923,6 +973,10 @@ func (e ServiceTargetProtocol) Valid() bool {
|
||||
return true
|
||||
case ServiceTargetProtocolHttps:
|
||||
return true
|
||||
case ServiceTargetProtocolTcp:
|
||||
return true
|
||||
case ServiceTargetProtocolUdp:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
@@ -930,16 +984,22 @@ func (e ServiceTargetProtocol) Valid() bool {
|
||||
|
||||
// Defines values for ServiceTargetTargetType.
|
||||
const (
|
||||
ServiceTargetTargetTypePeer ServiceTargetTargetType = "peer"
|
||||
ServiceTargetTargetTypeResource ServiceTargetTargetType = "resource"
|
||||
ServiceTargetTargetTypeDomain ServiceTargetTargetType = "domain"
|
||||
ServiceTargetTargetTypeHost ServiceTargetTargetType = "host"
|
||||
ServiceTargetTargetTypePeer ServiceTargetTargetType = "peer"
|
||||
ServiceTargetTargetTypeSubnet ServiceTargetTargetType = "subnet"
|
||||
)
|
||||
|
||||
// Valid indicates whether the value is a known member of the ServiceTargetTargetType enum.
|
||||
func (e ServiceTargetTargetType) Valid() bool {
|
||||
switch e {
|
||||
case ServiceTargetTargetTypeDomain:
|
||||
return true
|
||||
case ServiceTargetTargetTypeHost:
|
||||
return true
|
||||
case ServiceTargetTargetTypePeer:
|
||||
return true
|
||||
case ServiceTargetTargetTypeResource:
|
||||
case ServiceTargetTargetTypeSubnet:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
@@ -1216,6 +1276,21 @@ func (e PutApiIntegrationsMspTenantsIdInviteJSONBodyValue) Valid() bool {
|
||||
}
|
||||
}
|
||||
|
||||
// AccessRestrictions Connection-level access restrictions based on IP address or geography. Applies to both HTTP and L4 services.
|
||||
type AccessRestrictions struct {
|
||||
// AllowedCidrs CIDR allowlist. If non-empty, only IPs matching these CIDRs are allowed.
|
||||
AllowedCidrs *[]string `json:"allowed_cidrs,omitempty"`
|
||||
|
||||
// AllowedCountries ISO 3166-1 alpha-2 country codes to allow. If non-empty, only these countries are permitted.
|
||||
AllowedCountries *[]string `json:"allowed_countries,omitempty"`
|
||||
|
||||
// BlockedCidrs CIDR blocklist. Connections from these CIDRs are rejected. Evaluated after allowed_cidrs.
|
||||
BlockedCidrs *[]string `json:"blocked_cidrs,omitempty"`
|
||||
|
||||
// BlockedCountries ISO 3166-1 alpha-2 country codes to block.
|
||||
BlockedCountries *[]string `json:"blocked_countries,omitempty"`
|
||||
}
|
||||
|
||||
// AccessiblePeer defines model for AccessiblePeer.
|
||||
type AccessiblePeer struct {
|
||||
// CityName Commonly used English name of the city
|
||||
@@ -1307,6 +1382,9 @@ type AccountRequest struct {
|
||||
|
||||
// AccountSettings defines model for AccountSettings.
|
||||
type AccountSettings struct {
|
||||
// AutoUpdateAlways When true, updates are installed automatically in the background. When false, updates require user interaction from the UI.
|
||||
AutoUpdateAlways *bool `json:"auto_update_always,omitempty"`
|
||||
|
||||
// AutoUpdateVersion Set Clients auto-update version. "latest", "disabled", or a specific version (e.g "0.50.1")
|
||||
AutoUpdateVersion *string `json:"auto_update_version,omitempty"`
|
||||
|
||||
@@ -1925,6 +2003,18 @@ type GroupRequest struct {
|
||||
Resources *[]Resource `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
// HeaderAuthConfig Static header-value authentication. The proxy checks that the named header matches the configured value.
|
||||
type HeaderAuthConfig struct {
|
||||
// Enabled Whether header auth is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Header HTTP header name to check (e.g. "Authorization", "X-API-Key")
|
||||
Header string `json:"header"`
|
||||
|
||||
// Value Expected header value. For Basic auth use "Basic base64(user:pass)". For Bearer use "Bearer token". Cleared in responses.
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
// HuntressMatchAttributes Attribute conditions to match when approving agents
|
||||
type HuntressMatchAttributes struct {
|
||||
// DefenderPolicyStatus Policy status of Defender AV for Managed Antivirus.
|
||||
@@ -3246,6 +3336,9 @@ type ProxyAccessLog struct {
|
||||
// Path Path of the request
|
||||
Path string `json:"path"`
|
||||
|
||||
// Protocol Protocol type: http, tcp, or udp
|
||||
Protocol *string `json:"protocol,omitempty"`
|
||||
|
||||
// Reason Reason for the request result (e.g., authentication failure)
|
||||
Reason *string `json:"reason,omitempty"`
|
||||
|
||||
@@ -3258,6 +3351,9 @@ type ProxyAccessLog struct {
|
||||
// StatusCode HTTP status code returned
|
||||
StatusCode int `json:"status_code"`
|
||||
|
||||
// SubdivisionCode First-level administrative subdivision ISO code (e.g. state/province)
|
||||
SubdivisionCode *string `json:"subdivision_code,omitempty"`
|
||||
|
||||
// Timestamp Timestamp when the request was made
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
|
||||
@@ -3345,6 +3441,12 @@ type ReverseProxyDomain struct {
|
||||
// Id Domain ID
|
||||
Id string `json:"id"`
|
||||
|
||||
// RequireSubdomain Whether a subdomain label is required in front of this domain. When true, the domain cannot be used bare.
|
||||
RequireSubdomain *bool `json:"require_subdomain,omitempty"`
|
||||
|
||||
// SupportsCustomPorts Whether the cluster supports binding arbitrary TCP/UDP ports
|
||||
SupportsCustomPorts *bool `json:"supports_custom_ports,omitempty"`
|
||||
|
||||
// TargetCluster The proxy cluster this domain is validated against (only for custom domains)
|
||||
TargetCluster *string `json:"target_cluster,omitempty"`
|
||||
|
||||
@@ -3528,7 +3630,9 @@ type SentinelOneMatchAttributesNetworkStatus string
|
||||
|
||||
// Service defines model for Service.
|
||||
type Service struct {
|
||||
Auth ServiceAuthConfig `json:"auth"`
|
||||
// AccessRestrictions Connection-level access restrictions based on IP address or geography. Applies to both HTTP and L4 services.
|
||||
AccessRestrictions *AccessRestrictions `json:"access_restrictions,omitempty"`
|
||||
Auth ServiceAuthConfig `json:"auth"`
|
||||
|
||||
// Domain Domain for the service
|
||||
Domain string `json:"domain"`
|
||||
@@ -3537,8 +3641,14 @@ type Service struct {
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// Id Service ID
|
||||
Id string `json:"id"`
|
||||
Meta ServiceMeta `json:"meta"`
|
||||
Id string `json:"id"`
|
||||
|
||||
// ListenPort Port the proxy listens on (L4/TLS only)
|
||||
ListenPort *int `json:"listen_port,omitempty"`
|
||||
Meta ServiceMeta `json:"meta"`
|
||||
|
||||
// Mode Service mode. "http" for L7 reverse proxy, "tcp"/"udp"/"tls" for L4 passthrough.
|
||||
Mode *ServiceMode `json:"mode,omitempty"`
|
||||
|
||||
// Name Service name
|
||||
Name string `json:"name"`
|
||||
@@ -3546,6 +3656,9 @@ type Service struct {
|
||||
// PassHostHeader When true, the original client Host header is passed through to the backend instead of being rewritten to the backend's address
|
||||
PassHostHeader *bool `json:"pass_host_header,omitempty"`
|
||||
|
||||
// PortAutoAssigned Whether the listen port was auto-assigned
|
||||
PortAutoAssigned *bool `json:"port_auto_assigned,omitempty"`
|
||||
|
||||
// ProxyCluster The proxy cluster handling this service (derived from domain)
|
||||
ProxyCluster *string `json:"proxy_cluster,omitempty"`
|
||||
|
||||
@@ -3556,9 +3669,13 @@ type Service struct {
|
||||
Targets []ServiceTarget `json:"targets"`
|
||||
}
|
||||
|
||||
// ServiceMode Service mode. "http" for L7 reverse proxy, "tcp"/"udp"/"tls" for L4 passthrough.
|
||||
type ServiceMode string
|
||||
|
||||
// ServiceAuthConfig defines model for ServiceAuthConfig.
|
||||
type ServiceAuthConfig struct {
|
||||
BearerAuth *BearerAuthConfig `json:"bearer_auth,omitempty"`
|
||||
HeaderAuths *[]HeaderAuthConfig `json:"header_auths,omitempty"`
|
||||
LinkAuth *LinkAuthConfig `json:"link_auth,omitempty"`
|
||||
PasswordAuth *PasswordAuthConfig `json:"password_auth,omitempty"`
|
||||
PinAuth *PINAuthConfig `json:"pin_auth,omitempty"`
|
||||
@@ -3581,7 +3698,9 @@ type ServiceMetaStatus string
|
||||
|
||||
// ServiceRequest defines model for ServiceRequest.
|
||||
type ServiceRequest struct {
|
||||
Auth ServiceAuthConfig `json:"auth"`
|
||||
// AccessRestrictions Connection-level access restrictions based on IP address or geography. Applies to both HTTP and L4 services.
|
||||
AccessRestrictions *AccessRestrictions `json:"access_restrictions,omitempty"`
|
||||
Auth *ServiceAuthConfig `json:"auth,omitempty"`
|
||||
|
||||
// Domain Domain for the service
|
||||
Domain string `json:"domain"`
|
||||
@@ -3589,6 +3708,12 @@ type ServiceRequest struct {
|
||||
// Enabled Whether the service is enabled
|
||||
Enabled bool `json:"enabled"`
|
||||
|
||||
// ListenPort Port the proxy listens on (L4/TLS only). Set to 0 for auto-assignment.
|
||||
ListenPort *int `json:"listen_port,omitempty"`
|
||||
|
||||
// Mode Service mode. "http" for L7 reverse proxy, "tcp"/"udp"/"tls" for L4 passthrough.
|
||||
Mode *ServiceRequestMode `json:"mode,omitempty"`
|
||||
|
||||
// Name Service name
|
||||
Name string `json:"name"`
|
||||
|
||||
@@ -3599,9 +3724,12 @@ type ServiceRequest struct {
|
||||
RewriteRedirects *bool `json:"rewrite_redirects,omitempty"`
|
||||
|
||||
// Targets List of target backends for this service
|
||||
Targets []ServiceTarget `json:"targets"`
|
||||
Targets *[]ServiceTarget `json:"targets,omitempty"`
|
||||
}
|
||||
|
||||
// ServiceRequestMode Service mode. "http" for L7 reverse proxy, "tcp"/"udp"/"tls" for L4 passthrough.
|
||||
type ServiceRequestMode string
|
||||
|
||||
// ServiceTarget defines model for ServiceTarget.
|
||||
type ServiceTarget struct {
|
||||
// Enabled Whether this target is enabled
|
||||
@@ -3611,10 +3739,10 @@ type ServiceTarget struct {
|
||||
Host *string `json:"host,omitempty"`
|
||||
Options *ServiceTargetOptions `json:"options,omitempty"`
|
||||
|
||||
// Path URL path prefix for this target
|
||||
// Path URL path prefix for this target (HTTP only)
|
||||
Path *string `json:"path,omitempty"`
|
||||
|
||||
// Port Backend port for this target. Use 0 or omit to use the scheme default (80 for http, 443 for https).
|
||||
// Port Backend port for this target
|
||||
Port int `json:"port"`
|
||||
|
||||
// Protocol Protocol to use when connecting to the backend
|
||||
@@ -3623,14 +3751,14 @@ type ServiceTarget struct {
|
||||
// TargetId Target ID
|
||||
TargetId string `json:"target_id"`
|
||||
|
||||
// TargetType Target type (e.g., "peer", "resource")
|
||||
// TargetType Target type
|
||||
TargetType ServiceTargetTargetType `json:"target_type"`
|
||||
}
|
||||
|
||||
// ServiceTargetProtocol Protocol to use when connecting to the backend
|
||||
type ServiceTargetProtocol string
|
||||
|
||||
// ServiceTargetTargetType Target type (e.g., "peer", "resource")
|
||||
// ServiceTargetTargetType Target type
|
||||
type ServiceTargetTargetType string
|
||||
|
||||
// ServiceTargetOptions defines model for ServiceTargetOptions.
|
||||
@@ -3641,9 +3769,15 @@ type ServiceTargetOptions struct {
|
||||
// PathRewrite Controls how the request path is rewritten before forwarding to the backend. Default strips the matched prefix. "preserve" keeps the full original request path.
|
||||
PathRewrite *ServiceTargetOptionsPathRewrite `json:"path_rewrite,omitempty"`
|
||||
|
||||
// ProxyProtocol Send PROXY Protocol v2 header to this backend (TCP/TLS only)
|
||||
ProxyProtocol *bool `json:"proxy_protocol,omitempty"`
|
||||
|
||||
// RequestTimeout Per-target response timeout as a Go duration string (e.g. "30s", "2m")
|
||||
RequestTimeout *string `json:"request_timeout,omitempty"`
|
||||
|
||||
// SessionIdleTimeout Idle timeout before a UDP session is reaped, as a Go duration string (e.g. "30s", "2m").
|
||||
SessionIdleTimeout *string `json:"session_idle_timeout,omitempty"`
|
||||
|
||||
// SkipTlsVerify Skip TLS certificate verification for this backend
|
||||
SkipTlsVerify *bool `json:"skip_tls_verify,omitempty"`
|
||||
}
|
||||
@@ -4168,6 +4302,9 @@ type ZoneRequest struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// Conflict Standard error response. Note: The exact structure of this error response is inferred from `util.WriteErrorResponse` and `util.WriteError` usage in the provided Go code, as a specific Go struct for errors was not provided.
|
||||
type Conflict = ErrorResponse
|
||||
|
||||
// GetApiEventsNetworkTrafficParams defines parameters for GetApiEventsNetworkTraffic.
|
||||
type GetApiEventsNetworkTrafficParams struct {
|
||||
// Page Page number
|
||||
|
||||
@@ -228,6 +228,7 @@ const (
|
||||
ExposeProtocol_EXPOSE_HTTPS ExposeProtocol = 1
|
||||
ExposeProtocol_EXPOSE_TCP ExposeProtocol = 2
|
||||
ExposeProtocol_EXPOSE_UDP ExposeProtocol = 3
|
||||
ExposeProtocol_EXPOSE_TLS ExposeProtocol = 4
|
||||
)
|
||||
|
||||
// Enum value maps for ExposeProtocol.
|
||||
@@ -237,12 +238,14 @@ var (
|
||||
1: "EXPOSE_HTTPS",
|
||||
2: "EXPOSE_TCP",
|
||||
3: "EXPOSE_UDP",
|
||||
4: "EXPOSE_TLS",
|
||||
}
|
||||
ExposeProtocol_value = map[string]int32{
|
||||
"EXPOSE_HTTP": 0,
|
||||
"EXPOSE_HTTPS": 1,
|
||||
"EXPOSE_TCP": 2,
|
||||
"EXPOSE_UDP": 3,
|
||||
"EXPOSE_TLS": 4,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -4047,6 +4050,7 @@ type ExposeServiceRequest struct {
|
||||
UserGroups []string `protobuf:"bytes,5,rep,name=user_groups,json=userGroups,proto3" json:"user_groups,omitempty"`
|
||||
Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"`
|
||||
NamePrefix string `protobuf:"bytes,7,opt,name=name_prefix,json=namePrefix,proto3" json:"name_prefix,omitempty"`
|
||||
ListenPort uint32 `protobuf:"varint,8,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExposeServiceRequest) Reset() {
|
||||
@@ -4130,14 +4134,22 @@ func (x *ExposeServiceRequest) GetNamePrefix() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExposeServiceRequest) GetListenPort() uint32 {
|
||||
if x != nil {
|
||||
return x.ListenPort
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ExposeServiceResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
|
||||
ServiceUrl string `protobuf:"bytes,2,opt,name=service_url,json=serviceUrl,proto3" json:"service_url,omitempty"`
|
||||
Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"`
|
||||
ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
|
||||
ServiceUrl string `protobuf:"bytes,2,opt,name=service_url,json=serviceUrl,proto3" json:"service_url,omitempty"`
|
||||
Domain string `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"`
|
||||
PortAutoAssigned bool `protobuf:"varint,4,opt,name=port_auto_assigned,json=portAutoAssigned,proto3" json:"port_auto_assigned,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ExposeServiceResponse) Reset() {
|
||||
@@ -4193,6 +4205,13 @@ func (x *ExposeServiceResponse) GetDomain() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ExposeServiceResponse) GetPortAutoAssigned() bool {
|
||||
if x != nil {
|
||||
return x.PortAutoAssigned
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type RenewExposeRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
@@ -4996,7 +5015,7 @@ var file_management_proto_rawDesc = []byte{
|
||||
0x64, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61,
|
||||
0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x72,
|
||||
0x74, 0x22, 0xea, 0x01, 0x0a, 0x14, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76,
|
||||
0x74, 0x22, 0x8b, 0x02, 0x0a, 0x14, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f,
|
||||
0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x36,
|
||||
0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
|
||||
@@ -5010,15 +5029,20 @@ var file_management_proto_rawDesc = []byte{
|
||||
0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18,
|
||||
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1f, 0x0a,
|
||||
0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x07, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x22, 0x73,
|
||||
0x0a, 0x15, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65,
|
||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64,
|
||||
0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x22, 0x2c, 0x0a, 0x12, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x45, 0x78, 0x70, 0x6f,
|
||||
0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f,
|
||||
0x0a, 0x0b, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x22,
|
||||
0xa1, 0x01, 0x0a, 0x15, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64,
|
||||
0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x75,
|
||||
0x74, 0x6f, 0x5f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x10, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x75, 0x74, 0x6f, 0x41, 0x73, 0x73, 0x69, 0x67,
|
||||
0x6e, 0x65, 0x64, 0x22, 0x2c, 0x0a, 0x12, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x45, 0x78, 0x70, 0x6f,
|
||||
0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d,
|
||||
0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69,
|
||||
0x6e, 0x22, 0x15, 0x0a, 0x13, 0x52, 0x65, 0x6e, 0x65, 0x77, 0x45, 0x78, 0x70, 0x6f, 0x73, 0x65,
|
||||
@@ -5039,12 +5063,13 @@ var file_management_proto_rawDesc = []byte{
|
||||
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x07,
|
||||
0x0a, 0x03, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x2a, 0x22, 0x0a, 0x0a, 0x52, 0x75, 0x6c, 0x65, 0x41,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10,
|
||||
0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x01, 0x2a, 0x53, 0x0a, 0x0e, 0x45,
|
||||
0x00, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x52, 0x4f, 0x50, 0x10, 0x01, 0x2a, 0x63, 0x0a, 0x0e, 0x45,
|
||||
0x78, 0x70, 0x6f, 0x73, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x0f, 0x0a,
|
||||
0x0b, 0x45, 0x58, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x10, 0x00, 0x12, 0x10,
|
||||
0x0a, 0x0c, 0x45, 0x58, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x48, 0x54, 0x54, 0x50, 0x53, 0x10, 0x01,
|
||||
0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x54, 0x43, 0x50, 0x10, 0x02,
|
||||
0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x55, 0x44, 0x50, 0x10, 0x03,
|
||||
0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x4f, 0x53, 0x45, 0x5f, 0x54, 0x4c, 0x53, 0x10, 0x04,
|
||||
0x32, 0xfd, 0x06, 0x0a, 0x11, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12,
|
||||
0x1c, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x45, 0x6e, 0x63,
|
||||
|
||||
@@ -340,8 +340,8 @@ message PeerConfig {
|
||||
message AutoUpdateSettings {
|
||||
string version = 1;
|
||||
/*
|
||||
alwaysUpdate = true → Updates happen automatically in the background
|
||||
alwaysUpdate = false → Updates only happen when triggered by a peer connection
|
||||
alwaysUpdate = true → Updates are installed automatically in the background
|
||||
alwaysUpdate = false → Updates require user interaction from the UI
|
||||
*/
|
||||
bool alwaysUpdate = 2;
|
||||
}
|
||||
@@ -652,6 +652,7 @@ enum ExposeProtocol {
|
||||
EXPOSE_HTTPS = 1;
|
||||
EXPOSE_TCP = 2;
|
||||
EXPOSE_UDP = 3;
|
||||
EXPOSE_TLS = 4;
|
||||
}
|
||||
|
||||
message ExposeServiceRequest {
|
||||
@@ -662,12 +663,14 @@ message ExposeServiceRequest {
|
||||
repeated string user_groups = 5;
|
||||
string domain = 6;
|
||||
string name_prefix = 7;
|
||||
uint32 listen_port = 8;
|
||||
}
|
||||
|
||||
message ExposeServiceResponse {
|
||||
string service_name = 1;
|
||||
string service_url = 2;
|
||||
string domain = 3;
|
||||
bool port_auto_assigned = 4;
|
||||
}
|
||||
|
||||
message RenewExposeRequest {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27,12 +27,22 @@ service ProxyService {
|
||||
rpc ValidateSession(ValidateSessionRequest) returns (ValidateSessionResponse);
|
||||
}
|
||||
|
||||
// ProxyCapabilities describes what a proxy can handle.
|
||||
message ProxyCapabilities {
|
||||
// Whether the proxy can bind arbitrary ports for TCP/UDP/TLS services.
|
||||
optional bool supports_custom_ports = 1;
|
||||
// Whether the proxy requires a subdomain label in front of its cluster domain.
|
||||
// When true, accounts cannot use the cluster domain bare.
|
||||
optional bool require_subdomain = 2;
|
||||
}
|
||||
|
||||
// GetMappingUpdateRequest is sent to initialise a mapping stream.
|
||||
message GetMappingUpdateRequest {
|
||||
string proxy_id = 1;
|
||||
string version = 2;
|
||||
google.protobuf.Timestamp started_at = 3;
|
||||
string address = 4;
|
||||
ProxyCapabilities capabilities = 5;
|
||||
}
|
||||
|
||||
// GetMappingUpdateResponse contains zero or more ProxyMappings.
|
||||
@@ -61,6 +71,10 @@ message PathTargetOptions {
|
||||
google.protobuf.Duration request_timeout = 2;
|
||||
PathRewriteMode path_rewrite = 3;
|
||||
map<string, string> custom_headers = 4;
|
||||
// Send PROXY protocol v2 header to this backend.
|
||||
bool proxy_protocol = 5;
|
||||
// Idle timeout before a UDP session is reaped.
|
||||
google.protobuf.Duration session_idle_timeout = 6;
|
||||
}
|
||||
|
||||
message PathMapping {
|
||||
@@ -69,12 +83,27 @@ message PathMapping {
|
||||
PathTargetOptions options = 3;
|
||||
}
|
||||
|
||||
message HeaderAuth {
|
||||
// Header name to check, e.g. "Authorization", "X-API-Key".
|
||||
string header = 1;
|
||||
// argon2id hash of the expected full header value.
|
||||
string hashed_value = 2;
|
||||
}
|
||||
|
||||
message Authentication {
|
||||
string session_key = 1;
|
||||
int64 max_session_age_seconds = 2;
|
||||
bool password = 3;
|
||||
bool pin = 4;
|
||||
bool oidc = 5;
|
||||
repeated HeaderAuth header_auths = 6;
|
||||
}
|
||||
|
||||
message AccessRestrictions {
|
||||
repeated string allowed_cidrs = 1;
|
||||
repeated string blocked_cidrs = 2;
|
||||
repeated string allowed_countries = 3;
|
||||
repeated string blocked_countries = 4;
|
||||
}
|
||||
|
||||
message ProxyMapping {
|
||||
@@ -91,6 +120,11 @@ message ProxyMapping {
|
||||
// When true, Location headers in backend responses are rewritten to replace
|
||||
// the backend address with the public-facing domain.
|
||||
bool rewrite_redirects = 9;
|
||||
// Service mode: "http", "tcp", "udp", or "tls".
|
||||
string mode = 10;
|
||||
// For L4/TLS: the port the proxy listens on.
|
||||
int32 listen_port = 11;
|
||||
AccessRestrictions access_restrictions = 12;
|
||||
}
|
||||
|
||||
// SendAccessLogRequest consists of one or more AccessLogs from a Proxy.
|
||||
@@ -117,6 +151,7 @@ message AccessLog {
|
||||
bool auth_success = 13;
|
||||
int64 bytes_upload = 14;
|
||||
int64 bytes_download = 15;
|
||||
string protocol = 16;
|
||||
}
|
||||
|
||||
message AuthenticateRequest {
|
||||
@@ -125,9 +160,15 @@ message AuthenticateRequest {
|
||||
oneof request {
|
||||
PasswordRequest password = 3;
|
||||
PinRequest pin = 4;
|
||||
HeaderAuthRequest header_auth = 5;
|
||||
}
|
||||
}
|
||||
|
||||
message HeaderAuthRequest {
|
||||
string header_value = 1;
|
||||
string header_name = 2;
|
||||
}
|
||||
|
||||
message PasswordRequest {
|
||||
string password = 1;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ func (b *earlyMsgBuffer) put(peerID messages.PeerID, msg Msg) bool {
|
||||
}
|
||||
|
||||
entry := earlyMsg{
|
||||
peerID: peerID,
|
||||
msg: msg,
|
||||
peerID: peerID,
|
||||
msg: msg,
|
||||
createdAt: time.Now(),
|
||||
}
|
||||
elem := b.order.PushBack(entry)
|
||||
|
||||
Reference in New Issue
Block a user