stoobly-agent 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stoobly_agent/__init__.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/mock_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/reverse_proxy_decorator.py +16 -2
- stoobly_agent/app/cli/scaffold/service_config.py +12 -6
- {stoobly_agent-1.0.1.dist-info → stoobly_agent-1.0.2.dist-info}/METADATA +1 -1
- {stoobly_agent-1.0.1.dist-info → stoobly_agent-1.0.2.dist-info}/RECORD +9 -9
- {stoobly_agent-1.0.1.dist-info → stoobly_agent-1.0.2.dist-info}/LICENSE +0 -0
- {stoobly_agent-1.0.1.dist-info → stoobly_agent-1.0.2.dist-info}/WHEEL +0 -0
- {stoobly_agent-1.0.1.dist-info → stoobly_agent-1.0.2.dist-info}/entry_points.txt +0 -0
stoobly_agent/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
COMMAND = 'stoobly-agent'
|
2
|
-
VERSION = '1.0.
|
2
|
+
VERSION = '1.0.2'
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import pdb
|
2
2
|
|
3
|
+
from urllib.parse import urlparse
|
4
|
+
|
3
5
|
from ...constants import SERVICE_DNS, SERVICE_HOSTNAME, SERVICE_PORT
|
4
6
|
from .builder import WorkflowBuilder
|
5
7
|
|
@@ -32,12 +34,24 @@ class ReverseProxyDecorator():
|
|
32
34
|
proxy_name = self.workflow_builder.proxy
|
33
35
|
proxy_service = services.get(proxy_name) or {}
|
34
36
|
|
35
|
-
|
37
|
+
additional_properties = { 'command': command }
|
38
|
+
|
39
|
+
# Proxying forwards requests to the actual service
|
40
|
+
# If the destination hostname is the same as the service's hostname, then
|
36
41
|
# If we set the 'hostname' property, this will cause an "infinite loop"
|
42
|
+
proxy_mode_toks = config.proxy_mode.split(':', 1)
|
43
|
+
|
44
|
+
if len(proxy_mode_toks) > 1:
|
45
|
+
directed = proxy_mode_toks[0] == 'reverse' or proxy_mode_toks[0] == 'upstream'
|
46
|
+
if directed:
|
47
|
+
spec = proxy_mode_toks[1]
|
48
|
+
uri = urlparse(spec)
|
49
|
+
if uri.hostname != self.service_builder.config.hostname:
|
50
|
+
additional_properties['hostname'] = f"{SERVICE_HOSTNAME}"
|
37
51
|
|
38
52
|
service = {
|
39
53
|
**proxy_service,
|
40
|
-
**
|
54
|
+
**additional_properties,
|
41
55
|
}
|
42
56
|
|
43
57
|
# If we are reverse proxying to potentially an external host,
|
@@ -52,8 +52,8 @@ class ServiceConfig(Config):
|
|
52
52
|
self.__scheme = kwargs.get('scheme')
|
53
53
|
|
54
54
|
@property
|
55
|
-
def detached(self):
|
56
|
-
return self.__detached
|
55
|
+
def detached(self) -> bool:
|
56
|
+
return not not self.__detached
|
57
57
|
|
58
58
|
@detached.setter
|
59
59
|
def detached(self, v):
|
@@ -69,7 +69,7 @@ class ServiceConfig(Config):
|
|
69
69
|
|
70
70
|
@property
|
71
71
|
def hostname(self):
|
72
|
-
return self.__hostname
|
72
|
+
return (self.__hostname or '').strip()
|
73
73
|
|
74
74
|
@hostname.setter
|
75
75
|
def hostname(self, v):
|
@@ -99,6 +99,12 @@ class ServiceConfig(Config):
|
|
99
99
|
|
100
100
|
@property
|
101
101
|
def port(self):
|
102
|
+
if not self.__port:
|
103
|
+
if self.scheme == 'https':
|
104
|
+
return '443'
|
105
|
+
elif self.scheme == 'http':
|
106
|
+
return '80'
|
107
|
+
|
102
108
|
return self.__port
|
103
109
|
|
104
110
|
@port.setter
|
@@ -120,9 +126,9 @@ class ServiceConfig(Config):
|
|
120
126
|
self.__priority = v
|
121
127
|
|
122
128
|
@property
|
123
|
-
def proxy_mode(self):
|
129
|
+
def proxy_mode(self) -> str:
|
124
130
|
if self.__proxy_mode:
|
125
|
-
return self.__proxy_mode
|
131
|
+
return (self.__proxy_mode or '').strip()
|
126
132
|
|
127
133
|
return f"reverse:{self.scheme}://{self.hostname}"
|
128
134
|
|
@@ -132,7 +138,7 @@ class ServiceConfig(Config):
|
|
132
138
|
|
133
139
|
@property
|
134
140
|
def scheme(self):
|
135
|
-
return self.__scheme or 'https'
|
141
|
+
return (self.__scheme or 'https').strip()
|
136
142
|
|
137
143
|
@scheme.setter
|
138
144
|
def scheme(self, v):
|
@@ -1,4 +1,4 @@
|
|
1
|
-
stoobly_agent/__init__.py,sha256=
|
1
|
+
stoobly_agent/__init__.py,sha256=AewfG39HNAz5wMih3ASPkjYwMTZ40BC3bWka806550w,44
|
2
2
|
stoobly_agent/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
stoobly_agent/app/api/__init__.py,sha256=FFSlVoTgjPfUNlYPr_7u6-P5Y4WOKyaUfAHtUcB-Xio,810
|
4
4
|
stoobly_agent/app/api/application_http_request_handler.py,sha256=jf4fkqjOiCeI2IM5Ro7ie0v_C6y0-7-5TIE_IKMPOfg,5513
|
@@ -87,12 +87,12 @@ stoobly_agent/app/cli/scaffold/docker/workflow/__init__.py,sha256=47DEQpj8HBSa-_
|
|
87
87
|
stoobly_agent/app/cli/scaffold/docker/workflow/build_decorator.py,sha256=vbmME0cbN2EnNRlzQ2umj7Y3L7aZT-EHqEpkBFMfe8U,758
|
88
88
|
stoobly_agent/app/cli/scaffold/docker/workflow/builder.py,sha256=51uGZt9CydBzRwR9aB6uDXuJ2QNm6Iql3AMWv6AtCtw,6919
|
89
89
|
stoobly_agent/app/cli/scaffold/docker/workflow/decorators_factory.py,sha256=Mi6SEFpG2MG9pymPLbPTWBMfosi1ThRAs5DXfjBz4Iw,643
|
90
|
-
stoobly_agent/app/cli/scaffold/docker/workflow/mock_decorator.py,sha256
|
91
|
-
stoobly_agent/app/cli/scaffold/docker/workflow/reverse_proxy_decorator.py,sha256=
|
90
|
+
stoobly_agent/app/cli/scaffold/docker/workflow/mock_decorator.py,sha256=pOvyrauHRB1cOB0OKBA3MQnM-Iwfbuwwop2TDSWs_jo,1067
|
91
|
+
stoobly_agent/app/cli/scaffold/docker/workflow/reverse_proxy_decorator.py,sha256=RiNOXaCj_TM-NkFVtu-jnZEIeG8HBKPrVqBbnfRNzio,2031
|
92
92
|
stoobly_agent/app/cli/scaffold/env.py,sha256=e-Ve4p3RUgzFx22B3SIYttvJ_yLuDtA27oDACZ8n-6E,1140
|
93
93
|
stoobly_agent/app/cli/scaffold/service.py,sha256=HzYTiQGfReYXEY0Iv4YjGpu5fjCicV61Wst4khmmURs,504
|
94
94
|
stoobly_agent/app/cli/scaffold/service_command.py,sha256=VtXrgiNO6kD4Oi_alHrJWQhkho3oI-yqs1fe8BPDW6M,1055
|
95
|
-
stoobly_agent/app/cli/scaffold/service_config.py,sha256=
|
95
|
+
stoobly_agent/app/cli/scaffold/service_config.py,sha256=nXopRnHHw6o4Qh1ekYIJCT8hLIMY0QBN4PAXTCL4qFI,5615
|
96
96
|
stoobly_agent/app/cli/scaffold/service_create_command.py,sha256=bmLGgx9qnh-X_i2_XfdWSQIer0gGkaQx6lXZSIzy-LI,2793
|
97
97
|
stoobly_agent/app/cli/scaffold/service_workflow.py,sha256=sQ_Edy_wGHKMXpD0DmhnOWkGEKz7gSgEGNI8f7aXOdg,444
|
98
98
|
stoobly_agent/app/cli/scaffold/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -707,8 +707,8 @@ stoobly_agent/test/mock_data/petstore.yaml,sha256=CCdliJky04Az4FIOkFA883uunwFDHL
|
|
707
707
|
stoobly_agent/test/mock_data/request_show_response.py,sha256=K_a0fP0QT58T8sX9PaM6hqtX1A1depZsqg_GsNPf--k,707
|
708
708
|
stoobly_agent/test/mock_data/uspto.yaml,sha256=6U5se7C3o-86J4m9xpOk9Npias399f5CbfWzR87WKwE,7835
|
709
709
|
stoobly_agent/test/test_helper.py,sha256=m_oAI7tmRYCNZdKfNqISWhMv3e44tjeYViQ3nTUfnos,1007
|
710
|
-
stoobly_agent-1.0.
|
711
|
-
stoobly_agent-1.0.
|
712
|
-
stoobly_agent-1.0.
|
713
|
-
stoobly_agent-1.0.
|
714
|
-
stoobly_agent-1.0.
|
710
|
+
stoobly_agent-1.0.2.dist-info/LICENSE,sha256=8QKGyy45eN76Zk52h8gu1DKX2B_gbWgZ3nzDLofEbaE,548
|
711
|
+
stoobly_agent-1.0.2.dist-info/METADATA,sha256=4aAEZsGJjZfyGGtfTyuiWVxgKjiB-SdON5oA5Y2RmjU,3388
|
712
|
+
stoobly_agent-1.0.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
713
|
+
stoobly_agent-1.0.2.dist-info/entry_points.txt,sha256=aq5wix5oC8MDQtmyPGU0xaFrsjJg7WH28NmXh2sc3Z8,56
|
714
|
+
stoobly_agent-1.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|