stoobly-agent 1.8.1__py3-none-any.whl → 1.8.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/service/builder.py +1 -0
- stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/.docker-compose.base.yml +3 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.configure +3 -0
- stoobly_agent/app/cli/scaffold_cli.py +1 -1
- stoobly_agent/app/proxy/mock/custom_not_found_response_builder.py +1 -1
- stoobly_agent/app/proxy/run.py +20 -5
- {stoobly_agent-1.8.1.dist-info → stoobly_agent-1.8.2.dist-info}/METADATA +1 -1
- {stoobly_agent-1.8.1.dist-info → stoobly_agent-1.8.2.dist-info}/RECORD +13 -13
- {stoobly_agent-1.8.1.dist-info → stoobly_agent-1.8.2.dist-info}/LICENSE +0 -0
- {stoobly_agent-1.8.1.dist-info → stoobly_agent-1.8.2.dist-info}/WHEEL +0 -0
- {stoobly_agent-1.8.1.dist-info → stoobly_agent-1.8.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.8.
|
2
|
+
VERSION = '1.8.2'
|
@@ -96,6 +96,7 @@ class ServiceBuilder(Builder):
|
|
96
96
|
labels = [
|
97
97
|
'traefik.enable=true',
|
98
98
|
f"traefik.http.routers.{service_id}.rule=Host(`{SERVICE_HOSTNAME}`)",
|
99
|
+
f"traefik.http.routers.{service_id}.entrypoints={SERVICE_PORT}",
|
99
100
|
f"traefik.http.services.{service_id}.loadbalancer.server.port={SERVICE_PORT}"
|
100
101
|
]
|
101
102
|
volumes = []
|
@@ -129,7 +129,7 @@ def mkcert(**kwargs):
|
|
129
129
|
@click.option('--env', multiple=True, help='Specify an environment variable.')
|
130
130
|
@click.option('--force', is_flag=True, help='Overwrite maintained scaffolded service files.')
|
131
131
|
@click.option('--hostname', help='Service hostname.')
|
132
|
-
@click.option('--port', help='Service port.')
|
132
|
+
@click.option('--port', type=click.IntRange(1, 65535), help='Service port.')
|
133
133
|
@click.option('--priority', default=5, type=click.FloatRange(1.0, 9.0), help='Determines the service run order. Lower values run first.')
|
134
134
|
@click.option('--proxy-mode', help='''
|
135
135
|
Proxy mode can be "regular", "transparent", "socks5",
|
@@ -11,7 +11,7 @@ class CustomNotFoundResponseBuilder():
|
|
11
11
|
|
12
12
|
def build(self):
|
13
13
|
self.__response.status_code = custom_response_codes.NOT_FOUND
|
14
|
-
self.__response.raw = BytesIO('Request not found'.encode())
|
14
|
+
self.__response.raw = BytesIO('Request not found. To troubleshoot see https://docs.stoobly.com/guides/how-to-mock-apis/troubleshooting'.encode())
|
15
15
|
self.__response.headers = {
|
16
16
|
'Access-Control-Allow-Origin': '*',
|
17
17
|
'Access-Control-Allow-Methods': 'GET, OPTIONS, POST, PATCH, PUT, DELETE',
|
stoobly_agent/app/proxy/run.py
CHANGED
@@ -5,6 +5,8 @@ import signal
|
|
5
5
|
|
6
6
|
from mitmproxy.net import tls
|
7
7
|
|
8
|
+
from stoobly_agent.app.cli.scaffold.constants import SERVICE_NAME_ENV
|
9
|
+
from stoobly_agent.app.cli.scaffold.templates.constants import CORE_MOCK_UI_SERVICE_NAME
|
8
10
|
from stoobly_agent.config.mitmproxy import MitmproxyConfig
|
9
11
|
|
10
12
|
# Monkey patch for OpenSSL unsafe legacy renegotiation disabled
|
@@ -85,16 +87,29 @@ def __with_cli_options(config: MitmproxyConfig, cli_options: dict):
|
|
85
87
|
config.set(tuple(options))
|
86
88
|
|
87
89
|
def __commit_options(options: dict):
|
90
|
+
changed = False
|
91
|
+
service_name = os.environ.get(SERVICE_NAME_ENV)
|
88
92
|
settings = Settings.instance()
|
89
93
|
|
90
|
-
|
94
|
+
if not service_name or options.get('intercept'):
|
95
|
+
# In the case when service name is set,
|
96
|
+
# only update if intercept is explicitly enabled
|
97
|
+
intercept = not not options.get('intercept')
|
98
|
+
changed = settings.proxy.intercept.active != intercept
|
99
|
+
settings.proxy.intercept.active = intercept
|
91
100
|
|
92
|
-
if
|
93
|
-
|
101
|
+
if not service_name or service_name == CORE_MOCK_UI_SERVICE_NAME:
|
102
|
+
# Causes potentially unintended side effects when run as part of scaffold
|
103
|
+
# Defer to ui service for configuration in this case
|
104
|
+
if options.get('proxy_host') and options.get('proxy_port'):
|
105
|
+
settings.proxy.url = f"http://{options.get('proxy_host')}:{options.get('proxy_port')}"
|
94
106
|
|
95
|
-
|
107
|
+
settings.ui.active = not options.get('headless')
|
96
108
|
|
97
|
-
|
109
|
+
changed = True
|
110
|
+
|
111
|
+
if changed:
|
112
|
+
settings.commit()
|
98
113
|
|
99
114
|
def __filter_options(options):
|
100
115
|
'''
|
@@ -1,4 +1,4 @@
|
|
1
|
-
stoobly_agent/__init__.py,sha256
|
1
|
+
stoobly_agent/__init__.py,sha256=1fzF9JcdIRZ3Enr3ujT95GhaO7HvFoqNmqr23SD2n6U,44
|
2
2
|
stoobly_agent/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
stoobly_agent/app/api/__init__.py,sha256=ctkB8KR-eXO0SFhj602huHiyvQ3PslFWd8fkcufgrAI,1000
|
4
4
|
stoobly_agent/app/api/application_http_request_handler.py,sha256=Vvz53yB0bR7J-QqMAkLlhcZrA4P64ZEN7w8cMbgl6o0,5261
|
@@ -81,7 +81,7 @@ stoobly_agent/app/cli/scaffold/docker/builder.py,sha256=uiGqhxBHEasZAqLzjKUGUs-1
|
|
81
81
|
stoobly_agent/app/cli/scaffold/docker/constants.py,sha256=1khQdgTaQ89ykGRNdTQh_ejFOdjNFGaZ_3cOGda6y7Y,692
|
82
82
|
stoobly_agent/app/cli/scaffold/docker/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
83
83
|
stoobly_agent/app/cli/scaffold/docker/service/build_decorator.py,sha256=ZU7z4bkvdS3OK5O4fJhlA9_PNwnFtZW6t7vNF7V5obQ,1003
|
84
|
-
stoobly_agent/app/cli/scaffold/docker/service/builder.py,sha256=
|
84
|
+
stoobly_agent/app/cli/scaffold/docker/service/builder.py,sha256=4cIMSYvgrkGWVuuYymiwlrR829O91qQl9ML8FhaDMj4,5857
|
85
85
|
stoobly_agent/app/cli/scaffold/docker/service/configure_gateway.py,sha256=kKJDxbjV9cy5JIvnKKdVppdmlagvtTZ3z1j9-sS3Qic,3728
|
86
86
|
stoobly_agent/app/cli/scaffold/docker/service/types.py,sha256=qB-yYHlu-PZDc0HYgTUvE5bWNpHxaSThC3JUG8okR1k,88
|
87
87
|
stoobly_agent/app/cli/scaffold/docker/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -142,15 +142,15 @@ stoobly_agent/app/cli/scaffold/templates/app/gateway/mock/.docker-compose.mock.y
|
|
142
142
|
stoobly_agent/app/cli/scaffold/templates/app/gateway/record/.docker-compose.record.yml,sha256=eyLH2h33Peunus8M1sUKL9AALCG2ABhV_heiJKhvgwo,138
|
143
143
|
stoobly_agent/app/cli/scaffold/templates/app/gateway/test/.docker-compose.test.yml,sha256=oJO6i0lsuQaQeIH80yoPZo3Vs0LzUAH2WRl853yLq6g,136
|
144
144
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/.config.yml,sha256=XnLQZMzzMMIwVycjyPN5QXsmRztkTFAna1kIHYuDfJQ,19
|
145
|
-
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/.docker-compose.base.yml,sha256=
|
145
|
+
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/.docker-compose.base.yml,sha256=bEmlH0ga_p3vsYZFagMGxvw47KscURmbYrfegMZb1CI,202
|
146
146
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/.docker-compose.exec.yml,sha256=JN89sU5uRf6YqHvN_O63K8rwQIAPJHbhFDLFmuUjKNM,304
|
147
147
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/mock/.docker-compose.mock.yml,sha256=FnCn64DjxyAiB2P_1JUwFmXslMR961nVZHkYiEXytlg,232
|
148
148
|
stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/record/.docker-compose.record.yml,sha256=t34FNYZboJSfrKnIB2oJ3UuE_mJaW77-hcbSn3sfWec,235
|
149
|
-
stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.configure,sha256=
|
149
|
+
stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.configure,sha256=SKvht2K_3tW08K24rl8_j0jMYOhq1k-GsVwhoHwjxYA,337
|
150
150
|
stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.init,sha256=ecmyS6EZpa3op0CmO7bvd3pmAwRb0oLwj1qsTkee9_o,247
|
151
151
|
stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.configure,sha256=eXp9eKJ-TORE5B0zLW4-t43ogS3nxtj2SmSeDALbi1U,278
|
152
152
|
stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.init,sha256=ecmyS6EZpa3op0CmO7bvd3pmAwRb0oLwj1qsTkee9_o,247
|
153
|
-
stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.configure,sha256=
|
153
|
+
stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.configure,sha256=SKvht2K_3tW08K24rl8_j0jMYOhq1k-GsVwhoHwjxYA,337
|
154
154
|
stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.init,sha256=ecmyS6EZpa3op0CmO7bvd3pmAwRb0oLwj1qsTkee9_o,247
|
155
155
|
stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.configure,sha256=xWJGhCKQejtVLFAOEZMWnaCeGAc9tuqEh_WsG3xfA_0,184
|
156
156
|
stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.init,sha256=AcM6SLUsZa6BOLDjxteDR_AXIco47GZNkWQCGPhPDAY,189
|
@@ -202,7 +202,7 @@ stoobly_agent/app/cli/scaffold/workflow_env.py,sha256=x8V5pJmIiklD3f2q2-qq-CORf4
|
|
202
202
|
stoobly_agent/app/cli/scaffold/workflow_log_command.py,sha256=Bke4lMOMxuDUFuAx9nlXHbKgYMO4KAg9ASHvjz4aVWc,1372
|
203
203
|
stoobly_agent/app/cli/scaffold/workflow_run_command.py,sha256=eF3aaK4OIZXYuSBEAeBnhAL7EZrS1G4mSYrJbEiXt2o,11082
|
204
204
|
stoobly_agent/app/cli/scaffold/workflow_validate_command.py,sha256=Uo_yo6rVR1ZR7xpvsQvlH48AyMBVLRupd4G-bRjzm_Q,5584
|
205
|
-
stoobly_agent/app/cli/scaffold_cli.py,sha256=
|
205
|
+
stoobly_agent/app/cli/scaffold_cli.py,sha256=3tkE_AWUfcpOBqn9xepptqO3KwAJJ7ZraG5oAvgplUo,29559
|
206
206
|
stoobly_agent/app/cli/scenario_cli.py,sha256=3J1EiJOvunkfWrEkOsanw-XrKkOk78ij_GjBlE9p7CE,8229
|
207
207
|
stoobly_agent/app/cli/snapshot_cli.py,sha256=cpCjxFYBuVwLuq_b2lIUu-5zWqupRlrp4xWgDytirSM,10047
|
208
208
|
stoobly_agent/app/cli/trace_cli.py,sha256=K7E-vx3JUcqEDSWOdIOi_AieKNQz7dBfmRrVvKDkzFI,4605
|
@@ -324,7 +324,7 @@ stoobly_agent/app/proxy/mitmproxy/response_body_facade.py,sha256=vIu6cuCSiZDocvn
|
|
324
324
|
stoobly_agent/app/proxy/mitmproxy/response_facade.py,sha256=0wCSzUULUhDDV93QXUgzMNxiiSZwcu-kUB2C5z1Ck0Y,4311
|
325
325
|
stoobly_agent/app/proxy/mock/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
326
326
|
stoobly_agent/app/proxy/mock/context.py,sha256=vDo5_3WBL73mVFnsmQWvcxvPg5nWtRJbigSrE3zGc-o,794
|
327
|
-
stoobly_agent/app/proxy/mock/custom_not_found_response_builder.py,sha256=
|
327
|
+
stoobly_agent/app/proxy/mock/custom_not_found_response_builder.py,sha256=0KWB3KFxVrnJOKDaYxm5eoJEccw7IpJZRyUvBX61-8k,697
|
328
328
|
stoobly_agent/app/proxy/mock/eval_fixtures_service.py,sha256=hc4VLnN50HBaWvFnrhQUJqdH-r3jBu9DHrpt8gbvkHY,3847
|
329
329
|
stoobly_agent/app/proxy/mock/eval_request_service.py,sha256=A1tcE3wmrC1HwLpz0aRuRw-Nucn0dyHD_yHw5BeQEJU,8146
|
330
330
|
stoobly_agent/app/proxy/mock/hashed_request_decorator.py,sha256=h1ma90fdaYI9LBWpMWMqWBz-RjNwI628O4VuS_uUBX4,5061
|
@@ -353,7 +353,7 @@ stoobly_agent/app/proxy/replay/replay_request_service.py,sha256=UuTPPef6jchrJSjV
|
|
353
353
|
stoobly_agent/app/proxy/replay/replay_scenario_service.py,sha256=9jV-iO5EBg8geUblEtjjWRFIkom_Pqmo7P-lTc3S4Xw,2824
|
354
354
|
stoobly_agent/app/proxy/replay/rewrite_params_service.py,sha256=jEHlT6_OHq_VBa09Hd6QaRyErv7tZnziDvW7m3Q8CQg,2234
|
355
355
|
stoobly_agent/app/proxy/replay/trace_context.py,sha256=lKpnQWVCUTcMPE-SOi90za3U1yL0VeBlIgj_KP63VsE,10435
|
356
|
-
stoobly_agent/app/proxy/run.py,sha256=
|
356
|
+
stoobly_agent/app/proxy/run.py,sha256=RKq5vha8jQNlQaLGrijSg79AIDAmVoIGvCr9qZ0FDOo,4900
|
357
357
|
stoobly_agent/app/proxy/settings.py,sha256=R0LkSa9HrkUXvCd-nur4syJePjbQZdlnAnOPpGnCx38,2172
|
358
358
|
stoobly_agent/app/proxy/simulate_intercept_service.py,sha256=R-L2dh2dfYFebttWXU0NwyxFI_jP6Ud36oKPC-T8HiI,1942
|
359
359
|
stoobly_agent/app/proxy/test/__init__.py,sha256=uW0Ab27oyH2odTeVRjcuUJF8A1FLbTT5sBMzhGZr1so,89
|
@@ -743,8 +743,8 @@ stoobly_agent/test/mock_data/scaffold/docker-compose-local-service.yml,sha256=1W
|
|
743
743
|
stoobly_agent/test/mock_data/scaffold/index.html,sha256=qJwuYajKZ4ihWZrJQ3BNObV5kf1VGnnm_vqlPJzdqLE,258
|
744
744
|
stoobly_agent/test/mock_data/uspto.yaml,sha256=6U5se7C3o-86J4m9xpOk9Npias399f5CbfWzR87WKwE,7835
|
745
745
|
stoobly_agent/test/test_helper.py,sha256=m_oAI7tmRYCNZdKfNqISWhMv3e44tjeYViQ3nTUfnos,1007
|
746
|
-
stoobly_agent-1.8.
|
747
|
-
stoobly_agent-1.8.
|
748
|
-
stoobly_agent-1.8.
|
749
|
-
stoobly_agent-1.8.
|
750
|
-
stoobly_agent-1.8.
|
746
|
+
stoobly_agent-1.8.2.dist-info/LICENSE,sha256=o93sj12cdoEOsTCjPaPFsw3Xq0SXs3pPcY-9reE2sEw,548
|
747
|
+
stoobly_agent-1.8.2.dist-info/METADATA,sha256=abQlRTSshUX1fwRHE4sqWOZ4bOSEUoiNLacEbzmE-ts,3087
|
748
|
+
stoobly_agent-1.8.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
749
|
+
stoobly_agent-1.8.2.dist-info/entry_points.txt,sha256=aq5wix5oC8MDQtmyPGU0xaFrsjJg7WH28NmXh2sc3Z8,56
|
750
|
+
stoobly_agent-1.8.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|