processcube-etw-library 2026.1.21.144958b0__tar.gz → 2026.1.22.73503b0__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.
- {processcube_etw_library-2026.1.21.144958b0/src/processcube_etw_library.egg-info → processcube_etw_library-2026.1.22.73503b0}/PKG-INFO +1 -1
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/__init__.py +7 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/create_external_task_client.py +3 -4
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/settings.py +32 -6
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0/src/processcube_etw_library.egg-info}/PKG-INFO +1 -1
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/.github/workflows/build_and_publish.yml +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/.gitignore +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/.python-version +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/README.md +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/pyproject.toml +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/setup.cfg +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/etw_app.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/__init__.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/built_in.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/check.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/handlers.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/models.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/registry.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/health/routes.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/identity_provider.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/server_config.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library/typed_handler.py +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library.egg-info/SOURCES.txt +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library.egg-info/dependency_links.txt +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library.egg-info/requires.txt +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/src/processcube_etw_library.egg-info/top_level.txt +0 -0
- {processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/uv.lock +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
# Prevent nest_asyncio from patching asyncio.run() in processcube_client - it breaks uvicorn's loop_factory
|
|
2
|
+
import nest_asyncio
|
|
3
|
+
nest_asyncio.apply = lambda *args, **kwargs: None
|
|
4
|
+
|
|
1
5
|
from .health import (
|
|
2
6
|
create_url_health_check,
|
|
3
7
|
HealthCheck,
|
|
@@ -7,6 +11,7 @@ from .health import (
|
|
|
7
11
|
LivezResponse,
|
|
8
12
|
)
|
|
9
13
|
from .etw_app import new_external_task_worker_app
|
|
14
|
+
from .settings import get_settings, init_settings
|
|
10
15
|
|
|
11
16
|
__all__ = [
|
|
12
17
|
"create_url_health_check",
|
|
@@ -16,4 +21,6 @@ __all__ = [
|
|
|
16
21
|
"HealthConditionInfo",
|
|
17
22
|
"LivezResponse",
|
|
18
23
|
"new_external_task_worker_app",
|
|
24
|
+
"get_settings",
|
|
25
|
+
"init_settings",
|
|
19
26
|
]
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# Prevent nest_asyncio from patching asyncio.run() in processcube_client - it breaks uvicorn's loop_factory
|
|
2
|
-
import nest_asyncio
|
|
3
|
-
nest_asyncio.apply = lambda *args, **kwargs: None
|
|
1
|
+
# # Prevent nest_asyncio from patching asyncio.run() in processcube_client - it breaks uvicorn's loop_factory
|
|
2
|
+
# import nest_asyncio
|
|
3
|
+
# nest_asyncio.apply = lambda *args, **kwargs: None
|
|
4
4
|
|
|
5
5
|
from processcube_client.external_task import ExternalTaskClient
|
|
6
|
-
from processcube_client.app_info import AppInfoClient
|
|
7
6
|
|
|
8
7
|
from .identity_provider import IdentityProvider
|
|
9
8
|
from .settings import get_settings
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from os import getenv
|
|
2
3
|
from typing import Optional, Type, TypeVar
|
|
3
4
|
|
|
4
5
|
from pydantic import Field, model_validator
|
|
5
6
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
6
7
|
|
|
8
|
+
from processcube_client.app_info import AppInfoClient
|
|
9
|
+
|
|
7
10
|
logger = logging.getLogger(__name__)
|
|
8
11
|
|
|
9
12
|
T = TypeVar("T", bound="ETWSettings")
|
|
10
13
|
|
|
11
14
|
DEFAULTS = {
|
|
12
15
|
"PROCESSCUBE_ENGINE_URL": "http://localhost:56000",
|
|
13
|
-
"PROCESSCUBE_AUTHORITY_URL": "http://localhost:56020",
|
|
14
16
|
"PROCESSCUBE_ETW_CLIENT_ID": "test_etw",
|
|
15
17
|
"PROCESSCUBE_ETW_CLIENT_SECRET": "3ef62eb3-fe49-4c2c-ba6f-73e4d234321b",
|
|
16
18
|
"PROCESSCUBE_ETW_CLIENT_SCOPES": "engine_etw",
|
|
@@ -19,6 +21,20 @@ DEFAULTS = {
|
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
|
|
24
|
+
def _determine_authority_url(engine_url: str) -> str:
|
|
25
|
+
if authority_url := getenv("PROCESSCUBE_AUTHORITY_URL"):
|
|
26
|
+
logger.info("Using authority URL from environment variable PROCESSCUBE_AUTHORITY_URL")
|
|
27
|
+
return authority_url
|
|
28
|
+
|
|
29
|
+
app_info_client = AppInfoClient(engine_url)
|
|
30
|
+
authority_url = app_info_client.get_authority()
|
|
31
|
+
logger.debug(f"Determined authority URL from AppInfoClient: {authority_url}")
|
|
32
|
+
if type(authority_url) is not str:
|
|
33
|
+
raise ValueError("Could not determine authority URL from AppInfoClient")
|
|
34
|
+
|
|
35
|
+
return authority_url
|
|
36
|
+
|
|
37
|
+
|
|
22
38
|
class ETWSettings(BaseSettings):
|
|
23
39
|
"""
|
|
24
40
|
Base settings for the External Task Worker library.
|
|
@@ -39,7 +55,7 @@ class ETWSettings(BaseSettings):
|
|
|
39
55
|
)
|
|
40
56
|
|
|
41
57
|
processcube_engine_url: str = Field(default=DEFAULTS["PROCESSCUBE_ENGINE_URL"])
|
|
42
|
-
processcube_authority_url: str = Field(default=
|
|
58
|
+
processcube_authority_url: str = Field(default="")
|
|
43
59
|
processcube_etw_client_id: str = Field(default=DEFAULTS["PROCESSCUBE_ETW_CLIENT_ID"])
|
|
44
60
|
processcube_etw_client_secret: str = Field(default=DEFAULTS["PROCESSCUBE_ETW_CLIENT_SECRET"])
|
|
45
61
|
processcube_etw_client_scopes: str = Field(default=DEFAULTS["PROCESSCUBE_ETW_CLIENT_SCOPES"])
|
|
@@ -49,16 +65,26 @@ class ETWSettings(BaseSettings):
|
|
|
49
65
|
@model_validator(mode="before")
|
|
50
66
|
@classmethod
|
|
51
67
|
def warn_missing_values(cls, values: dict) -> dict:
|
|
52
|
-
|
|
53
68
|
for env_name, default_value in DEFAULTS.items():
|
|
54
|
-
|
|
69
|
+
field_name = env_name.lower()
|
|
70
|
+
if field_name not in values or values.get(field_name) is None:
|
|
55
71
|
if default_value is not None:
|
|
56
72
|
logger.warning(
|
|
57
|
-
f"Environment variable {env_name} not set, using default: {default_value}"
|
|
73
|
+
f"Environment variable '{env_name}' not set, using default: {default_value}"
|
|
58
74
|
)
|
|
59
|
-
|
|
60
75
|
return values
|
|
61
76
|
|
|
77
|
+
@model_validator(mode="after")
|
|
78
|
+
def resolve_authority_url(self) -> "ETWSettings":
|
|
79
|
+
if not self.processcube_authority_url.strip():
|
|
80
|
+
self.processcube_authority_url = _determine_authority_url(
|
|
81
|
+
self.processcube_engine_url
|
|
82
|
+
)
|
|
83
|
+
logger.info(
|
|
84
|
+
f"Authority URL resolved from AppInfoClient: {self.processcube_authority_url}"
|
|
85
|
+
)
|
|
86
|
+
return self
|
|
87
|
+
|
|
62
88
|
|
|
63
89
|
_settings: Optional[ETWSettings] = None
|
|
64
90
|
|
|
File without changes
|
{processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
{processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/README.md
RENAMED
|
File without changes
|
|
File without changes
|
{processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/setup.cfg
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
|
{processcube_etw_library-2026.1.21.144958b0 → processcube_etw_library-2026.1.22.73503b0}/uv.lock
RENAMED
|
File without changes
|