feat: add ARCH-002 BOS object storage adapter

This commit is contained in:
d-robotics 2026-09-01 20:48:41 +08:00
parent d5b1d4fe4e
commit c95bd8a118
17 changed files with 672 additions and 17 deletions

View File

@ -11,17 +11,17 @@ RABBITMQ_URL=amqp://guest:guest@localhost:5672//
OBJECT_STORAGE_PROVIDER=local
OBJECT_STORAGE_PATH=storage
BOS_ENDPOINT=
BOS_ACCESS_KEY_ID=
BOS_SECRET_ACCESS_KEY=
BOS_BUCKET=
BOS_KEY_PREFIX=knowledge-platform
BOS_TIMEOUT_SECONDS=30
MAX_UPLOAD_BYTES=52428800
CHUNK_MAX_TOKENS=450
CHUNK_OVERLAP_TOKENS=75
CHUNK_MAX_CHARACTERS=2000
# Reserved for a future S3/MinIO adapter; the Demo currently uses local storage.
OBJECT_STORAGE_ENDPOINT=http://localhost:9000
OBJECT_STORAGE_ACCESS_KEY=
OBJECT_STORAGE_SECRET_KEY=
OBJECT_STORAGE_BUCKET=ekp
VECTOR_STORE_PROVIDER=mochow
BAIDU_MOCHOW_ACCOUNT=root
BAIDU_MOCHOW_API_KEY=

View File

@ -95,6 +95,8 @@ The accepted provider migration is tracked by `ARCH-001` through `ARCH-006`:
Baidu BOS, OceanBase Vector, and Qianfan `bce-reranker-base` replace the initial
demo providers without changing PostgreSQL canonical ownership. Until the runtime
cutover task is merged, the paragraphs above describe the current implementation.
ARCH-002 adds the selectable BOS adapter and safe runtime configuration documented
in `docs/development/BOS_SETUP.md`; local storage remains the default until ARCH-005.
DEMO-007 adds query embedding and profile-scoped Dense Top-N retrieval. The
default is Top 20 with a configurable Mochow HNSW `ef`; the in-memory fake uses

View File

@ -19,7 +19,8 @@ from ekp_core.document_upload import DocumentUploadService
from ekp_core.search import SearchService
from ekp_domain import IndexProfile
from ekp_embedding import EmbeddingProvider, QianfanEmbeddingProvider
from ekp_object_storage import LocalObjectStorage
from ekp_object_storage import ObjectStorage, create_bos_object_storage
from ekp_object_storage.local import LocalObjectStorage
from ekp_parser import ParserRouter
from ekp_reranker import QianfanRerankerProvider, RerankerProvider
from ekp_vector_store import MochowVectorStore, VectorStore, create_mochow_vector_store
@ -62,6 +63,28 @@ def create_embedding_provider(settings: Settings) -> QianfanEmbeddingProvider:
)
def create_object_storage(settings: Settings) -> ObjectStorage:
"""Create local or BOS storage while keeping credentials out of core services."""
if settings.object_storage_provider == "local":
return LocalObjectStorage(settings.object_storage_path)
if settings.bos_endpoint is None:
raise ProviderConfigurationError("BOS_ENDPOINT is required")
if settings.bos_access_key_id is None:
raise ProviderConfigurationError("BOS_ACCESS_KEY_ID is required")
if settings.bos_secret_access_key is None:
raise ProviderConfigurationError("BOS_SECRET_ACCESS_KEY is required")
if settings.bos_bucket is None:
raise ProviderConfigurationError("BOS_BUCKET is required")
return create_bos_object_storage(
endpoint=settings.bos_endpoint,
access_key_id=settings.bos_access_key_id.get_secret_value(),
secret_access_key=settings.bos_secret_access_key.get_secret_value(),
bucket_name=settings.bos_bucket,
key_prefix=settings.bos_key_prefix,
timeout_seconds=settings.bos_timeout_seconds,
)
def create_vector_store(settings: Settings) -> MochowVectorStore:
"""Create the Mochow adapter for an explicitly configured database/table."""
if settings.baidu_mochow_api_key is None:
@ -129,7 +152,7 @@ def create_api_services(settings: Settings) -> ApiServices:
"""Compose the synchronous Demo runtime once for all business endpoints."""
engine = create_database_engine(settings)
session_factory = create_session_factory(engine)
storage = LocalObjectStorage(settings.object_storage_path)
storage = create_object_storage(settings)
index_profile = create_index_profile(settings)
embedding_provider = create_embedding_provider(settings)
vector_store = create_vector_store(settings)

View File

@ -0,0 +1,62 @@
# ARCH-002 BOS 配置与对象契约
ARCH-002 在既有 `ObjectStorage` 契约后新增百度 BOS Adapter。业务服务仍只使用逻辑 key,
不知道 Bucket、Prefix、SDK 类型或凭据。Local Adapter 继续用于单元测试和本地开发;正式
默认切换留在 ARCH-005,避免在 Vector/Reranker 迁移完成前形成半套运行配置。
## 运行配置
配置只能由部署环境或 Secret Manager 注入,禁止把真实值写入 `.env`、镜像、日志、测试
快照或提交记录。
```text
OBJECT_STORAGE_PROVIDER=bos
BOS_ENDPOINT=<已授权的 HTTP(S) BOS Origin>
BOS_ACCESS_KEY_ID=<运行时注入>
BOS_SECRET_ACCESS_KEY=<运行时注入>
BOS_BUCKET=<预创建的 Bucket>
BOS_KEY_PREFIX=knowledge-platform
BOS_TIMEOUT_SECONDS=30
```
- Endpoint 必须是无用户名、密码、Path、Query 和 Fragment 的显式 HTTP(S) Origin;
- Bucket 名必须符合 BOS 的小写字母、数字和连字符规则;
- Prefix 可为空;非空时使用安全的 POSIX 相对 key,不允许空段、`.`、`..` 或反斜杠;
- 应用不会创建、删除或修改 Bucket 配置。
## 对象与不可变约束
canonical `Document.storage_key` 保存与 Provider 无关的逻辑 key,例如:
```text
documents/<document_id>/<filename>
```
BOS Adapter 发起请求时才映射为:
```text
<BOS_KEY_PREFIX>/documents/<document_id>/<filename>
```
上传先写入可回卷的临时流,以满足官方 SDK 对长度和 CRC 计算的要求;随后使用
`If-None-Match: *` 执行单对象 Put,服务端返回 412 时统一映射为
`ObjectAlreadyExistsError`。这样不会用“先 HEAD、再 PUT”的竞态检查破坏不可变来源约束。
下载返回 SDK 的流式 Response Body,由调用方负责关闭;存在性检查只发 HEAD,不下载正文。
404、412 和其他 SDK 异常映射为稳定的 Provider-neutral 错误,外层错误不包含 Endpoint、
SDK Response Body 或凭据。
## 权限与验收边界
运行身份只授予目标 Bucket/Prefix 所需的 Put、Get/Head 和 Delete 权限,不授予 Bucket 管理或
全局 List 权限。若生产策略要求来源不可物理删除,应在后续 Document Version/Retention
设计中单独处理;当前 Demo 的直接删除行为保持不变。
默认测试使用 Fake Client,不连接 BOS。真实连接、权限和临时对象清理统一在 ARCH-006 的
受控测试资源中验证,并且只允许使用轮换后的凭据。
官方参考:
- [BOS Python SDK 上传文件](https://cloud.baidu.com/doc/BOS/s/yl5jfscvi)
- [BOS 获取 Object](https://cloud.baidu.com/doc/BOS/s/Mk4xtzv8v)
- [BOS 访问控制](https://cloud.baidu.com/doc/BOS/s/Tjwvysda9)

View File

@ -2,11 +2,11 @@
当前阶段:Provider 架构迁移
已完成:DEMO-001~DEMO-009、ARCH-001
已完成:DEMO-001~DEMO-009、ARCH-001、ARCH-002
进行中:无
阻塞:无
下一任务:ARCH-002
下一任务:ARCH-003
Provider 架构迁移按 `ARCH-001 → ARCH-002 → ARCH-003 → ARCH-004 → ARCH-005 → ARCH-006`
执行;每个 Task 验证后独立推送并合并 `main`。全部迁移完成后再继续 DEMO-010。
@ -143,3 +143,14 @@ Provider 架构迁移按 `ARCH-001 → ARCH-002 → ARCH-003 → ARCH-004 → AR
引入 Top50、RRF、Marker/Pandoc、LLM 派生索引、ACL 或 Hybrid/BM25 扩展。
- 本任务只调整架构和产品文档,不修改运行时代码;旧系统地址、账号和凭据均未写入仓库,
真实验收只允许使用轮换后的 Secret 与受控测试资源。
### ARCH-002
- 新增官方 `bce-python-sdk` 驱动的 `BosObjectStorage`,保持逻辑 key 与 Bucket/Prefix 分离,
覆盖 Put、流式 Open、HEAD Exists 和 Delete。
- 上传先使用可回卷临时流确定长度,再通过 `If-None-Match: *` 原子拒绝覆盖;404/412 和
其他 SDK 异常映射为不泄露 Endpoint、响应正文或凭据的稳定存储错误。
- 新增 `local|bos` 类型化配置和运行时工厂;BOS AK/SK 使用 `SecretStr`,Bucket、Endpoint、
Prefix 和超时均由环境注入。Local 仍是测试/开发及 ARCH-005 前的默认实现。
- 新增完全离线的 BOS Adapter、配置、Provider wiring 测试和中文配置说明;未使用内部配置
清单中的真实地址或凭据,真实 BOS 联调留在 ARCH-006。

View File

@ -3,7 +3,7 @@
## Architecture provider migration
- [x] ARCH-001 Architecture decision, PRD, Scope and execution baseline
- [ ] ARCH-002 BOS ObjectStorage adapter and runtime configuration
- [x] ARCH-002 BOS ObjectStorage adapter and runtime configuration
- [ ] ARCH-003 OceanBase VectorStore adapter and index schema
- [ ] ARCH-004 Qianfan `bce-reranker-base` alignment
- [ ] ARCH-005 Runtime cutover, shadow rebuild workflow and legacy configuration cleanup

View File

@ -25,8 +25,14 @@ class Settings(BaseSettings):
api_port: int = Field(default=8000, ge=1, le=65535)
api_prefix: str = "/api/v1"
database_url: str = "postgresql+psycopg://localhost:5432/ekp"
object_storage_provider: Literal["local"] = "local"
object_storage_provider: Literal["local", "bos"] = "local"
object_storage_path: Path = Path("storage")
bos_endpoint: str | None = None
bos_access_key_id: SecretStr | None = None
bos_secret_access_key: SecretStr | None = None
bos_bucket: str | None = None
bos_key_prefix: str = "knowledge-platform"
bos_timeout_seconds: float = Field(default=30.0, gt=0)
max_upload_bytes: int = Field(default=50 * 1024 * 1024, gt=0)
chunk_max_tokens: int = Field(default=450, gt=0)
chunk_overlap_tokens: int = Field(default=75, ge=0)

View File

@ -4,16 +4,28 @@ from ekp_object_storage.base import (
BinarySource,
InvalidStorageKeyError,
ObjectAlreadyExistsError,
ObjectNotFoundError,
ObjectStorage,
ObjectStorageError,
StoredObject,
)
from ekp_object_storage.bos import (
BosConfigurationError,
BosObjectStorage,
create_bos_object_storage,
)
from ekp_object_storage.local import LocalObjectStorage
__all__ = [
"BinarySource",
"BosConfigurationError",
"BosObjectStorage",
"InvalidStorageKeyError",
"LocalObjectStorage",
"ObjectAlreadyExistsError",
"ObjectNotFoundError",
"ObjectStorage",
"ObjectStorageError",
"StoredObject",
"create_bos_object_storage",
]

View File

@ -12,6 +12,14 @@ class ObjectAlreadyExistsError(FileExistsError):
"""Raised when immutable source bytes already exist at a storage key."""
class ObjectNotFoundError(FileNotFoundError):
"""Raised when a requested object key does not exist."""
class ObjectStorageError(RuntimeError):
"""Sanitized provider failure that excludes endpoints and credentials."""
@dataclass(frozen=True, slots=True)
class StoredObject:
"""Metadata returned after object bytes are stored successfully."""
@ -41,3 +49,11 @@ class ObjectStorage(Protocol):
def exists(self, key: str) -> bool:
"""Return whether an object exists at the key."""
def validate_storage_key(key: str) -> str:
"""Validate the portable provider-neutral object-key subset used by EKP."""
parts = key.split("/")
if not key or "\\" in key or any(part in {"", ".", ".."} for part in parts):
raise InvalidStorageKeyError(key)
return key

View File

@ -0,0 +1,207 @@
"""Baidu BOS adapter isolated behind the provider-neutral ObjectStorage contract."""
import re
from tempfile import SpooledTemporaryFile
from typing import BinaryIO, Protocol, cast
from urllib.parse import urlsplit
from ekp_object_storage.base import (
BinarySource,
ObjectAlreadyExistsError,
ObjectNotFoundError,
ObjectStorageError,
StoredObject,
validate_storage_key,
)
COPY_BUFFER_BYTES = 1024 * 1024
DEFAULT_SPOOL_MEMORY_BYTES = 8 * 1024 * 1024
IF_NONE_MATCH = b"If-None-Match"
BOS_BUCKET_NAME = re.compile(r"^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$")
class BosConfigurationError(ValueError):
"""Raised when the BOS target is missing or structurally unsafe."""
class _BosClient(Protocol):
"""Narrow subset of the untyped official SDK used by this adapter."""
def put_object(
self,
bucket_name: str,
key: str,
data: object,
content_length: int,
*,
cond_read_write: dict[bytes, bytes],
) -> object:
"""Upload one object with a server-side write precondition."""
def get_object(self, bucket_name: str, key: str) -> object:
"""Return an SDK response whose data member is a binary stream."""
def get_object_meta_data(self, bucket_name: str, key: str) -> object:
"""Issue a HEAD request for one object."""
def delete_object(self, bucket_name: str, key: str) -> object:
"""Delete one object."""
class BosObjectStorage:
"""Store immutable EKP objects in one configured BOS bucket and prefix."""
def __init__(
self,
client: _BosClient,
bucket_name: str,
key_prefix: str = "",
*,
spool_memory_bytes: int = DEFAULT_SPOOL_MEMORY_BYTES,
) -> None:
if not BOS_BUCKET_NAME.fullmatch(bucket_name):
raise BosConfigurationError("invalid BOS bucket name")
if spool_memory_bytes <= 0:
raise BosConfigurationError("BOS spool_memory_bytes must be positive")
self._client = client
self._bucket_name = bucket_name
self._key_prefix = validate_storage_key(key_prefix) if key_prefix else ""
self._spool_memory_bytes = spool_memory_bytes
def put(self, key: str, source: BinarySource) -> StoredObject:
"""Stage a stream, then atomically reject overwrites with If-None-Match."""
object_key = self._object_key(key)
# The official SDK requires content length and seeks while calculating CRC32.
# Spooling preserves streaming input support without holding large files in memory.
with SpooledTemporaryFile(max_size=self._spool_memory_bytes, mode="w+b") as staged:
size_bytes = _copy_source(source, staged)
staged.seek(0)
try:
self._client.put_object(
self._bucket_name,
object_key,
staged,
size_bytes,
cond_read_write={IF_NONE_MATCH: b"*"},
)
except Exception as exc:
if _status_code(exc) == 412:
raise ObjectAlreadyExistsError(key) from exc
raise ObjectStorageError("BOS object upload failed") from exc
return StoredObject(key=key, size_bytes=size_bytes)
def open(self, key: str) -> BinaryIO:
"""Return the streaming BOS response body; the caller must close it."""
object_key = self._object_key(key)
try:
response = self._client.get_object(self._bucket_name, object_key)
data = getattr(response, "data", None)
if not callable(getattr(data, "read", None)) or not callable(
getattr(data, "close", None)
):
raise TypeError("BOS response data is not a readable binary stream")
return cast(BinaryIO, data)
except Exception as exc:
if _status_code(exc) == 404:
raise ObjectNotFoundError(key) from exc
raise ObjectStorageError("BOS object download failed") from exc
def delete(self, key: str) -> None:
"""Delete one prefixed BOS object without exposing SDK error details."""
object_key = self._object_key(key)
try:
self._client.delete_object(self._bucket_name, object_key)
except Exception as exc:
if _status_code(exc) == 404:
raise ObjectNotFoundError(key) from exc
raise ObjectStorageError("BOS object deletion failed") from exc
def exists(self, key: str) -> bool:
"""Use BOS HEAD so existence checks do not download object bytes."""
object_key = self._object_key(key)
try:
self._client.get_object_meta_data(self._bucket_name, object_key)
return True
except Exception as exc:
if _status_code(exc) == 404:
return False
raise ObjectStorageError("BOS object metadata check failed") from exc
def _object_key(self, key: str) -> str:
"""Map a canonical logical key into the configured bucket prefix."""
safe_key = validate_storage_key(key)
if not self._key_prefix:
return safe_key
return f"{self._key_prefix}/{safe_key}"
def create_bos_object_storage(
*,
endpoint: str,
access_key_id: str,
secret_access_key: str,
bucket_name: str,
key_prefix: str = "",
timeout_seconds: float = 30.0,
) -> BosObjectStorage:
"""Build the official BOS client from runtime-injected, validated settings."""
if not access_key_id or not secret_access_key:
raise BosConfigurationError("BOS access key ID and secret access key are required")
_validate_endpoint(endpoint)
if not BOS_BUCKET_NAME.fullmatch(bucket_name):
raise BosConfigurationError("invalid BOS bucket name")
if timeout_seconds <= 0:
raise BosConfigurationError("BOS timeout_seconds must be positive")
try:
from baidubce.auth.bce_credentials import ( # type: ignore[import-untyped]
BceCredentials,
)
from baidubce.bce_client_configuration import ( # type: ignore[import-untyped]
BceClientConfiguration,
)
from baidubce.services.bos.bos_client import BosClient # type: ignore[import-untyped]
config = BceClientConfiguration(
credentials=BceCredentials(access_key_id, secret_access_key),
endpoint=endpoint,
connection_timeout_in_mills=int(timeout_seconds * 1000),
)
client = BosClient(config)
except Exception as exc:
raise ObjectStorageError("BOS client initialization failed") from exc
return BosObjectStorage(client, bucket_name, key_prefix)
def _copy_source(source: BinarySource, target: SpooledTemporaryFile[bytes]) -> int:
"""Copy a forward-only source into a seekable staging stream and count bytes."""
size_bytes = 0
while True:
chunk = source.read(COPY_BUFFER_BYTES)
if not isinstance(chunk, bytes):
raise TypeError("binary source read() must return bytes")
if not chunk:
return size_bytes
target.write(chunk)
size_bytes += len(chunk)
def _status_code(error: Exception) -> int | None:
"""Read only the status needed for stable provider-neutral error mapping."""
status_code = getattr(error, "status_code", None)
return status_code if isinstance(status_code, int) else None
def _validate_endpoint(endpoint: str) -> None:
"""Require an explicit HTTP(S) origin without embedded credentials or paths."""
parsed = urlsplit(endpoint)
if (
parsed.scheme not in {"http", "https"}
or not parsed.hostname
or parsed.username is not None
or parsed.password is not None
or parsed.path not in {"", "/"}
or parsed.query
or parsed.fragment
):
raise BosConfigurationError("invalid BOS endpoint")

View File

@ -8,7 +8,9 @@ from ekp_object_storage.base import (
BinarySource,
InvalidStorageKeyError,
ObjectAlreadyExistsError,
ObjectNotFoundError,
StoredObject,
validate_storage_key,
)
COPY_BUFFER_BYTES = 1024 * 1024
@ -43,11 +45,17 @@ class LocalObjectStorage:
def open(self, key: str) -> BinaryIO:
"""Open stored bytes in read-only binary mode."""
return self._resolve_key(key).open("rb")
try:
return self._resolve_key(key).open("rb")
except FileNotFoundError as exc:
raise ObjectNotFoundError(key) from exc
def delete(self, key: str) -> None:
"""Remove source bytes directly, as permitted by the Demo scope."""
self._resolve_key(key).unlink()
try:
self._resolve_key(key).unlink()
except FileNotFoundError as exc:
raise ObjectNotFoundError(key) from exc
def exists(self, key: str) -> bool:
"""Return true only for stored files, not directories."""
@ -55,9 +63,7 @@ class LocalObjectStorage:
def _resolve_key(self, key: str) -> Path:
"""Resolve a portable POSIX key without allowing root escape."""
parts = key.split("/")
if not key or "\\" in key or any(part in {"", ".", ".."} for part in parts):
raise InvalidStorageKeyError(key)
parts = validate_storage_key(key).split("/")
candidate = self._root.joinpath(*parts).resolve()
if candidate == self._root or not candidate.is_relative_to(self._root):

View File

@ -10,6 +10,7 @@ readme = "README.md"
requires-python = ">=3.12,<3.14"
dependencies = [
"alembic>=1.18,<2",
"bce-python-sdk>=0.9.72,<0.10",
"fastapi>=0.115,<1",
"psycopg[binary]>=3.2,<4",
"pymochow>=2.4,<3",

View File

@ -0,0 +1,169 @@
"""Offline contract tests for the Baidu BOS object-storage adapter."""
from io import BytesIO
from types import SimpleNamespace
from typing import BinaryIO, cast
import pytest
from ekp_object_storage import (
BosConfigurationError,
BosObjectStorage,
InvalidStorageKeyError,
ObjectAlreadyExistsError,
ObjectNotFoundError,
ObjectStorageError,
)
class FakeBosError(Exception):
"""SDK-like failure carrying only the HTTP status used by the adapter."""
def __init__(self, message: str, status_code: int) -> None:
super().__init__(message)
self.status_code = status_code
class FakeBosClient:
"""Capture official SDK-shaped calls without network or credentials."""
def __init__(self) -> None:
self.objects: dict[tuple[str, str], bytes] = {}
self.put_calls: list[tuple[str, str, int, dict[bytes, bytes]]] = []
self.delete_calls: list[tuple[str, str]] = []
self.failure: Exception | None = None
def put_object(
self,
bucket_name: str,
key: str,
data: object,
content_length: int,
*,
cond_read_write: dict[bytes, bytes],
) -> object:
self._raise_failure()
self.put_calls.append((bucket_name, key, content_length, cond_read_write))
self.objects[(bucket_name, key)] = cast(BinaryIO, data).read()
return object()
def get_object(self, bucket_name: str, key: str) -> object:
self._raise_failure()
try:
payload = self.objects[(bucket_name, key)]
except KeyError as exc:
raise FakeBosError("missing", 404) from exc
return SimpleNamespace(data=BytesIO(payload))
def get_object_meta_data(self, bucket_name: str, key: str) -> object:
self._raise_failure()
if (bucket_name, key) not in self.objects:
raise FakeBosError("missing", 404)
return object()
def delete_object(self, bucket_name: str, key: str) -> object:
self._raise_failure()
self.delete_calls.append((bucket_name, key))
if self.objects.pop((bucket_name, key), None) is None:
raise FakeBosError("missing", 404)
return object()
def _raise_failure(self) -> None:
if self.failure is not None:
raise self.failure
class FailingSource(BytesIO):
"""Simulate an input failure before a remote PutObject begins."""
def read(self, size: int | None = -1) -> bytes:
raise OSError("simulated source failure")
def test_bos_put_uses_prefix_length_and_atomic_no_overwrite() -> None:
client = FakeBosClient()
storage = BosObjectStorage(client, "ekp-test-bucket", "tenant/demo")
stored = storage.put("documents/source.txt", BytesIO(b"source bytes"))
assert stored.key == "documents/source.txt"
assert stored.size_bytes == 12
assert client.put_calls == [
(
"ekp-test-bucket",
"tenant/demo/documents/source.txt",
12,
{b"If-None-Match": b"*"},
)
]
assert client.objects[("ekp-test-bucket", "tenant/demo/documents/source.txt")] == (
b"source bytes"
)
def test_bos_put_maps_precondition_failure_to_already_exists() -> None:
client = FakeBosClient()
client.failure = FakeBosError("precondition failed", 412)
storage = BosObjectStorage(client, "ekp-test-bucket")
with pytest.raises(ObjectAlreadyExistsError):
storage.put("documents/source.txt", BytesIO(b"replacement"))
def test_bos_stages_source_before_remote_upload() -> None:
client = FakeBosClient()
storage = BosObjectStorage(client, "ekp-test-bucket")
with pytest.raises(OSError, match="simulated source failure"):
storage.put("documents/source.txt", FailingSource())
assert client.put_calls == []
def test_bos_open_exists_and_delete_use_prefixed_key() -> None:
client = FakeBosClient()
client.objects[("ekp-test-bucket", "tenant/demo/documents/source.txt")] = b"source"
storage = BosObjectStorage(client, "ekp-test-bucket", "tenant/demo")
assert storage.exists("documents/source.txt")
with storage.open("documents/source.txt") as source:
assert source.read() == b"source"
storage.delete("documents/source.txt")
assert client.delete_calls == [("ekp-test-bucket", "tenant/demo/documents/source.txt")]
assert not storage.exists("documents/source.txt")
with pytest.raises(ObjectNotFoundError):
storage.open("documents/source.txt")
@pytest.mark.parametrize(
"key",
["", "/absolute.txt", "../escape.txt", "nested/../escape.txt", "bad\\key.txt"],
)
def test_bos_rejects_unsafe_logical_keys(key: str) -> None:
storage = BosObjectStorage(FakeBosClient(), "ekp-test-bucket")
with pytest.raises(InvalidStorageKeyError):
storage.exists(key)
def test_bos_sanitizes_sdk_failures() -> None:
client = FakeBosClient()
client.failure = FakeBosError("secret-value at private-endpoint", 500)
storage = BosObjectStorage(client, "ekp-test-bucket")
with pytest.raises(ObjectStorageError, match="metadata check failed") as caught:
storage.exists("documents/source.txt")
rendered = str(caught.value)
assert "secret-value" not in rendered
assert "private-endpoint" not in rendered
@pytest.mark.parametrize(
("bucket", "prefix"),
[("", ""), ("ekp-test-bucket", "bad/../prefix")],
)
def test_bos_rejects_incomplete_or_unsafe_target(bucket: str, prefix: str) -> None:
with pytest.raises((BosConfigurationError, InvalidStorageKeyError)):
BosObjectStorage(FakeBosClient(), bucket, prefix)

View File

@ -17,6 +17,12 @@ def test_settings_have_demo_defaults(isolated_settings_environment: None) -> Non
assert settings.database_url.startswith("postgresql+psycopg://")
assert settings.object_storage_provider == "local"
assert settings.object_storage_path == Path("storage")
assert settings.bos_endpoint is None
assert settings.bos_access_key_id is None
assert settings.bos_secret_access_key is None
assert settings.bos_bucket is None
assert settings.bos_key_prefix == "knowledge-platform"
assert settings.bos_timeout_seconds == 30
assert settings.max_upload_bytes == 50 * 1024 * 1024
assert settings.chunk_max_tokens == 450
assert settings.chunk_overlap_tokens == 75
@ -62,10 +68,14 @@ def test_settings_redact_provider_secrets(isolated_settings_environment: None) -
settings = Settings(
baidu_qianfan_api_key=SecretStr("qianfan-secret"),
baidu_mochow_api_key=SecretStr("mochow-secret"),
bos_access_key_id=SecretStr("bos-access-key"),
bos_secret_access_key=SecretStr("bos-secret-key"),
reranker_api_key=SecretStr("reranker-secret"),
)
rendered = repr(settings)
assert "qianfan-secret" not in rendered
assert "mochow-secret" not in rendered
assert "bos-access-key" not in rendered
assert "bos-secret-key" not in rendered
assert "reranker-secret" not in rendered

View File

@ -9,6 +9,7 @@ from ekp_object_storage import (
InvalidStorageKeyError,
LocalObjectStorage,
ObjectAlreadyExistsError,
ObjectNotFoundError,
)
@ -54,6 +55,15 @@ def test_put_removes_partial_file_after_stream_failure(tmp_path: Path) -> None:
assert not storage.exists("interrupted.bin")
def test_missing_local_object_uses_provider_neutral_error(tmp_path: Path) -> None:
storage = LocalObjectStorage(tmp_path)
with pytest.raises(ObjectNotFoundError):
storage.open("missing.bin")
with pytest.raises(ObjectNotFoundError):
storage.delete("missing.bin")
@pytest.mark.parametrize(
"key",
["", "/absolute.txt", "../escape.txt", "nested/../escape.txt", "bad\\key.txt"],

View File

@ -8,12 +8,14 @@ from ekp_api.providers import (
create_dense_retrieval_service,
create_embedding_provider,
create_index_profile,
create_object_storage,
create_reranker_provider,
create_search_service,
create_vector_store,
)
from ekp_core.config import Settings
from ekp_embedding import FakeEmbeddingProvider
from ekp_object_storage import BosObjectStorage, LocalObjectStorage
from ekp_vector_store import FakeVectorStore
@ -40,6 +42,40 @@ def test_provider_wiring_requires_explicit_mochow_target(
create_vector_store(settings)
def test_provider_wiring_selects_local_storage_by_default(
isolated_settings_environment: None,
) -> None:
storage = create_object_storage(Settings())
assert isinstance(storage, LocalObjectStorage)
def test_provider_wiring_requires_complete_bos_target(
isolated_settings_environment: None,
) -> None:
settings = Settings(object_storage_provider="bos")
with pytest.raises(ProviderConfigurationError, match="BOS_ENDPOINT"):
create_object_storage(settings)
def test_provider_wiring_builds_bos_without_network(
isolated_settings_environment: None,
) -> None:
settings = Settings(
object_storage_provider="bos",
bos_endpoint="https://bj.bcebos.com",
bos_access_key_id=SecretStr("test-access-key"),
bos_secret_access_key=SecretStr("test-secret-key"),
bos_bucket="ekp-test-bucket",
bos_key_prefix="tenant/demo",
)
storage = create_object_storage(settings)
assert isinstance(storage, BosObjectStorage)
def test_provider_wiring_builds_dense_retrieval_without_network(
isolated_settings_environment: None,
) -> None:

84
uv.lock generated
View File

@ -47,6 +47,21 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/da/35/f2287558c17e29fafc8ef3daf819bb9834061cfa43bff8014f7df7f63bdc/anyio-4.14.2-py3-none-any.whl", hash = "sha256:9f505dda5ac9f0c8309b5e8bd445a8c2bf7246f3ce950121e45ea15bc41d1494", size = 125813, upload-time = "2026-07-12T20:29:05.763Z" },
]
[[package]]
name = "bce-python-sdk"
version = "0.9.79"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "crc32c" },
{ name = "future" },
{ name = "pycryptodome" },
{ name = "six" },
]
sdist = { url = "https://files.pythonhosted.org/packages/9d/64/d31e61620ddaecb7039dc7b8f62eb75b95d2281f2d2016b6d6b22396e16f/bce_python_sdk-0.9.79.tar.gz", hash = "sha256:cd77476b43347ed28d0211d5ad557e524e1ec648bd093d57c6a6d3de075a7508", size = 322059, upload-time = "2026-09-01T05:48:52.013Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ef/de/52b763b183e23f4dd73811a2dd2664824ae7fc6ceb1aa8dcd3f1102b1094/bce_python_sdk-0.9.79-py3-none-any.whl", hash = "sha256:71799ac8740505e0759d30873f6f1a478fa8f83aedf425d511f1419a5f30082e", size = 440268, upload-time = "2026-09-01T05:48:50.459Z" },
]
[[package]]
name = "certifi"
version = "2026.7.22"
@ -175,12 +190,41 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/b1/5a/234e8fadf85c3cc48cb31c247b9e8e0c7f06ece80f5b29f9b8c241f9da4c/coverage-7.16.0-py3-none-any.whl", hash = "sha256:245f7de6d023a5bba375dbec9f2e0869bfa26ac0cc639bbb7b4c814884000b73", size = 214977, upload-time = "2026-08-28T21:54:35.189Z" },
]
[[package]]
name = "crc32c"
version = "2.9"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/b8/2a/1b7eadbd3c858204a90406a2a1e0dccd1592f69b77ec278a202fa325c50f/crc32c-2.9.tar.gz", hash = "sha256:d6d2ae0299a417e5fb2e3641838cec34a23778a62fb4ce928792366476c1983b", size = 48240, upload-time = "2026-08-21T03:57:23.412Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ac/96/a9f8506bea8d7a88ce40884bc8e0afa9ad465af5c7d68217638ec4a56b89/crc32c-2.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8828d7aaf53eff93ab5fe3507e11184be39bc719555c9fe17404df894a26fdd0", size = 66421, upload-time = "2026-08-21T03:56:07.47Z" },
{ url = "https://files.pythonhosted.org/packages/77/e5/22eee27b9f3daf741ef9eecc448d7a5b560af41a6ad37ee2ff6c2d70bb28/crc32c-2.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e79a247d2d2e574531b55a69deb2f9d48c36693ca4e95007252fab4c7c66d3b1", size = 63077, upload-time = "2026-08-21T03:56:08.355Z" },
{ url = "https://files.pythonhosted.org/packages/9f/3f/c1ea96251fcb5c0f24f573dbe5f658e0d6bc78922ac9687dff687ec60044/crc32c-2.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a2348add3f702b0a0cb035db54ee8cddb773610c9b44234a3c2465f5d3cb8079", size = 61568, upload-time = "2026-08-21T03:56:09.308Z" },
{ url = "https://files.pythonhosted.org/packages/77/2c/06173d0b1c2d3ca00b5dd1535113feea16a5ad7093691f380e95c598ff20/crc32c-2.9-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:364a6e754e228c6123c745ac38f2cb8389e9a2461c17fcbede7fedb6e3bb8641", size = 80063, upload-time = "2026-08-21T03:56:10.214Z" },
{ url = "https://files.pythonhosted.org/packages/0f/2b/8e68e794770a67ae17f5dd805f4de45145779617581fe82a6bfd4214e611/crc32c-2.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fa0ebd0d365d8cb1cd202a053b5cb8ffa07c9ecc8c38728f116b97e116cc8ec5", size = 81567, upload-time = "2026-08-21T03:56:11.09Z" },
{ url = "https://files.pythonhosted.org/packages/8f/3a/21ecf1a535d3b2a3871abb44f2c982a2802282db397a5cf0fdc92e0baeaa/crc32c-2.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:790545690c4798ff628db970f31a27aff12a79dafd8e2aaa03a34157b81879bf", size = 80642, upload-time = "2026-08-21T03:56:11.972Z" },
{ url = "https://files.pythonhosted.org/packages/f5/73/6fe35a9f4292dc1447d3ed38c0f4ac121ec73a4e9d579438b01d69a08eb7/crc32c-2.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c16d6eb17c90a6574655f3717767e4362ba01b95769155411096fde37c86274c", size = 79924, upload-time = "2026-08-21T03:56:12.88Z" },
{ url = "https://files.pythonhosted.org/packages/81/33/dbd2e2c65bf3265eed58ef087c7cdd4187c46797796571ed120ac0d32658/crc32c-2.9-cp312-cp312-win32.whl", hash = "sha256:a2669c0993b8f2a3133526b4208f78b70447200c4d87f89159f184fc2e9e2db3", size = 64407, upload-time = "2026-08-21T03:56:14.011Z" },
{ url = "https://files.pythonhosted.org/packages/3e/97/d0542d34396c935fc11017f2b1cb0b57c41aed8e6de22f53cce90748b54d/crc32c-2.9-cp312-cp312-win_amd64.whl", hash = "sha256:147adf3cce798ffae2ae737b240fb3c62fffd3579efdd8226e7af84b7ae42b26", size = 65792, upload-time = "2026-08-21T03:56:15.02Z" },
{ url = "https://files.pythonhosted.org/packages/2a/9a/eda45e85b76c419f0af313c275c8e8d566e399102f949ff1861f525fb514/crc32c-2.9-cp312-cp312-win_arm64.whl", hash = "sha256:da60a865d6592935acee05a7166058a38dce78a816b9325440bc734d8d430b33", size = 63357, upload-time = "2026-08-21T03:56:15.957Z" },
{ url = "https://files.pythonhosted.org/packages/fa/6d/d2975dc9ad6583bc841cab16fbe5a3bcc643410da75d19af5d3e1d277912/crc32c-2.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ac29290a6ecd02d7cfe0b76c372b843dda5f20f9d1b75a8d52745340aca00472", size = 66423, upload-time = "2026-08-21T03:56:16.839Z" },
{ url = "https://files.pythonhosted.org/packages/03/dc/f4b15d2188696ce28788a6e3576fda764797c81e0a527bf8b9414927fac5/crc32c-2.9-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d2f16be57f15506a27fe69aec9e277808c88e6a43a8e294ef176730bbdfbbf7d", size = 63084, upload-time = "2026-08-21T03:56:17.742Z" },
{ url = "https://files.pythonhosted.org/packages/2c/f7/c30afdb698947d932ce586b5f4998e40343a8584c58e598b614bdd2e881c/crc32c-2.9-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:17c0a207793366af63c09b1c69056c5b86a6c69446e895325e284d8de19cbb35", size = 61567, upload-time = "2026-08-21T03:56:18.642Z" },
{ url = "https://files.pythonhosted.org/packages/f5/55/fab87c4959c22220a9f6e48a571c2c4afd6b8c830d5dd99f6c8917dd65e2/crc32c-2.9-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d069246a61d0b0c3532dc69b0d17de86aaad486547b3a700865613f4b74090b7", size = 80049, upload-time = "2026-08-21T03:56:19.535Z" },
{ url = "https://files.pythonhosted.org/packages/a3/99/0078d536ccc0ce37d27e9dd0b757ebb45f3cc82410ed5e9c4527115f2b43/crc32c-2.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:14991d08980627077e7c756aa292c458def79484a743e5910e453fdcef5ab725", size = 81605, upload-time = "2026-08-21T03:56:20.405Z" },
{ url = "https://files.pythonhosted.org/packages/1e/8a/9f55e3a04b6c886f3d91734d346737813c9f8cfbd2c9593efe352376f8fe/crc32c-2.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2976ed983caeafcb36ac9a839386d080198b0a36c7b545d1b8472f4f1f03aee2", size = 80687, upload-time = "2026-08-21T03:56:21.499Z" },
{ url = "https://files.pythonhosted.org/packages/78/ce/6c6ee8d57851d322438f8b32f4cb180fc61e7444e636160a478eb2bd4920/crc32c-2.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:941eb9f57ff7d0a7f50361d329fa2b9c94a982da6b52b26f432e67103582281f", size = 79973, upload-time = "2026-08-21T03:56:22.531Z" },
{ url = "https://files.pythonhosted.org/packages/23/1e/55073bc92e5a8078051d9361cbf930075c2fa103a1679221ec0c2fa1c247/crc32c-2.9-cp313-cp313-win32.whl", hash = "sha256:9f6f8d47189e4d6516367e3ee72fb9d0c47f11ad0045802313fb5076de980348", size = 64407, upload-time = "2026-08-21T03:56:23.483Z" },
{ url = "https://files.pythonhosted.org/packages/45/70/e6634715415dfa557716b2344e4d8590a5a77eee5e899e442de0e4ff8d26/crc32c-2.9-cp313-cp313-win_amd64.whl", hash = "sha256:a51230dc5f9b8fd0564b78a8aff419b5956c78801c13454c7ad7f6ffaf2af25e", size = 65792, upload-time = "2026-08-21T03:56:24.351Z" },
{ url = "https://files.pythonhosted.org/packages/e0/b2/6166c789ebacfef08b5752996f79d1e472644e9b393ed7c87b1997686910/crc32c-2.9-cp313-cp313-win_arm64.whl", hash = "sha256:94e9646a05951c7cf0657fee48eec85bf669cbf9b7bec09eff02ae12da2e9ca7", size = 63356, upload-time = "2026-08-21T03:56:25.304Z" },
]
[[package]]
name = "enterprise-knowledge-platform"
version = "0.1.0"
source = { editable = "." }
dependencies = [
{ name = "alembic" },
{ name = "bce-python-sdk" },
{ name = "fastapi" },
{ name = "psycopg", extra = ["binary"] },
{ name = "pydantic-settings" },
@ -204,6 +248,7 @@ dev = [
[package.metadata]
requires-dist = [
{ name = "alembic", specifier = ">=1.18,<2" },
{ name = "bce-python-sdk", specifier = ">=0.9.72,<0.10" },
{ name = "fastapi", specifier = ">=0.115,<1" },
{ name = "psycopg", extras = ["binary"], specifier = ">=3.2,<4" },
{ name = "pydantic-settings", specifier = ">=2.7,<3" },
@ -639,6 +684,36 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/7c/2c/b0b2f887185d6a2ec0b3bef948cc07656d2d1a5d96fa7f2bb03f6ef06ca4/psycopg_binary-3.3.5-cp313-cp313-win_amd64.whl", hash = "sha256:ba466011569297114449df9d523438e1adeedf3e4f31ffb78e897ec3fef3076b", size = 3647313, upload-time = "2026-08-31T22:44:19.139Z" },
]
[[package]]
name = "pycryptodome"
version = "3.23.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/8e/a6/8452177684d5e906854776276ddd34eca30d1b1e15aa1ee9cefc289a33f5/pycryptodome-3.23.0.tar.gz", hash = "sha256:447700a657182d60338bab09fdb27518f8856aecd80ae4c6bdddb67ff5da44ef", size = 4921276, upload-time = "2025-05-17T17:21:45.242Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/04/5d/bdb09489b63cd34a976cc9e2a8d938114f7a53a74d3dd4f125ffa49dce82/pycryptodome-3.23.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:0011f7f00cdb74879142011f95133274741778abba114ceca229adbf8e62c3e4", size = 2495152, upload-time = "2025-05-17T17:20:20.833Z" },
{ url = "https://files.pythonhosted.org/packages/a7/ce/7840250ed4cc0039c433cd41715536f926d6e86ce84e904068eb3244b6a6/pycryptodome-3.23.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:90460fc9e088ce095f9ee8356722d4f10f86e5be06e2354230a9880b9c549aae", size = 1639348, upload-time = "2025-05-17T17:20:23.171Z" },
{ url = "https://files.pythonhosted.org/packages/ee/f0/991da24c55c1f688d6a3b5a11940567353f74590734ee4a64294834ae472/pycryptodome-3.23.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4764e64b269fc83b00f682c47443c2e6e85b18273712b98aa43bcb77f8570477", size = 2184033, upload-time = "2025-05-17T17:20:25.424Z" },
{ url = "https://files.pythonhosted.org/packages/54/16/0e11882deddf00f68b68dd4e8e442ddc30641f31afeb2bc25588124ac8de/pycryptodome-3.23.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb8f24adb74984aa0e5d07a2368ad95276cf38051fe2dc6605cbcf482e04f2a7", size = 2270142, upload-time = "2025-05-17T17:20:27.808Z" },
{ url = "https://files.pythonhosted.org/packages/d5/fc/4347fea23a3f95ffb931f383ff28b3f7b1fe868739182cb76718c0da86a1/pycryptodome-3.23.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d97618c9c6684a97ef7637ba43bdf6663a2e2e77efe0f863cce97a76af396446", size = 2309384, upload-time = "2025-05-17T17:20:30.765Z" },
{ url = "https://files.pythonhosted.org/packages/6e/d9/c5261780b69ce66d8cfab25d2797bd6e82ba0241804694cd48be41add5eb/pycryptodome-3.23.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9a53a4fe5cb075075d515797d6ce2f56772ea7e6a1e5e4b96cf78a14bac3d265", size = 2183237, upload-time = "2025-05-17T17:20:33.736Z" },
{ url = "https://files.pythonhosted.org/packages/5a/6f/3af2ffedd5cfa08c631f89452c6648c4d779e7772dfc388c77c920ca6bbf/pycryptodome-3.23.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:763d1d74f56f031788e5d307029caef067febf890cd1f8bf61183ae142f1a77b", size = 2343898, upload-time = "2025-05-17T17:20:36.086Z" },
{ url = "https://files.pythonhosted.org/packages/9a/dc/9060d807039ee5de6e2f260f72f3d70ac213993a804f5e67e0a73a56dd2f/pycryptodome-3.23.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:954af0e2bd7cea83ce72243b14e4fb518b18f0c1649b576d114973e2073b273d", size = 2269197, upload-time = "2025-05-17T17:20:38.414Z" },
{ url = "https://files.pythonhosted.org/packages/f9/34/e6c8ca177cb29dcc4967fef73f5de445912f93bd0343c9c33c8e5bf8cde8/pycryptodome-3.23.0-cp313-cp313t-win32.whl", hash = "sha256:257bb3572c63ad8ba40b89f6fc9d63a2a628e9f9708d31ee26560925ebe0210a", size = 1768600, upload-time = "2025-05-17T17:20:40.688Z" },
{ url = "https://files.pythonhosted.org/packages/e4/1d/89756b8d7ff623ad0160f4539da571d1f594d21ee6d68be130a6eccb39a4/pycryptodome-3.23.0-cp313-cp313t-win_amd64.whl", hash = "sha256:6501790c5b62a29fcb227bd6b62012181d886a767ce9ed03b303d1f22eb5c625", size = 1799740, upload-time = "2025-05-17T17:20:42.413Z" },
{ url = "https://files.pythonhosted.org/packages/5d/61/35a64f0feaea9fd07f0d91209e7be91726eb48c0f1bfc6720647194071e4/pycryptodome-3.23.0-cp313-cp313t-win_arm64.whl", hash = "sha256:9a77627a330ab23ca43b48b130e202582e91cc69619947840ea4d2d1be21eb39", size = 1703685, upload-time = "2025-05-17T17:20:44.388Z" },
{ url = "https://files.pythonhosted.org/packages/db/6c/a1f71542c969912bb0e106f64f60a56cc1f0fabecf9396f45accbe63fa68/pycryptodome-3.23.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:187058ab80b3281b1de11c2e6842a357a1f71b42cb1e15bce373f3d238135c27", size = 2495627, upload-time = "2025-05-17T17:20:47.139Z" },
{ url = "https://files.pythonhosted.org/packages/6e/4e/a066527e079fc5002390c8acdd3aca431e6ea0a50ffd7201551175b47323/pycryptodome-3.23.0-cp37-abi3-macosx_10_9_x86_64.whl", hash = "sha256:cfb5cd445280c5b0a4e6187a7ce8de5a07b5f3f897f235caa11f1f435f182843", size = 1640362, upload-time = "2025-05-17T17:20:50.392Z" },
{ url = "https://files.pythonhosted.org/packages/50/52/adaf4c8c100a8c49d2bd058e5b551f73dfd8cb89eb4911e25a0c469b6b4e/pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:67bd81fcbe34f43ad9422ee8fd4843c8e7198dd88dd3d40e6de42ee65fbe1490", size = 2182625, upload-time = "2025-05-17T17:20:52.866Z" },
{ url = "https://files.pythonhosted.org/packages/5f/e9/a09476d436d0ff1402ac3867d933c61805ec2326c6ea557aeeac3825604e/pycryptodome-3.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c8987bd3307a39bc03df5c8e0e3d8be0c4c3518b7f044b0f4c15d1aa78f52575", size = 2268954, upload-time = "2025-05-17T17:20:55.027Z" },
{ url = "https://files.pythonhosted.org/packages/f9/c5/ffe6474e0c551d54cab931918127c46d70cab8f114e0c2b5a3c071c2f484/pycryptodome-3.23.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aa0698f65e5b570426fc31b8162ed4603b0c2841cbb9088e2b01641e3065915b", size = 2308534, upload-time = "2025-05-17T17:20:57.279Z" },
{ url = "https://files.pythonhosted.org/packages/18/28/e199677fc15ecf43010f2463fde4c1a53015d1fe95fb03bca2890836603a/pycryptodome-3.23.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:53ecbafc2b55353edcebd64bf5da94a2a2cdf5090a6915bcca6eca6cc452585a", size = 2181853, upload-time = "2025-05-17T17:20:59.322Z" },
{ url = "https://files.pythonhosted.org/packages/ce/ea/4fdb09f2165ce1365c9eaefef36625583371ee514db58dc9b65d3a255c4c/pycryptodome-3.23.0-cp37-abi3-musllinux_1_2_i686.whl", hash = "sha256:156df9667ad9f2ad26255926524e1c136d6664b741547deb0a86a9acf5ea631f", size = 2342465, upload-time = "2025-05-17T17:21:03.83Z" },
{ url = "https://files.pythonhosted.org/packages/22/82/6edc3fc42fe9284aead511394bac167693fb2b0e0395b28b8bedaa07ef04/pycryptodome-3.23.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:dea827b4d55ee390dc89b2afe5927d4308a8b538ae91d9c6f7a5090f397af1aa", size = 2267414, upload-time = "2025-05-17T17:21:06.72Z" },
{ url = "https://files.pythonhosted.org/packages/59/fe/aae679b64363eb78326c7fdc9d06ec3de18bac68be4b612fc1fe8902693c/pycryptodome-3.23.0-cp37-abi3-win32.whl", hash = "sha256:507dbead45474b62b2bbe318eb1c4c8ee641077532067fec9c1aa82c31f84886", size = 1768484, upload-time = "2025-05-17T17:21:08.535Z" },
{ url = "https://files.pythonhosted.org/packages/54/2f/e97a1b8294db0daaa87012c24a7bb714147c7ade7656973fd6c736b484ff/pycryptodome-3.23.0-cp37-abi3-win_amd64.whl", hash = "sha256:c75b52aacc6c0c260f204cbdd834f76edc9fb0d8e0da9fbf8352ef58202564e2", size = 1799636, upload-time = "2025-05-17T17:21:10.393Z" },
{ url = "https://files.pythonhosted.org/packages/18/3d/f9441a0d798bf2b1e645adc3265e55706aead1255ccdad3856dbdcffec14/pycryptodome-3.23.0-cp37-abi3-win_arm64.whl", hash = "sha256:11eeeb6917903876f134b56ba11abe95c0b0fd5e3330def218083c7d98bbcb3c", size = 1703675, upload-time = "2025-05-17T17:21:13.146Z" },
]
[[package]]
name = "pydantic"
version = "2.13.5"
@ -882,6 +957,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/73/e3/7df5a396e445b9ba49ce9a9437439a4d80042c61c0ade199abf8d16de1ac/ruff-0.16.5-py3-none-win_arm64.whl", hash = "sha256:a64abe90968719b851bb7cedffaa8753fbdbdadab483089682db623f3edc587e", size = 10391564, upload-time = "2026-08-27T16:34:16.064Z" },
]
[[package]]
name = "six"
version = "1.17.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" },
]
[[package]]
name = "sqlalchemy"
version = "2.0.52"