jmcore.secure_files
jmcore.secure_files
Private directory and atomic secret-file utilities.
Functions:
atomic_write_private(path: Path, data: bytes) -> None
Atomically write bytes without exposing a permissively-mode temporary file.
Source code in jmcore/src/jmcore/secure_files.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
ensure_private_directory(path: Path) -> None
Create or tighten a secret-bearing directory to owner-only access.
Source code in jmcore/src/jmcore/secure_files.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
ensure_private_file(path: Path) -> None
Tighten an existing regular secret file to owner-only access.
Source code in jmcore/src/jmcore/secure_files.py
74 75 76 77 | |
read_private_file(path: Path) -> bytes
Read and tighten a regular secret file through one no-follow descriptor.
Source code in jmcore/src/jmcore/secure_files.py
80 81 82 83 84 | |