Add Technical_Decomp_Cache
parent
9a6ba651c5
commit
b900873405
1 changed files with 25 additions and 0 deletions
25
Technical_Decomp_Cache.md
Normal file
25
Technical_Decomp_Cache.md
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
## enroll/cache.py
|
||||||
|
|
||||||
|
### HarvestCache (frozen dataclass)
|
||||||
|
|
||||||
|
Purpose: a small wrapper around a directory path representing a locally stored harvest bundle.
|
||||||
|
|
||||||
|
#### Field:
|
||||||
|
|
||||||
|
dir: Path: the bundle directory.
|
||||||
|
|
||||||
|
#### Property:
|
||||||
|
|
||||||
|
state_json -> Path: returns dir / "state.json".
|
||||||
|
|
||||||
|
#### Lifecycle / where it’s used:
|
||||||
|
|
||||||
|
Created by `new_harvest_cache_dir(hint=...)` when the CLI wants a safe default output location (especially for SOPS encrypted outputs).
|
||||||
|
|
||||||
|
It’s a "typed return value" so callers don’t pass raw strings around.
|
||||||
|
|
||||||
|
#### Security behavior around it:
|
||||||
|
|
||||||
|
`new_harvest_cache_dir()` builds a directory under `~/.local/cache/enroll/harvest` (or `$XDG_CACHE_HOME/enroll/harvest`).
|
||||||
|
|
||||||
|
Uses mkdtemp() to avoid predictable paths and forces 0700 permissions (best-effort).
|
||||||
Loading…
Add table
Add a link
Reference in a new issue