flayer.guest¶
flayer.guest ¶
Strict host-pinned SSH transport for private VPN installation and service observations.
GuestResult
dataclass
¶
GuestResult(return_code: int, stdout: bytes = b'', stderr: bytes = b'')
Transient subprocess output excluded from object representations and error messages.
GuestRunner ¶
Bases: Protocol
Injectable subprocess boundary for deterministic tests without SSH connections.
Run ¶
Run(command: tuple[str, ...], payload: bytes, timeout: float) -> GuestResult
Run a bounded argument vector with private standard input and captured output.
Source code in installed/flayer/guest.py
36 37 38 39 | |
SubprocessGuestRunner ¶
Execute OpenSSH without a local shell or inherited standard input.
Run ¶
Run(command: tuple[str, ...], payload: bytes, timeout: float) -> GuestResult
Keep any guest or SSH diagnostic text out of user-visible exception messages.
Source code in installed/flayer/guest.py
45 46 47 48 49 50 51 52 53 54 55 56 | |
SshGuestProvisioner ¶
SshGuestProvisioner(endpoint: VpnEndpoint, username: str, identity_file: Path, known_hosts_file: Path, runner: GuestRunner | None = None)
Connect only to an explicit IPv4 endpoint using an independently pinned Ed25519 host key.
Validate private key/trust paths before constructing any SSH argument vector.
Source code in installed/flayer/guest.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
command
instance-attribute
¶
command = ('ssh', '-F', '/dev/null', '-T', '-p', str(endpoint.port), '-i', str(identity_file), '-o', 'BatchMode=yes', '-o', 'IdentityAgent=none', '-o', 'IdentitiesOnly=yes', '-o', 'StrictHostKeyChecking=yes', '-o', 'GlobalKnownHostsFile=/dev/null', '-o', f'UserKnownHostsFile="{known_hosts_file}"', '-o', 'UpdateHostKeys=no', '-o', 'VerifyHostKeyDNS=no', '-o', 'HostKeyAlgorithms=ssh-ed25519', '-o', 'ConnectTimeout=15', '-o', 'ConnectionAttempts=1', '-o', 'ServerAliveInterval=15', '-o', 'ServerAliveCountMax=3', '-o', 'ControlMaster=no', '-o', 'ClearAllForwardings=yes', '-o', 'PermitLocalCommand=no', '-o', 'ProxyCommand=none', '-o', 'ProxyJump=none', f'{username}@{endpoint.host}')
Install ¶
Install(bundles: tuple[tuple[str, ArtifactBundle], ...]) -> None
Stage only validated sensitive server files on the trusted guest and run installers.
Source code in installed/flayer/guest.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
ServiceStatus ¶
ServiceStatus(services: tuple[str, ...]) -> tuple[tuple[str, bool], ...]
Observe service activity without claiming client connectivity or performing guest writes.
Source code in installed/flayer/guest.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | |
ValidateSshPathSyntax ¶
ValidateSshPathSyntax(path: Path) -> None
Reject OpenSSH substitutions before authorizing any project or guest operation.
Source code in installed/flayer/guest.py
59 60 61 62 63 | |
PrivatePath ¶
PrivatePath(path: Path, *, directory: bool = False) -> Path
Require caller-owned private POSIX objects without symlinks or hardlinked files.
Source code in installed/flayer/guest.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
ReadPrivate ¶
ReadPrivate(path: Path, *, limit: int = 65536) -> bytes
Read one bounded private file and detect replacements or in-place edits during the read.
Source code in installed/flayer/guest.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
WritePrivate ¶
WritePrivate(path: Path, content: bytes) -> None
Create a private project file exclusively without overwriting an existing object.
Source code in installed/flayer/guest.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |