Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions connect/eaas/runner/handlers/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def __init__(self, config: ConfigHelper):
def ui_modules(self):
return self.get_application().get_ui_modules()

@property
def proxied_connect_api(self):
return self.get_application().get_proxied_connect_api()

@property
def app(self):
if not self._app:
Expand Down
1 change: 1 addition & 0 deletions connect/eaas/runner/workers/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def get_setup_request(self):
icon=self.handler.icon,
audience=self.handler.audience,
runner_version=get_version(),
proxied_connect_api=self.handler.proxied_connect_api,
),
)
logger.debug(f'Sending setup request: {pformat(msg)}')
Expand Down
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ connect-openapi-client = ">=25.16"
logzio-python-handler = "^3.0.0"
backoff = "^1.11.1"
uvloop = "^0.16.0"
connect-eaas-core = ">=27.7,<28"
connect-eaas-core = ">=27.8,<28"
httpx = "^0.23.0"
rich = "^12.5.1"
pyfiglet = "^0.8.post1"
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def settings_payload():
for evt_type in BACKGROUND_EVENT_TYPES
],
'model_type': 'setup_response',
'proxied_connect_api': [],
}


Expand Down
5 changes: 5 additions & 0 deletions tests/handlers/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def get_ui_modules(cls):
},
}

@classmethod
def get_proxied_connect_api(cls):
return ['/abc']

mocker.patch.object(
WebApp,
'load_application',
Expand All @@ -126,6 +130,7 @@ def get_ui_modules(cls):
assert handler.icon == descriptor['icon']
assert handler.audience == descriptor['audience']
assert handler.should_start is True
assert handler.proxied_connect_api == ['/abc']


@pytest.mark.parametrize('static_root', ('static', None))
Expand Down
12 changes: 12 additions & 0 deletions tests/workers/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ async def test_extension_settings(mocker, ws_server, unused_port, settings_paylo
},
}

proxied_connect_api = ['/public/v1/endpoint']

@account_settings_page('Settings', '/static/settings.html')
class MyExtension(WebApplicationBase):
@classmethod
Expand All @@ -76,6 +78,10 @@ def get_descriptor(cls):
'changelog_url': 'https://change.log',
}

@classmethod
def get_proxied_connect_api(cls):
return proxied_connect_api

mocker.patch.object(
WebApp,
'load_application',
Expand Down Expand Up @@ -120,6 +126,7 @@ def get_descriptor(cls):
'changelog_url': 'https://change.log',
},
runner_version='24.1',
proxied_connect_api=proxied_connect_api,
),
)

Expand Down Expand Up @@ -265,6 +272,7 @@ def test_url(self):
'changelog_url': 'https://change.log',
},
runner_version='24.1',
proxied_connect_api=[],
),
),
)
Expand Down Expand Up @@ -421,6 +429,7 @@ def test_url(self):
'changelog_url': 'https://change.log',
},
runner_version='24.1',
proxied_connect_api=[],
),
),
)
Expand Down Expand Up @@ -564,6 +573,7 @@ def test_url(self):
'changelog_url': 'https://change.log',
},
runner_version='24.1',
proxied_connect_api=[],
),
),
)
Expand Down Expand Up @@ -784,6 +794,7 @@ def on_shutdown(cls, logger, config):
'changelog_url': 'https://change.log',
},
runner_version='24.1',
proxied_connect_api=[],
),
)

Expand Down Expand Up @@ -894,6 +905,7 @@ async def on_shutdown(cls, logger, config):
'changelog_url': 'https://change.log',
},
runner_version='24.1',
proxied_connect_api=[],
),
)

Expand Down