stoobly-agent 1.10.0__py3-none-any.whl → 1.10.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/__main__.py +10 -0
- stoobly_agent/app/api/application_http_request_handler.py +5 -2
- stoobly_agent/app/cli/ca_cert_cli.py +9 -5
- stoobly_agent/app/cli/helpers/replay_facade.py +2 -2
- stoobly_agent/app/cli/intercept_cli.py +5 -5
- stoobly_agent/app/cli/request_cli.py +2 -2
- stoobly_agent/app/cli/scaffold/app.py +14 -5
- stoobly_agent/app/cli/scaffold/app_command.py +0 -4
- stoobly_agent/app/cli/scaffold/app_config.py +49 -2
- stoobly_agent/app/cli/scaffold/app_create_command.py +145 -76
- stoobly_agent/app/cli/scaffold/constants.py +9 -4
- stoobly_agent/app/cli/scaffold/docker/constants.py +3 -1
- stoobly_agent/app/cli/scaffold/docker/service/build_decorator.py +4 -4
- stoobly_agent/app/cli/scaffold/docker/service/builder.py +31 -54
- stoobly_agent/app/cli/scaffold/docker/service/configure_gateway.py +3 -0
- stoobly_agent/app/cli/scaffold/docker/template_files.py +112 -0
- stoobly_agent/app/cli/scaffold/docker/workflow/build_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/builder.py +30 -47
- stoobly_agent/app/cli/scaffold/docker/workflow/command_decorator.py +3 -2
- stoobly_agent/app/cli/scaffold/docker/workflow/detached_decorator.py +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/dns_decorator.py +2 -3
- stoobly_agent/app/cli/scaffold/docker/workflow/local_decorator.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 +1 -1
- stoobly_agent/app/cli/scaffold/docker/workflow/run_command.py +423 -0
- stoobly_agent/app/cli/scaffold/local/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/local/service/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/local/service/builder.py +72 -0
- stoobly_agent/app/cli/scaffold/local/workflow/__init__.py +0 -0
- stoobly_agent/app/cli/scaffold/local/workflow/builder.py +35 -0
- stoobly_agent/app/cli/scaffold/local/workflow/run_command.py +339 -0
- stoobly_agent/app/cli/scaffold/service_command.py +9 -1
- stoobly_agent/app/cli/scaffold/service_config.py +9 -25
- stoobly_agent/app/cli/scaffold/service_create_command.py +18 -6
- stoobly_agent/app/cli/scaffold/service_docker_compose.py +3 -3
- stoobly_agent/app/cli/scaffold/service_workflow_validate_command.py +10 -7
- stoobly_agent/app/cli/scaffold/templates/app/.Makefile +2 -2
- stoobly_agent/app/cli/scaffold/templates/app/build/.docker-compose.base.yml +4 -4
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/record/configure +28 -0
- stoobly_agent/app/cli/scaffold/templates/app/build/test/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/.docker-compose.base.yml +4 -4
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/configure +3 -0
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/mock/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/record/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/build/test/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/mock/.run +19 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/record/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/record/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/record/.run +19 -0
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/test/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/test/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/services/entrypoint/test/.run +19 -0
- stoobly_agent/app/cli/scaffold/templates/build/workflows/exec/scaffold/.up +0 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/mock/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/mock/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/mock/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/workflows/record/.configure +25 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/record/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/record/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/build/workflows/test/.configure +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/test/.init +5 -1
- stoobly_agent/app/cli/scaffold/templates/build/workflows/test/.run +14 -0
- stoobly_agent/app/cli/scaffold/templates/constants.py +35 -19
- stoobly_agent/app/cli/scaffold/templates/factory.py +34 -18
- stoobly_agent/app/cli/scaffold/templates/plugins/cypress/test/.run +21 -0
- stoobly_agent/app/cli/scaffold/templates/plugins/playwright/test/.run +21 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/configure +21 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/record/run +3 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/configure +5 -0
- stoobly_agent/app/cli/scaffold/templates/workflow/test/run +3 -0
- stoobly_agent/app/cli/scaffold/workflow_command.py +18 -4
- stoobly_agent/app/cli/scaffold/workflow_copy_command.py +5 -4
- stoobly_agent/app/cli/scaffold/workflow_create_command.py +31 -29
- stoobly_agent/app/cli/scaffold/workflow_run_command.py +18 -151
- stoobly_agent/app/cli/scaffold_cli.py +134 -182
- stoobly_agent/app/cli/scenario_cli.py +2 -2
- stoobly_agent/app/cli/types/test.py +2 -2
- stoobly_agent/app/cli/types/workflow_run_command.py +52 -3
- stoobly_agent/app/proxy/handle_mock_service.py +1 -1
- stoobly_agent/app/proxy/intercept_settings.py +6 -26
- stoobly_agent/app/proxy/mock/eval_fixtures_service.py +177 -27
- stoobly_agent/app/proxy/mock/types/__init__.py +22 -1
- stoobly_agent/app/proxy/record/upload_request_service.py +3 -6
- stoobly_agent/app/proxy/replay/body_parser_service.py +8 -5
- stoobly_agent/app/proxy/replay/multipart.py +15 -13
- stoobly_agent/app/proxy/replay/replay_request_service.py +2 -2
- stoobly_agent/app/proxy/run.py +3 -0
- stoobly_agent/app/proxy/test/context.py +0 -4
- stoobly_agent/app/proxy/test/context_abc.py +0 -5
- stoobly_agent/app/proxy/utils/publish_change_service.py +20 -23
- stoobly_agent/app/settings/__init__.py +10 -7
- stoobly_agent/cli.py +61 -16
- stoobly_agent/config/data_dir.py +1 -8
- stoobly_agent/public/12-es2015.618ecfd5f735b801b50f.js +1 -0
- stoobly_agent/public/12-es5.618ecfd5f735b801b50f.js +1 -0
- stoobly_agent/public/index.html +1 -1
- stoobly_agent/public/main-es2015.5a9aa16433404c3f423a.js +1 -0
- stoobly_agent/public/main-es5.5a9aa16433404c3f423a.js +1 -0
- stoobly_agent/public/runtime-es2015.77bcd31efed9e5d5d431.js +1 -0
- stoobly_agent/public/runtime-es5.77bcd31efed9e5d5d431.js +1 -0
- stoobly_agent/test/app/cli/intercept/intercept_configure_test.py +17 -6
- stoobly_agent/test/app/cli/scaffold/docker/cli_invoker.py +177 -0
- stoobly_agent/test/app/cli/scaffold/{cli_test.py → docker/cli_test.py} +4 -11
- stoobly_agent/test/app/cli/scaffold/{e2e_test.py → docker/e2e_test.py} +42 -27
- stoobly_agent/test/app/cli/scaffold/local/__init__.py +0 -0
- stoobly_agent/test/app/cli/scaffold/{cli_invoker.py → local/cli_invoker.py} +38 -32
- stoobly_agent/test/app/cli/scaffold/local/e2e_test.py +342 -0
- stoobly_agent/test/app/models/schemas/.stoobly/db/VERSION +1 -1
- stoobly_agent/test/app/proxy/mock/eval_fixtures_service_test.py +903 -2
- stoobly_agent/test/app/proxy/replay/body_parser_service_test.py +95 -3
- stoobly_agent/test/config/data_dir_test.py +2 -7
- stoobly_agent/test/test_helper.py +16 -5
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/METADATA +4 -2
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/RECORD +157 -129
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/WHEEL +1 -1
- stoobly_agent/app/cli/helpers/shell.py +0 -26
- stoobly_agent/app/cli/scaffold/templates/app/build/mock/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/build/record/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/build/test/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/bin/configure +0 -3
- stoobly_agent/app/cli/scaffold/templates/workflow/mock/bin/configure +0 -13
- stoobly_agent/app/cli/scaffold/templates/workflow/record/bin/configure +0 -47
- stoobly_agent/app/cli/scaffold/templates/workflow/test/bin/configure +0 -13
- stoobly_agent/public/12-es2015.be58ed0ef449008b932e.js +0 -1
- stoobly_agent/public/12-es5.be58ed0ef449008b932e.js +0 -1
- stoobly_agent/public/main-es2015.089b46f303768fbe864f.js +0 -1
- stoobly_agent/public/main-es5.089b46f303768fbe864f.js +0 -1
- stoobly_agent/public/runtime-es2015.f8c814b38b27708e91c1.js +0 -1
- stoobly_agent/public/runtime-es5.f8c814b38b27708e91c1.js +0 -1
- /stoobly_agent/app/cli/scaffold/templates/app/build/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/mock/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/record/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/build/test/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/mock/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/record/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/entrypoint/test/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/gateway/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/gateway/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/gateway/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/exec/{.docker-compose.exec.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/mock/{.docker-compose.mock.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/app/stoobly-ui/record/{.docker-compose.record.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/plugins/cypress/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/plugins/playwright/test/{.docker-compose.test.yml → .docker-compose.yml} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/workflow/mock/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/workflow/record/{bin/init → init} +0 -0
- /stoobly_agent/app/cli/scaffold/templates/workflow/test/{bin/init → init} +0 -0
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info}/entry_points.txt +0 -0
- {stoobly_agent-1.10.0.dist-info → stoobly_agent-1.10.2.dist-info/licenses}/LICENSE +0 -0
stoobly_agent/cli.py
CHANGED
@@ -9,8 +9,10 @@ from stoobly_agent import VERSION
|
|
9
9
|
from stoobly_agent.app.cli.helpers.context import ReplayContext
|
10
10
|
from stoobly_agent.app.cli.helpers.handle_mock_service import print_raw_response, RAW_FORMAT
|
11
11
|
from stoobly_agent.app.cli.helpers.validations import validate_project_key, validate_scenario_key
|
12
|
+
from stoobly_agent.app.cli.intercept_cli import mode_options
|
12
13
|
from stoobly_agent.app.proxy.constants import custom_response_codes
|
13
14
|
from stoobly_agent.app.proxy.replay.replay_request_service import replay as replay_request
|
15
|
+
from stoobly_agent.app.settings.constants import intercept_mode
|
14
16
|
from stoobly_agent.config.constants import env_vars, mode
|
15
17
|
from stoobly_agent.config.data_dir import DataDir
|
16
18
|
from stoobly_agent.lib.logger import Logger
|
@@ -80,7 +82,7 @@ def init(**kwargs):
|
|
80
82
|
help="Run proxy and/or UI",
|
81
83
|
)
|
82
84
|
@ConditionalDecorator(lambda f: click.option('--api-url', help='API URL.')(f), is_remote)
|
83
|
-
@click.option('--ca-certs-dir-path', default=
|
85
|
+
@click.option('--ca-certs-dir-path', default=os.path.join(os.path.expanduser('~'), '.mitmproxy'), help='Path to ca certs directory used to sign SSL certs.')
|
84
86
|
@click.option('--certs', help='''
|
85
87
|
SSL certificates of the form "[domain=]path". The domain may include a wildcard, and is equal to "*" if not specified. The file at path is a certificate in PEM format. If a private key is included in the
|
86
88
|
PEM, it is used, else the default key in the conf dir is used. The PEM file should contain the full certificate chain, with the leaf certificate as the first entry. May be passed multiple times.
|
@@ -90,6 +92,7 @@ def init(**kwargs):
|
|
90
92
|
config.yaml to avoid this.
|
91
93
|
''')
|
92
94
|
@click.option('--connection-strategy', help=', '.join(CONNECTION_STRATEGIES), type=click.Choice(CONNECTION_STRATEGIES))
|
95
|
+
@click.option('--detached', type=click.Path(), help='Run in detached mode and redirect output to the specified file path.')
|
93
96
|
@click.option('--flow-detail', default='1', type=click.Choice(['0', '1', '2', '3', '4']), help='''
|
94
97
|
The display detail level for flows in mitmdump: 0 (quiet) to 4 (very verbose).
|
95
98
|
0: no output
|
@@ -100,7 +103,7 @@ def init(**kwargs):
|
|
100
103
|
''')
|
101
104
|
@click.option('--headless', is_flag=True, default=False, help='Disable starting UI.')
|
102
105
|
@click.option('--intercept', is_flag=True, default=False, help='Enable intercept on run.')
|
103
|
-
@click.option('--intercept-mode', help='Set intercept mode.')
|
106
|
+
@click.option('--intercept-mode', type=click.Choice(mode_options), help='Set intercept mode.')
|
104
107
|
@click.option('--log-level', default=logger.INFO, type=click.Choice([logger.DEBUG, logger.INFO, logger.WARNING, logger.ERROR]), help='''
|
105
108
|
Log levels can be "debug", "info", "warning", or "error"
|
106
109
|
''')
|
@@ -118,8 +121,8 @@ def init(**kwargs):
|
|
118
121
|
the form of "http[s]://host[:port]".
|
119
122
|
''')
|
120
123
|
@click.option('--proxy-port', default=8080, type=click.IntRange(1, 65535), help='Proxy service port.')
|
121
|
-
@click.option('--public-directory-path', help='Path to public files. Used for mocking requests.')
|
122
|
-
@click.option('--response-fixtures-path', help='Path to response fixtures yaml. Used for mocking requests.')
|
124
|
+
@click.option('--public-directory-path', multiple=True, help='Path to public files. Used for mocking requests. Can take the form <FOLDER-PATH>[:<ORIGIN>].')
|
125
|
+
@click.option('--response-fixtures-path', multiple=True, help='Path to response fixtures yaml. Used for mocking requests. Can take the form <FILE-PATH>[:<ORIGIN>].')
|
123
126
|
@click.option('--ssl-insecure', is_flag=True, default=False, help='Do not verify upstream server SSL/TLS certificates.')
|
124
127
|
@click.option('--ui-host', default='0.0.0.0', help='Address to bind UI to.')
|
125
128
|
@click.option('--ui-port', default=4200, type=click.IntRange(1, 65535), help='UI service port.')
|
@@ -130,6 +133,9 @@ def run(**kwargs):
|
|
130
133
|
settings: Settings = Settings.instance()
|
131
134
|
settings.watch()
|
132
135
|
|
136
|
+
if not os.path.exists(kwargs.get('ca_certs_dir_path')):
|
137
|
+
kwargs['ca_certs_dir_path'] = DataDir.instance().ca_certs_dir_path
|
138
|
+
|
133
139
|
if kwargs.get('headless'):
|
134
140
|
os.environ[env_vars.AGENT_HEADLESS] = '1'
|
135
141
|
|
@@ -144,10 +150,18 @@ def run(**kwargs):
|
|
144
150
|
os.environ[env_vars.AGENT_LIFECYCLE_HOOKS_PATH] = kwargs['lifecycle_hooks_path']
|
145
151
|
|
146
152
|
if kwargs.get('public_directory_path'):
|
147
|
-
|
153
|
+
# Join multiple paths with commas
|
154
|
+
public_dirs = kwargs['public_directory_path']
|
155
|
+
if isinstance(public_dirs, (list, tuple)):
|
156
|
+
os.environ[env_vars.AGENT_PUBLIC_DIRECTORY_PATH] = ','.join(public_dirs)
|
157
|
+
else:
|
158
|
+
os.environ[env_vars.AGENT_PUBLIC_DIRECTORY_PATH] = public_dirs
|
148
159
|
|
149
160
|
if kwargs.get('response_fixtures_path'):
|
150
|
-
|
161
|
+
response_fixtures_paths = kwargs.get('response_fixtures_path', ())
|
162
|
+
if response_fixtures_paths:
|
163
|
+
response_fixtures = ','.join(response_fixtures_paths)
|
164
|
+
os.environ[env_vars.AGENT_RESPONSE_FIXTURES_PATH] = response_fixtures
|
151
165
|
|
152
166
|
if not os.getenv(env_vars.LOG_LEVEL):
|
153
167
|
os.environ[env_vars.LOG_LEVEL] = kwargs['log_level']
|
@@ -166,15 +180,46 @@ def run(**kwargs):
|
|
166
180
|
os.environ[env_vars.AGENT_PROXY_URL] = proxy_url
|
167
181
|
settings.proxy.url = proxy_url
|
168
182
|
|
169
|
-
if
|
170
|
-
|
171
|
-
|
183
|
+
if kwargs.get('detached'):
|
184
|
+
# Run in detached mode with output redirection
|
185
|
+
import subprocess
|
186
|
+
import sys
|
187
|
+
|
188
|
+
# Build the command to run in background
|
189
|
+
cmd = [sys.executable, '-m', 'stoobly_agent'] + sys.argv[1:]
|
190
|
+
# Remove the --detached flag and its value from the command
|
191
|
+
detached_index = None
|
192
|
+
for i, arg in enumerate(cmd):
|
193
|
+
if arg == '--detached':
|
194
|
+
detached_index = i
|
195
|
+
break
|
196
|
+
if detached_index is not None:
|
197
|
+
cmd.pop(detached_index) # Remove --detached
|
198
|
+
if detached_index < len(cmd) and not cmd[detached_index].startswith('--'):
|
199
|
+
cmd.pop(detached_index) # Remove the file path
|
200
|
+
|
201
|
+
# Start the process in background with output redirection
|
202
|
+
with open(kwargs['detached'], 'w') as output_file:
|
203
|
+
process = subprocess.Popen(
|
204
|
+
cmd,
|
205
|
+
stdout=output_file,
|
206
|
+
stderr=subprocess.STDOUT, # Redirect stderr to stdout
|
207
|
+
preexec_fn=os.setsid # Create new process group
|
208
|
+
)
|
209
|
+
|
210
|
+
print(process.pid)
|
211
|
+
return
|
212
|
+
else:
|
213
|
+
# Run in foreground mode
|
214
|
+
if not kwargs.get('headless'):
|
215
|
+
settings.commit()
|
216
|
+
run_api(**kwargs)
|
172
217
|
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
218
|
+
if not kwargs.get('proxyless'):
|
219
|
+
log_id = 'Proxy'
|
220
|
+
Logger.instance(log_id).info(f"starting with mode {kwargs['proxy_mode']} and listening at {kwargs['proxy_host']}:{kwargs['proxy_port']}")
|
221
|
+
Logger.instance(log_id).info(f"{'' if settings.proxy.intercept.active else 'not yet '}configured to {settings.proxy.intercept.mode}")
|
222
|
+
run_proxy(**kwargs)
|
178
223
|
|
179
224
|
@main.command(
|
180
225
|
help="Mock request"
|
@@ -186,8 +231,8 @@ def run(**kwargs):
|
|
186
231
|
@click.option('--lifecycle-hooks-path', help='Path to lifecycle hooks script.')
|
187
232
|
@click.option('-o', '--output', help='Write to file instead of stdout')
|
188
233
|
@ConditionalDecorator(lambda f: click.option('--project-key')(f), is_remote)
|
189
|
-
@click.option('--public-directory-path', help='Path to public files. Used for mocking requests.')
|
190
|
-
@click.option('--response-fixtures-path', help='Path to response fixtures yaml. Used for mocking requests.')
|
234
|
+
@click.option('--public-directory-path', multiple=True, help='Path to public files. Used for mocking requests. Can take the form <FOLDER-PATH>[:<ORIGIN>].')
|
235
|
+
@click.option('--response-fixtures-path', multiple=True, help='Path to response fixtures yaml. Used for mocking requests. Can take the form <FILE-PATH>[:<ORIGIN>].')
|
191
236
|
@click.option('-X', '--request', default='GET', help='Specify request command to use')
|
192
237
|
@click.option('--scenario-key')
|
193
238
|
@click.argument('url')
|
stoobly_agent/config/data_dir.py
CHANGED
@@ -56,14 +56,6 @@ class DataDir:
|
|
56
56
|
|
57
57
|
@property
|
58
58
|
def path(self):
|
59
|
-
if not self.__path and os.environ.get(ENV) == 'test':
|
60
|
-
test_path = os.path.join(self.__data_dir_path, TMP_DIR_NAME, DATA_DIR_NAME)
|
61
|
-
|
62
|
-
if not os.path.exists(test_path):
|
63
|
-
os.makedirs(test_path, exist_ok=True)
|
64
|
-
|
65
|
-
return test_path
|
66
|
-
|
67
59
|
return self.__data_dir_path
|
68
60
|
|
69
61
|
@property
|
@@ -202,6 +194,7 @@ class DataDir:
|
|
202
194
|
with open(os.path.join(self.__data_dir_path, '.gitignore'), 'w') as fp:
|
203
195
|
fp.write(
|
204
196
|
"\n".join([
|
197
|
+
'.settings.yml.lock',
|
205
198
|
'ca_certs',
|
206
199
|
'certs',
|
207
200
|
'db',
|