← Về thư mục
openai4s/orchestration/bootstrap.py
- BootstrapError · class · L73-L74 — class BootstrapError(RuntimeError)
- _strict_fsync_dir · function · L77-L98 — def _strict_fsync_dir(directory: Path) -> None
- load_or_mint_secret · function · L101-L155 — def load_or_mint_secret(data_dir: Path | str) -> bytes
- _read_secret · function · L158-L163 — def _read_secret(path: Path) -> bytes | None
- BootstrapCredential · class · L167-L202 — class BootstrapCredential
- payload · method · L177-L184 — def payload(self) -> dict[str, Any]
- to_json · method · L186-L187 — def to_json(self) -> str
- from_json · method · L190-L202 — def from_json(text: str) -> BootstrapCredential
- _sign · function · L205-L210 — def _sign(secret: bytes, payload: dict[str, Any]) -> str: # sort_keys so the signed bytes do not depend on dict ordering: a # signature that verifies only when the fields happen to be in the same # order is a signature that fails in production and passes in tests.
- BootstrapAuthority · class · L213-L483 — class BootstrapAuthority
- init · method · L216-L247 — def init( self, secret: bytes, *, clock=time.time, state_path: Path | str | None = None, ) -> None
- _load_state · method · L251-L295 — def _load_state(self) -> None
- _save_state · method · L297-L374 — def _save_state( self, *, consumed_expiry: dict[str, float], current_epoch: dict[str, int], ) -> dict[str, float]
- issue · method · L376-L408 — def issue( self, *, allocation_id: str, epoch: int, rank: int = 0, ttl_s: int = DEFAULT_TTL_S, ) -> BootstrapCredential
- verify · method · L410-L431 — def verify(self, credential: BootstrapCredential) -> None
- consume · method · L433-L468 — def consume(self, credential: BootstrapCredential) -> None
- fence_epoch · method · L470-L483 — def fence_epoch(self, allocation_id: str, epoch: int) -> None
- _validated_state · function · L486-L527 — def _validated_state(data: object) -> tuple[dict[str, float], dict[str, int]]
- write_credential_file · function · L530-L552 — def write_credential_file( credential: BootstrapCredential, directory: Path | str ) -> Path
- read_credential_file · function · L555-L558 — def read_credential_file(path: Path | str) -> BootstrapCredential