Skip to content

Commit e700149

Browse files
committed
Merge branch 'release-v5.2.9'
2 parents 08706ef + 3032708 commit e700149

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
types: [published]
1717

1818
jobs:
19-
upload_pypi:
19+
build_pypi_and_docker:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v2

netfoundry/network.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -988,10 +988,9 @@ def create_service_simple(self, name: str, client_host_name: str, client_port: i
988988
:param: name is required string
989989
:param: client_host_name is required strings that is the intercept hostname (DNS) or IPv4
990990
:param: client_port is required integer of the ports to intercept
991-
:param: client_protocol is required string of the transport protocol. Choices: {valid_service_protocols}
992991
:param: server_host_name is optional string that is a hostname (DNS) or IPv4. If omitted service is assumed to be SDK-hosted (not Tunneler or Router-hosted).
993992
:param: server_port is optional integer of the server port. If omitted the client port is used unless SDK-hosted.
994-
:param: server_protocol is optional string of the server protocol. If omitted the same client protocol is used.
993+
:param: server_protocol is optional string of the server protocol.
995994
:param: attributes is optional list of strings of service roles to assign. Default is [].
996995
:param: edge_router_attributes is optional list of strings of Router roles or Router names that can "see" this service. Default is ["#all"].
997996
:param: egress_router_id is optional string of UUID or name of hosting Router. Selects Router-hosting strategy.
@@ -1468,7 +1467,7 @@ def create_service_transparent(self, name: str, client_hosts: list, client_ports
14681467
intercept_config_data = {
14691468
"addresses": client_hosts,
14701469
"portRanges": valid_ports,
1471-
"protocols": client_protocols,
1470+
"protocols": valid_client_protocols,
14721471
"sourceIp": "$src_ip:$src_port"
14731472
}
14741473

@@ -1478,7 +1477,7 @@ def create_service_transparent(self, name: str, client_hosts: list, client_ports
14781477
"forwardPort": True,
14791478
"allowedAddresses": client_hosts,
14801479
"allowedPortRanges": valid_ports,
1481-
"allowedProtocols": client_protocols,
1480+
"allowedProtocols": valid_client_protocols,
14821481
"allowedSourceAddresses": transparent_hosts
14831482
}
14841483

@@ -1633,14 +1632,14 @@ def create_service_advanced(self, name: str, endpoints: list, client_hosts: list
16331632
server_egress["forwardPort"] = True
16341633
server_egress["allowedPortRanges"] = valid_client_ports
16351634

1636-
if server_protocols and len(server_protocols) == 1:
1637-
server_egress["protocol"] = server_protocols[0]
1638-
elif server_protocols and len(server_protocols) > 1:
1635+
if valid_server_protocols and len(valid_server_protocols) == 1:
1636+
server_egress["protocol"] = valid_server_protocols[0]
1637+
elif valid_server_protocols and len(valid_server_protocols) > 1:
16391638
server_egress["forwardProtocol"] = True
1640-
server_egress["allowedProtocols"] = server_protocols
1639+
server_egress["allowedProtocols"] = valid_server_protocols
16411640
else:
16421641
server_egress["forwardProtocol"] = True
1643-
server_egress["allowedProtocols"] = client_protocols
1642+
server_egress["allowedProtocols"] = valid_client_protocols
16441643

16451644

16461645
# parse out the elements in the list of endpoints as one of #attribute, UUID, or resolvable Endoint name

0 commit comments

Comments
 (0)