feldera 0.158.0__tar.gz → 0.160.0__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 feldera might be problematic. Click here for more details.
- {feldera-0.158.0 → feldera-0.160.0}/PKG-INFO +1 -1
- feldera-0.160.0/feldera/rest/_helpers.py +40 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/config.py +13 -9
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/feldera_client.py +1 -1
- {feldera-0.158.0 → feldera-0.160.0}/feldera/testutils.py +2 -6
- {feldera-0.158.0 → feldera-0.160.0}/feldera.egg-info/PKG-INFO +1 -1
- {feldera-0.158.0 → feldera-0.160.0}/pyproject.toml +1 -1
- feldera-0.158.0/feldera/rest/_helpers.py +0 -9
- {feldera-0.158.0 → feldera-0.160.0}/README.md +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/__init__.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/_callback_runner.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/_helpers.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/enums.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/output_handler.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/pipeline.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/pipeline_builder.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/__init__.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/_httprequests.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/errors.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/feldera_config.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/pipeline.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/sql_table.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/rest/sql_view.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/runtime_config.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/stats.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/tests/test_datafusionize.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera/testutils_oidc.py +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera.egg-info/SOURCES.txt +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera.egg-info/dependency_links.txt +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera.egg-info/requires.txt +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/feldera.egg-info/top_level.txt +0 -0
- {feldera-0.158.0 → feldera-0.160.0}/setup.cfg +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def client_version() -> str:
|
|
6
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
version = version("feldera")
|
|
10
|
+
except PackageNotFoundError:
|
|
11
|
+
version = "unknown"
|
|
12
|
+
|
|
13
|
+
return version
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def requests_verify_from_env() -> str | bool:
|
|
17
|
+
env_feldera_tls_insecure = os.environ.get("FELDERA_TLS_INSECURE")
|
|
18
|
+
FELDERA_HTTPS_TLS_CERT = os.environ.get("FELDERA_HTTPS_TLS_CERT")
|
|
19
|
+
|
|
20
|
+
if env_feldera_tls_insecure is not None and FELDERA_HTTPS_TLS_CERT is not None:
|
|
21
|
+
logging.warning(
|
|
22
|
+
"environment variables FELDERA_HTTPS_TLS_CERT and "
|
|
23
|
+
"FELDERA_TLS_INSECURE both are set."
|
|
24
|
+
"\nFELDERA_HTTPS_TLS_CERT takes priority."
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
if env_feldera_tls_insecure is None:
|
|
28
|
+
FELDERA_TLS_INSECURE = False
|
|
29
|
+
else:
|
|
30
|
+
FELDERA_TLS_INSECURE = env_feldera_tls_insecure.strip().lower() in (
|
|
31
|
+
"1",
|
|
32
|
+
"true",
|
|
33
|
+
"yes",
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
requests_verify = not FELDERA_TLS_INSECURE
|
|
37
|
+
if FELDERA_HTTPS_TLS_CERT is not None:
|
|
38
|
+
requests_verify = FELDERA_HTTPS_TLS_CERT
|
|
39
|
+
|
|
40
|
+
return requests_verify
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
import os
|
|
3
|
+
from feldera.rest._helpers import requests_verify_from_env
|
|
4
|
+
import logging
|
|
3
5
|
|
|
4
6
|
|
|
5
7
|
class Config:
|
|
@@ -14,7 +16,7 @@ class Config:
|
|
|
14
16
|
version: Optional[str] = None,
|
|
15
17
|
timeout: Optional[float] = None,
|
|
16
18
|
connection_timeout: Optional[float] = None,
|
|
17
|
-
requests_verify: bool | str =
|
|
19
|
+
requests_verify: Optional[bool | str] = None,
|
|
18
20
|
) -> None:
|
|
19
21
|
"""
|
|
20
22
|
:param url: The url to the Feldera API (ex: https://try.feldera.com)
|
|
@@ -23,7 +25,10 @@ class Config:
|
|
|
23
25
|
:param timeout: The timeout for the HTTP requests
|
|
24
26
|
:param connection_timeout: The connection timeout for the HTTP requests
|
|
25
27
|
:param requests_verify: The `verify` parameter passed to the requests
|
|
26
|
-
library. `True` by default.
|
|
28
|
+
library. `True` by default. Can also be set using environment
|
|
29
|
+
variables `FELDERA_TLS_INSECURE` to disable TLS and
|
|
30
|
+
`FELDERA_HTTPS_TLS_CERT` to set the certificate path. The latter
|
|
31
|
+
takes priority.
|
|
27
32
|
"""
|
|
28
33
|
|
|
29
34
|
BASE_URL = (
|
|
@@ -37,11 +42,10 @@ class Config:
|
|
|
37
42
|
self.version: Optional[str] = version or "v0"
|
|
38
43
|
self.timeout: Optional[float] = timeout
|
|
39
44
|
self.connection_timeout: Optional[float] = connection_timeout
|
|
45
|
+
env_verify = requests_verify_from_env()
|
|
46
|
+
self.requests_verify: bool | str = (
|
|
47
|
+
requests_verify if requests_verify is not None else env_verify
|
|
48
|
+
)
|
|
40
49
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
requests_verify = not FELDERA_TLS_INSECURE
|
|
44
|
-
if requests_verify and FELDERA_HTTPS_TLS_CERT is not None:
|
|
45
|
-
requests_verify = FELDERA_HTTPS_TLS_CERT
|
|
46
|
-
|
|
47
|
-
self.requests_verify: bool | str = requests_verify
|
|
50
|
+
if self.requests_verify is False:
|
|
51
|
+
logging.warning("TLS verification is disabled.")
|
|
@@ -49,7 +49,7 @@ class FelderaClient:
|
|
|
49
49
|
api_key: Optional[str] = None,
|
|
50
50
|
timeout: Optional[float] = None,
|
|
51
51
|
connection_timeout: Optional[float] = None,
|
|
52
|
-
requests_verify: bool | str =
|
|
52
|
+
requests_verify: Optional[bool | str] = None,
|
|
53
53
|
) -> None:
|
|
54
54
|
"""
|
|
55
55
|
:param url: The url to Feldera API (ex: https://try.feldera.com). If
|
|
@@ -13,6 +13,7 @@ from feldera.pipeline import Pipeline
|
|
|
13
13
|
from feldera.pipeline_builder import PipelineBuilder
|
|
14
14
|
from feldera.runtime_config import Resources, RuntimeConfig
|
|
15
15
|
from feldera.rest import FelderaClient
|
|
16
|
+
from feldera.rest._helpers import requests_verify_from_env
|
|
16
17
|
|
|
17
18
|
API_KEY = os.environ.get("FELDERA_API_KEY")
|
|
18
19
|
|
|
@@ -46,12 +47,7 @@ KAFKA_SERVER = os.environ.get("FELDERA_KAFKA_SERVER", "localhost:19092")
|
|
|
46
47
|
PIPELINE_TO_KAFKA_SERVER = os.environ.get(
|
|
47
48
|
"FELDERA_PIPELINE_TO_KAFKA_SERVER", "redpanda:9092"
|
|
48
49
|
)
|
|
49
|
-
|
|
50
|
-
FELDERA_HTTPS_TLS_CERT = os.environ.get("FELDERA_HTTPS_TLS_CERT")
|
|
51
|
-
if not FELDERA_TLS_INSECURE and FELDERA_HTTPS_TLS_CERT is not None:
|
|
52
|
-
FELDERA_REQUESTS_VERIFY = FELDERA_HTTPS_TLS_CERT
|
|
53
|
-
else:
|
|
54
|
-
FELDERA_REQUESTS_VERIFY = not FELDERA_TLS_INSECURE
|
|
50
|
+
FELDERA_REQUESTS_VERIFY = requests_verify_from_env()
|
|
55
51
|
|
|
56
52
|
|
|
57
53
|
class _LazyClient:
|
|
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
|