port-ocean 0.12.2.dev17__tar.gz → 0.12.2.dev20__tar.gz
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.
Potentially problematic release.
This version of port-ocean might be problematic. Click here for more details.
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/PKG-INFO +3 -3
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/context/ocean.py +0 -5
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/api.py +1 -1
- port_ocean-0.12.2.dev20/port_ocean/middlewares.py +70 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/ocean.py +40 -30
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/run.py +3 -3
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/pyproject.toml +3 -3
- port_ocean-0.12.2.dev17/port_ocean/middlewares.py +0 -73
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/LICENSE.md +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/README.md +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/bootstrap.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cli.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/__init___.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/clean.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/dock.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/group.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/list_integrations.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/main.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/new.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/pull.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/sail.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/version.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/cookiecutter.json +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/extensions.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/hooks/post_gen_project.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.dockerignore +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.env.example +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.gitignore +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/.gitignore +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/blueprints.json +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/resources/port-app-config.yml +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/.port/spec.yaml +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CHANGELOG.md +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/CONTRIBUTING.md +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/Dockerfile +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/README.md +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/changelog/.gitignore +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/debug.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/main.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/poetry.toml +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/pyproject.toml +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/sonar-project.properties +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/{{cookiecutter.integration_slug}}/tests/test_sample.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/utils.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/authentication.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/client.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/blueprints.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/entities.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/integrations.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/migrations.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/retry_transport.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/types.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/utils.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/config/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/config/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/config/dynamic.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/config/settings.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/consumers/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/consumers/kafka_consumer.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/context/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/context/event.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/context/resource.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/defaults/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/defaults/clean.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/defaults/common.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/defaults/initialize.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/factory.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/http.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/kafka.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/once.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/polling.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entities_state_applier/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entities_state_applier/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entities_state_applier/port/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entities_state_applier/port/applier.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entities_state_applier/port/get_related_entities.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entities_state_applier/port/order_by_entities_dependencies.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entity_processor/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entity_processor/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/entity_processor/jq_entity_processor.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/port_app_config/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/port_app_config/api.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/port_app_config/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/port_app_config/models.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/resync_state_updater/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/resync_state_updater/updater.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/events.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/handler.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/sync.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/sync_raw.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/utils.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/models.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/ocean_types.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/utils.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/base.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/clients.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/context.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/core.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/port_defaults.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/exceptions/utils.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/helpers/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/helpers/async_client.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/helpers/retry.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/log/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/log/handlers.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/log/logger_setup.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/log/sensetive.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/py.typed +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/sonar-project.properties +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/clients/port/mixins/test_entities.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/conftest.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/core/handlers/entity_processor/test_jq_entity_processor.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/helpers/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/helpers/fixtures.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/helpers/integration.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/helpers/ocean_app.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/helpers/port_client.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/helpers/smoke_test.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/tests/test_smoke.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/__init__.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/async_http.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/async_iterators.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/cache.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/misc.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/queue_utils.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/repeat.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/signal.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/utils/time.py +0 -0
- {port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: port-ocean
|
|
3
|
-
Version: 0.12.2.
|
|
3
|
+
Version: 0.12.2.dev20
|
|
4
4
|
Summary: Port Ocean is a CLI tool for managing your Port projects.
|
|
5
5
|
Home-page: https://app.getport.io
|
|
6
6
|
Keywords: ocean,port-ocean,port
|
|
@@ -26,7 +26,7 @@ Requires-Dist: aiostream (>=0.5.2,<0.7.0)
|
|
|
26
26
|
Requires-Dist: click (>=8.1.3,<9.0.0) ; extra == "cli"
|
|
27
27
|
Requires-Dist: confluent-kafka (>=2.1.1,<3.0.0)
|
|
28
28
|
Requires-Dist: cookiecutter (>=2.1.1,<3.0.0) ; extra == "cli"
|
|
29
|
-
Requires-Dist: fastapi (>=0.100,<0.
|
|
29
|
+
Requires-Dist: fastapi (>=0.100,<0.116)
|
|
30
30
|
Requires-Dist: httpx (>=0.24.1,<0.28.0)
|
|
31
31
|
Requires-Dist: jinja2-time (>=0.2.0,<0.3.0) ; extra == "cli"
|
|
32
32
|
Requires-Dist: jq (>=1.8.0,<2.0.0)
|
|
@@ -40,7 +40,7 @@ Requires-Dist: rich (>=13.4.1,<14.0.0) ; extra == "cli"
|
|
|
40
40
|
Requires-Dist: six (>=1.16.0,<2.0.0)
|
|
41
41
|
Requires-Dist: tomli (>=2.0.1,<3.0.0)
|
|
42
42
|
Requires-Dist: urllib3 (>=1.26.16,<3.0.0)
|
|
43
|
-
Requires-Dist: uvicorn (>=0.22,<0.
|
|
43
|
+
Requires-Dist: uvicorn (>=0.22,<0.33)
|
|
44
44
|
Requires-Dist: werkzeug (>=2.3.4,<4.0.0)
|
|
45
45
|
Project-URL: Repository, https://github.com/port-labs/Port-Ocean
|
|
46
46
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from typing import Callable, TYPE_CHECKING, Any, Literal, Union
|
|
2
2
|
|
|
3
|
-
from fastapi import APIRouter
|
|
4
3
|
from pydantic.main import BaseModel
|
|
5
4
|
from werkzeug.local import LocalProxy
|
|
6
5
|
|
|
@@ -44,10 +43,6 @@ class PortOceanContext:
|
|
|
44
43
|
def config(self) -> "IntegrationConfiguration":
|
|
45
44
|
return self.app.config
|
|
46
45
|
|
|
47
|
-
@property
|
|
48
|
-
def router(self) -> APIRouter:
|
|
49
|
-
return self.app.integration_router
|
|
50
|
-
|
|
51
46
|
@property
|
|
52
47
|
def integration(self) -> "BaseIntegration":
|
|
53
48
|
return self.app.integration
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from loguru import logger
|
|
2
|
+
from starlette.requests import Request
|
|
3
|
+
from starlette.responses import Response
|
|
4
|
+
|
|
5
|
+
from port_ocean.exceptions.api import BaseAPIException, InternalServerException
|
|
6
|
+
from .context.event import event_context, EventType
|
|
7
|
+
from .context.ocean import ocean
|
|
8
|
+
from .utils.misc import get_time, generate_uuid
|
|
9
|
+
from starlette.middleware.base import (
|
|
10
|
+
BaseHTTPMiddleware,
|
|
11
|
+
RequestResponseEndpoint,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RequestHandlerMiddleware(BaseHTTPMiddleware):
|
|
16
|
+
async def dispatch(self, request: Request, call_next: RequestResponseEndpoint):
|
|
17
|
+
start_time = get_time(seconds_precision=False)
|
|
18
|
+
request_id = generate_uuid()
|
|
19
|
+
|
|
20
|
+
with logger.contextualize(request_id=request_id):
|
|
21
|
+
log_level = (
|
|
22
|
+
"DEBUG"
|
|
23
|
+
if request.url.path == "/docs" or request.url.path == "/openapi.json"
|
|
24
|
+
else "INFO"
|
|
25
|
+
)
|
|
26
|
+
logger.bind(url=str(request.url), method=request.method).log(
|
|
27
|
+
log_level, f"Request to {request.url.path} started"
|
|
28
|
+
)
|
|
29
|
+
response = await self._handle_silently(request, call_next)
|
|
30
|
+
|
|
31
|
+
end_time = get_time(seconds_precision=False)
|
|
32
|
+
time_elapsed = round(end_time - start_time, 5)
|
|
33
|
+
response.headers["X-Request-ID"] = request_id
|
|
34
|
+
response.headers["X-Process-Time"] = str(time_elapsed)
|
|
35
|
+
logger.bind(
|
|
36
|
+
time_elapsed=time_elapsed, response_status=response.status_code
|
|
37
|
+
).log(log_level, f"Request to {request.url.path} ended")
|
|
38
|
+
|
|
39
|
+
return response
|
|
40
|
+
|
|
41
|
+
async def _handle_silently(
|
|
42
|
+
self, request: Request, call_next: RequestResponseEndpoint
|
|
43
|
+
) -> Response:
|
|
44
|
+
response: Response
|
|
45
|
+
try:
|
|
46
|
+
if request.url.path.startswith("/integration"):
|
|
47
|
+
async with event_context(
|
|
48
|
+
EventType.HTTP_REQUEST, trigger_type="request"
|
|
49
|
+
):
|
|
50
|
+
await ocean.integration.port_app_config_handler.get_port_app_config()
|
|
51
|
+
response = await call_next(request)
|
|
52
|
+
else:
|
|
53
|
+
response = await call_next(request)
|
|
54
|
+
|
|
55
|
+
except BaseAPIException as ex:
|
|
56
|
+
response = ex.response()
|
|
57
|
+
if response.status_code < 500:
|
|
58
|
+
logger.bind(exception=str(ex)).info(
|
|
59
|
+
"Request did not succeed due to client-side error"
|
|
60
|
+
)
|
|
61
|
+
else:
|
|
62
|
+
logger.opt(exception=True).warning(
|
|
63
|
+
"Request did not succeed due to server-side error"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
except Exception:
|
|
67
|
+
logger.opt(exception=True).error("Request failed due to unexpected error")
|
|
68
|
+
response = InternalServerException().response()
|
|
69
|
+
|
|
70
|
+
return response
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import sys
|
|
3
3
|
import threading
|
|
4
|
-
from
|
|
5
|
-
from typing import Callable, Any, Dict, AsyncIterator, Type
|
|
4
|
+
from typing import Callable, Any, Dict, Type
|
|
6
5
|
|
|
7
|
-
from fastapi import FastAPI, APIRouter
|
|
8
6
|
from loguru import logger
|
|
9
7
|
from pydantic import BaseModel
|
|
8
|
+
from starlette.middleware import Middleware
|
|
9
|
+
from starlette.responses import JSONResponse
|
|
10
|
+
from starlette.routing import Route
|
|
10
11
|
from starlette.types import Scope, Receive, Send
|
|
11
12
|
|
|
12
13
|
from port_ocean.clients.port.client import PortClient
|
|
@@ -18,25 +19,50 @@ from port_ocean.context.ocean import (
|
|
|
18
19
|
ocean,
|
|
19
20
|
initialize_port_ocean_context,
|
|
20
21
|
)
|
|
22
|
+
from port_ocean.core.handlers.resync_state_updater import ResyncStateUpdater
|
|
21
23
|
from port_ocean.core.integrations.base import BaseIntegration
|
|
22
24
|
from port_ocean.core.models import Runtime
|
|
25
|
+
from port_ocean.log.sensetive import sensitive_log_filter
|
|
26
|
+
from port_ocean.middlewares import RequestHandlerMiddleware
|
|
23
27
|
from port_ocean.utils.repeat import repeat_every
|
|
24
28
|
from port_ocean.utils.signal import signal_handler
|
|
25
29
|
from port_ocean.version import __integration_version__
|
|
30
|
+
import contextlib
|
|
31
|
+
|
|
32
|
+
from starlette.applications import Starlette
|
|
26
33
|
|
|
27
34
|
|
|
28
35
|
class Ocean:
|
|
29
36
|
def __init__(
|
|
30
37
|
self,
|
|
31
|
-
app:
|
|
38
|
+
app: Starlette | None = None,
|
|
32
39
|
integration_class: Callable[[PortOceanContext], BaseIntegration] | None = None,
|
|
33
|
-
integration_router:
|
|
40
|
+
integration_router: None = None,
|
|
34
41
|
config_factory: Type[BaseModel] | None = None,
|
|
35
42
|
config_override: Dict[str, Any] | None = None,
|
|
36
43
|
):
|
|
37
44
|
initialize_port_ocean_context(self)
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
|
|
46
|
+
@contextlib.asynccontextmanager
|
|
47
|
+
async def lifespan(app):
|
|
48
|
+
try:
|
|
49
|
+
await self.integration.start()
|
|
50
|
+
await self._setup_scheduled_resync()
|
|
51
|
+
yield None
|
|
52
|
+
except Exception:
|
|
53
|
+
logger.exception("Integration had a fatal error. Shutting down.")
|
|
54
|
+
sys.exit("Server stopped")
|
|
55
|
+
finally:
|
|
56
|
+
signal_handler.exit()
|
|
57
|
+
|
|
58
|
+
async def handle_webhook_request(data: dict[str, Any]) -> dict[str, Any]:
|
|
59
|
+
return JSONResponse({"ok": True})
|
|
60
|
+
|
|
61
|
+
self.starlette_app = Starlette(
|
|
62
|
+
routes=[Route("/integration/webhook", endpoint=handle_webhook_request)],
|
|
63
|
+
middleware=[Middleware(RequestHandlerMiddleware)],
|
|
64
|
+
lifespan=lifespan,
|
|
65
|
+
)
|
|
40
66
|
|
|
41
67
|
self.config = IntegrationConfiguration(
|
|
42
68
|
# type: ignore
|
|
@@ -45,10 +71,9 @@ class Ocean:
|
|
|
45
71
|
)
|
|
46
72
|
|
|
47
73
|
# add the integration sensitive configuration to the sensitive patterns to mask out
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
# self.integration_router = integration_router or APIRouter()
|
|
74
|
+
sensitive_log_filter.hide_sensitive_strings(
|
|
75
|
+
*self.config.get_sensitive_fields_data()
|
|
76
|
+
)
|
|
52
77
|
|
|
53
78
|
self.port_client = PortClient(
|
|
54
79
|
base_url=self.config.port.base_url,
|
|
@@ -62,9 +87,9 @@ class Ocean:
|
|
|
62
87
|
integration_class(ocean) if integration_class else BaseIntegration(ocean)
|
|
63
88
|
)
|
|
64
89
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
90
|
+
self.resync_state_updater = ResyncStateUpdater(
|
|
91
|
+
self.port_client, self.config.scheduled_resync_interval
|
|
92
|
+
)
|
|
68
93
|
|
|
69
94
|
def is_saas(self) -> bool:
|
|
70
95
|
return self.config.runtime == Runtime.Saas
|
|
@@ -109,19 +134,4 @@ class Ocean:
|
|
|
109
134
|
await repeated_function()
|
|
110
135
|
|
|
111
136
|
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
@asynccontextmanager
|
|
115
|
-
async def lifecycle(_: FastAPI) -> AsyncIterator[None]:
|
|
116
|
-
try:
|
|
117
|
-
await self.integration.start()
|
|
118
|
-
await self._setup_scheduled_resync()
|
|
119
|
-
yield None
|
|
120
|
-
except Exception:
|
|
121
|
-
logger.exception("Integration had a fatal error. Shutting down.")
|
|
122
|
-
sys.exit("Server stopped")
|
|
123
|
-
finally:
|
|
124
|
-
signal_handler.exit()
|
|
125
|
-
|
|
126
|
-
self.fast_api_app.router.lifespan_context = lifecycle
|
|
127
|
-
await self.fast_api_app(scope, receive, send)
|
|
137
|
+
await self.starlette_app(scope, receive, send)
|
|
@@ -7,8 +7,8 @@ from pydantic import BaseModel
|
|
|
7
7
|
|
|
8
8
|
from port_ocean.bootstrap import create_default_app
|
|
9
9
|
from port_ocean.config.dynamic import default_config_factory
|
|
10
|
-
from port_ocean.config.settings import
|
|
11
|
-
from port_ocean.core.defaults import initialize_defaults
|
|
10
|
+
from port_ocean.config.settings import ApplicationSettings, LogLevelType
|
|
11
|
+
from port_ocean.core.defaults.initialize import initialize_defaults
|
|
12
12
|
from port_ocean.core.utils import validate_integration_runtime
|
|
13
13
|
from port_ocean.log.logger_setup import setup_logger
|
|
14
14
|
from port_ocean.ocean import Ocean
|
|
@@ -60,4 +60,4 @@ def run(
|
|
|
60
60
|
|
|
61
61
|
initialize_defaults(app.integration.AppConfigHandlerClass.CONFIG_CLASS, app.config)
|
|
62
62
|
|
|
63
|
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
63
|
+
uvicorn.run(app, host="0.0.0.0", port=application_settings.port)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "port-ocean"
|
|
3
|
-
version = "0.12.2-
|
|
3
|
+
version = "0.12.2-dev20"
|
|
4
4
|
description = "Port Ocean is a CLI tool for managing your Port projects."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
homepage = "https://app.getport.io"
|
|
@@ -40,8 +40,8 @@ pydantic = { version = "^1.10.8", extras = ["dotenv"] }
|
|
|
40
40
|
loguru = "^0.7.0"
|
|
41
41
|
pyyaml = "^6.0"
|
|
42
42
|
werkzeug = ">=2.3.4,<4.0.0"
|
|
43
|
-
fastapi = ">=0.100,<0.
|
|
44
|
-
uvicorn = ">=0.22,<0.
|
|
43
|
+
fastapi = ">=0.100,<0.116"
|
|
44
|
+
uvicorn = ">=0.22,<0.33"
|
|
45
45
|
confluent-kafka = "^2.1.1"
|
|
46
46
|
httpx = ">=0.24.1,<0.28.0"
|
|
47
47
|
jq = "^1.8.0"
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
from typing import Callable, Awaitable
|
|
2
|
-
|
|
3
|
-
from fastapi import Request, Response
|
|
4
|
-
from loguru import logger
|
|
5
|
-
|
|
6
|
-
from port_ocean.exceptions.api import BaseAPIException, InternalServerException
|
|
7
|
-
from .context.event import event_context, EventType
|
|
8
|
-
from .context.ocean import ocean
|
|
9
|
-
from .utils.misc import get_time, generate_uuid
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
async def _handle_silently(
|
|
13
|
-
call_next: Callable[[Request], Awaitable[Response]], request: Request
|
|
14
|
-
) -> Response:
|
|
15
|
-
response: Response
|
|
16
|
-
try:
|
|
17
|
-
if request.url.path.startswith("/integration"):
|
|
18
|
-
async with event_context(EventType.HTTP_REQUEST, trigger_type="request"):
|
|
19
|
-
await ocean.integration.port_app_config_handler.get_port_app_config()
|
|
20
|
-
response = await call_next(request)
|
|
21
|
-
else:
|
|
22
|
-
response = await call_next(request)
|
|
23
|
-
|
|
24
|
-
except BaseAPIException as ex:
|
|
25
|
-
response = ex.response()
|
|
26
|
-
if response.status_code < 500:
|
|
27
|
-
logger.bind(exception=str(ex)).info(
|
|
28
|
-
"Request did not succeed due to client-side error"
|
|
29
|
-
)
|
|
30
|
-
else:
|
|
31
|
-
logger.opt(exception=True).warning(
|
|
32
|
-
"Request did not succeed due to server-side error"
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
except Exception:
|
|
36
|
-
logger.opt(exception=True).error("Request failed due to unexpected error")
|
|
37
|
-
response = InternalServerException().response()
|
|
38
|
-
|
|
39
|
-
return response
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
async def request_handler(
|
|
43
|
-
request: Request, call_next: Callable[[Request], Awaitable[Response]]
|
|
44
|
-
) -> Response:
|
|
45
|
-
"""Middleware used by FastAPI to process each request, featuring:
|
|
46
|
-
|
|
47
|
-
- Contextualize request logs with a unique Request ID (UUID4) for each unique request.
|
|
48
|
-
- Catch exceptions during the request handling. Translate custom API exceptions into responses,
|
|
49
|
-
or treat (and log) unexpected exceptions.
|
|
50
|
-
"""
|
|
51
|
-
start_time = get_time(seconds_precision=False)
|
|
52
|
-
request_id = generate_uuid()
|
|
53
|
-
|
|
54
|
-
with logger.contextualize(request_id=request_id):
|
|
55
|
-
log_level = (
|
|
56
|
-
"DEBUG"
|
|
57
|
-
if request.url.path == "/docs" or request.url.path == "/openapi.json"
|
|
58
|
-
else "INFO"
|
|
59
|
-
)
|
|
60
|
-
logger.bind(url=str(request.url), method=request.method).log(
|
|
61
|
-
log_level, f"Request to {request.url.path} started"
|
|
62
|
-
)
|
|
63
|
-
response = await _handle_silently(call_next, request)
|
|
64
|
-
|
|
65
|
-
end_time = get_time(seconds_precision=False)
|
|
66
|
-
time_elapsed = round(end_time - start_time, 5)
|
|
67
|
-
response.headers["X-Request-ID"] = request_id
|
|
68
|
-
response.headers["X-Process-Time"] = str(time_elapsed)
|
|
69
|
-
logger.bind(
|
|
70
|
-
time_elapsed=time_elapsed, response_status=response.status_code
|
|
71
|
-
).log(log_level, f"Request to {request.url.path} ended")
|
|
72
|
-
|
|
73
|
-
return response
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/__init___.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/clean.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/dock.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/defaults/group.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/commands/list_integrations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/cookiecutter.json
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/cli/cookiecutter/extensions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/authentication.py
RENAMED
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/__init__.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/blueprints.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/entities.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/integrations.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/mixins/migrations.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/clients/port/retry_transport.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/event_listener/polling.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/port_app_config/api.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/handlers/port_app_config/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/__init__.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/events.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/handler.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/sync.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/sync_raw.py
RENAMED
|
File without changes
|
{port_ocean-0.12.2.dev17 → port_ocean-0.12.2.dev20}/port_ocean/core/integrations/mixins/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|