refactor(auth): standardize session management and security
- Centralize secret retrieval using `getAdminSessionSecret` - Replace manual session parsing with `verifyRequestAdminSession` utility - Tighten API validation and improve security headers handling - Enforce environment variable security for production deployments
This commit is contained in:
1 parent
34519c07df
commit
177ed4a844
78 files changed
+6748
-3157
No files matched your search
@@ -1,10 +1,29 @@
|
||||
"""
|
||||
DataStack Python SDK (`datastack_sdk`)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Official Python client library for DataStack — Self-Hosted Real-Time Telemetry & Event Logging Platform.
|
||||
DataStack Python SDK Compatibility Alias (`datastack_sdk`).
|
||||
Re-exports all canonical symbols from `sdk/python/datastack` (`datastack`)
|
||||
so both `from datastack import DataStack` and legacy
|
||||
`from datastack_sdk import DataStackClient` share a single source of truth.
|
||||
"""
|
||||
|
||||
from .client import (
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _ensure_canonical_datastack_on_path() -> None:
|
||||
try:
|
||||
import datastack # noqa: F401
|
||||
return
|
||||
except ImportError:
|
||||
repo_canonical = (
|
||||
Path(__file__).resolve().parents[2] / "sdk" / "python" / "datastack"
|
||||
)
|
||||
if repo_canonical.is_dir() and str(repo_canonical) not in sys.path:
|
||||
sys.path.insert(0, str(repo_canonical))
|
||||
|
||||
|
||||
_ensure_canonical_datastack_on_path()
|
||||
|
||||
from datastack import ( # noqa: E402, F401
|
||||
ConnectionState,
|
||||
DataStack,
|
||||
DataStackAuthError,
|
||||
@@ -19,11 +38,10 @@ from .client import (
|
||||
DataStackRateLimitError,
|
||||
DiskSpooler,
|
||||
HeartbeatMonitor,
|
||||
__version__,
|
||||
load_config,
|
||||
)
|
||||
|
||||
__version__ = "2.2.0"
|
||||
|
||||
__all__ = [
|
||||
"DataStack",
|
||||
"DataStackClient",
|
||||
|
||||
Reference in new issue
Block a user