chore(oss): audit the server package and resync the SDK mirrors
Split the 657-line operation service into eor, submit, and verify modules, add the AGENT_REVOKED and KEY_RETIRED codes the Backend already emits, and condense every multi-line comment. Mirror Node, Python, and Go at 2.1.0 with the deep-health 503, non-idempotent retry, rotation grace, and path-encoding fixes. Document which routes and response fields the self-hosted server does not provide. Claude-Session: https://claude.ai/code/session_01Agoc9bRVE9KL7mmWtey9Vq
This commit is contained in:
1 parent
2010175a82
commit
bc6983a62e
364 files changed
+10180
-23349
No files matched your search
@@ -0,0 +1,42 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
from elydora.plugins import _transaction
|
||||
|
||||
|
||||
def write_source(path: Path, source: str) -> None:
|
||||
path.write_bytes(source.encode("utf-8"))
|
||||
|
||||
|
||||
def make_change(
|
||||
path: Path,
|
||||
original: str | None,
|
||||
next_source: str | None,
|
||||
mode: int = 0o600,
|
||||
enforce_mode: bool = False,
|
||||
) -> _transaction.FileChange:
|
||||
change = _transaction.source_change(
|
||||
str(path),
|
||||
path.name,
|
||||
original,
|
||||
next_source,
|
||||
mode,
|
||||
enforce_mode=enforce_mode,
|
||||
)
|
||||
assert change is not None
|
||||
return change
|
||||
|
||||
|
||||
def transaction_subprocess_environment(home: Path) -> dict[str, str]:
|
||||
environment = os.environ.copy()
|
||||
environment["HOME"] = str(home)
|
||||
environment["USERPROFILE"] = str(home)
|
||||
return environment
|
||||
|
||||
|
||||
def swap_directory(parent: Path, backup: Path, redirected: Path) -> None:
|
||||
parent.rename(backup)
|
||||
redirected.rename(parent)
|
||||
Reference in new issue
Block a user