← Về thư mục
openai4s/security/secret_broker.py
- SecretBrokerError · class · L89-L90 — class SecretBrokerError(RuntimeError)
- SecretStoreUnavailable · class · L93-L94 — class SecretStoreUnavailable(SecretBrokerError)
- store_namespace · function · L97-L111 — def store_namespace(store) -> str
- make_ref · function · L114-L129 — def make_ref(scope: str, name: str, namespace: str | None = None) -> str
- is_ref · function · L132-L133 — def is_ref(value: object) -> bool
- parse_ref · function · L136-L158 — def parse_ref(ref: str) -> tuple[int, str | None, str, str]
- split_ref · function · L161-L163 — def split_ref(ref: str) -> tuple[str, str]
- _sanitize_namespace · function · L166-L170 — def _sanitize_namespace(namespace: str) -> str
- _sanitize · function · L173-L187 — def _sanitize(part: str, label: str) -> str
- _validate_secret · function · L190-L197 — def _validate_secret(secret: str) -> str
- _Backend · class · L205-L222 — class _Backend
- available · method · L212-L213 — def available(self) -> bool
- put · method · L215-L216 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None
- get · method · L218-L219 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L221-L222 — def delete(self, namespace: str, scope: str, name: str) -> None
- _run · function · L225-L247 — def _run( argv: list[str], stdin: str | None = None, *, detach_from_tty: bool = False, ) -> subprocess.CompletedProcess
- KeychainBackend · class · L250-L318 — class KeychainBackend(_Backend)
- available · method · L257-L258 — def available(self) -> bool
- _account · method · L260-L263 — def _account(self, namespace: str, scope: str, name: str) -> str
- put · method · L265-L289 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None: # -w LAST and the value on stdin.
security prompts twice (enter + # confirm), hence the doubled line. Putting it in argv instead would # publish it to ps.
- get · method · L291-L306 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L308-L318 — def delete(self, namespace: str, scope: str, name: str) -> None
- SecretServiceBackend · class · L321-L392 — class SecretServiceBackend(_Backend)
- available · method · L328-L336 — def available(self) -> bool
- _attributes · method · L339-L353 — def _attributes(namespace: str, scope: str, name: str) -> list[str]
- put · method · L355-L370 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None
- get · method · L372-L383 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L385-L392 — def delete(self, namespace: str, scope: str, name: str) -> None
- EnvInjectionBackend · class · L395-L478 — class EnvInjectionBackend(_Backend)
- var_name · method · L429-L436 — def var_name(scope: str, name: str) -> str
- namespaced_var_name · method · L439-L443 — def namespaced_var_name(namespace: str, scope: str, name: str) -> str
- available · method · L445-L453 — def available(self) -> bool
- put · method · L455-L462 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None
- get · method · L464-L474 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L476-L478 — def delete(self, namespace: str, scope: str, name: str) -> None: # Nothing of ours to remove; the operator owns the variable.
- PlaintextBackend · class · L481-L513 — class PlaintextBackend(_Backend)
- init · method · L494-L495 — def init(self, store) -> None
- available · method · L497-L498 — def available(self) -> bool
- _key · method · L500-L503 — def _key(self, namespace: str, scope: str, name: str) -> str
- put · method · L505-L506 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None
- get · method · L508-L510 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L512-L513 — def delete(self, namespace: str, scope: str, name: str) -> None
- MemoryBackend · class · L516-L537 — class MemoryBackend(_Backend)
- init · method · L524-L525 — def init(self) -> None
- available · method · L527-L528 — def available(self) -> bool
- put · method · L530-L531 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None
- get · method · L533-L534 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L536-L537 — def delete(self, namespace: str, scope: str, name: str) -> None
- _mode · function · L545-L553 — def _mode(value: str | None = None) -> str
- WindowsDPAPIBackend · class · L556-L597 — class WindowsDPAPIBackend(_Backend)
- available · method · L563-L577 — def available(self) -> bool: # Probe what
request actually needs, not just the interpreter: a # distribution that ships no machine-id would otherwise be reported # available and then fail on first use, which is the failure mode # _self_test exists to move forward in time.
- _request · method · L579-L588 — def _request(self, action, namespace, scope, name, value=None)
- put · method · L590-L591 — def put(self, namespace: str, scope: str, name: str, secret: str) -> None
- get · method · L593-L594 — def get(self, namespace: str, scope: str, name: str) -> str | None
- delete · method · L596-L597 — def delete(self, namespace: str, scope: str, name: str) -> None
- _system_backends · function · L600-L611 — def _system_backends() -> list[_Backend]: # Ordered by preference. A desktop keychain is interactive and durable; env # injection is what a server deployment actually has. Plaintext is never in # this list —
auto must not reach it by falling off the end.
- SecretBroker · class · L614-L804 — class SecretBroker
- init · method · L617-L629 — def init( self, store=None, *, mode: str | None = None, backends: list[_Backend] | None = None, ) -> None
- _resolve · method · L631-L677 — def _resolve(self, backends: list[_Backend] | None) -> _Backend
- _self_test · method · L680-L702 — def _self_test(backend: _Backend) -> tuple[bool, str]
- put · method · L705-L714 — def put(self, scope: str, name: str, secret: str) -> str
- get · method · L716-L731 — def get(self, ref: str) -> str | None
- delete · method · L733-L744 — def delete(self, ref: str) -> None
- read_only · method · L747-L756 — def read_only(self) -> bool
- namespace · method · L759-L768 — def namespace(self) -> str | None
- describe · method · L770-L781 — def describe(self, ref: str) -> dict
- ref_requires_reentry · method · L783-L791 — def ref_requires_reentry(self, ref: str) -> bool
- posture · method · L796-L804 — def posture(self) -> dict
- _warn_degraded · function · L810-L814 — def _warn_degraded(message: str) -> None