|
certbotbot
Reference documentation for a modular Bash project
|
Accepted
The first-party AWS S3 adapter reads exactly the operator-selected bucket and object key using AWS CLI v2. A successful read stages bytes in a new, private workspace owned by the caller. The adapter never extracts the archive, runs Certbot, creates buckets or objects, or performs remote writes. Its return code distinguishes a confirmed missing object from unavailable state and a failed/incomplete download.
The adapter makes s3api head-object then s3api get-object requests. A 404 from HeadObject is not sufficient to prove the selected key is missing, because access controls and bucket state can affect error responses. A 404 must be corroborated by a successful s3api head-bucket call. Only this combination is reported as a missing seeded object; it is still a fatal prerequisite failure, not permission to create a new archive. Any other failure, including 403, expired credentials, missing CLI, bucket uncertainty, transport errors, or incompatible AWS output, fails closed.
MVP #8 requires the entire certificate/account archive to exist in S3 before execution. An account-only archive is valid; an absent object is not. One configured key defaults to latest.tar.gz. The application will eventually restore the downloaded bytes under an isolated Certbot config directory and validate them before issue, renewal, or publication.
The selected directory must have restrictive permissions; temporary outputs and captured AWS error messages must not be printed. AWS CLI receives its normal credential and region configuration rather than an invented credential parameter. The externally supplied AWS CLI executable is part of the trusted computing base and must be installed separately; it is not downloaded during make build.
Treat any HeadObject 404 as definitive absence: rejected because it can also describe missing buckets and cannot validate prerequisites.
Treat 403 as a missing key: rejected: S3 may return 403 rather than 404 when the caller lacks ListBucket. An access failure must never authorize fresh issuance.
Use a high-level recursive S3 copy or prefix discovery: rejected; the MVP operates on exactly one selected object and must not infer a key.
Use stdout as the downloaded archive: rejected; binary sensitive material and AWS diagnostics would cross the CLI output boundary.
Use local /etc/letsencrypt as a fallback: rejected under ADR-020; the state must be portable across independent runners.
Introduce a Python runtime or implement tar validation in this adapter: rejected; extraction is a distinct security-sensitive gate with its own approved technical tasks and review surface.
| Stage | Failure | Permitted remote write | Outcome |
|---|---|---|---|
| Local validation | Invalid workspace/args or missing CLI | None | Nonzero |
| HeadObject | 403, 400, timeout, unknown | None | Unavailable |
| HeadObject | 404 and HeadBucket succeeds | None | Missing object |
| HeadObject | 404 and HeadBucket fails | None | Unavailable |
| GetObject | Failure or zero bytes | None | Read failure |
| Staging | Local move fails | None | Read failure |
| Archive validation (later) | Invalid archive/account | None | Abort |
All error messages issued by the adapter are fixed, non-secret text. Captured external diagnostics are deleted before return. The local workspace must be cleaned by its owner after the read/restore sequence; this adapter does not remove a workspace that it did not create.
The S3 read interface is independently testable using an executable AWS CLI mock without access to cloud services. Its insertion into the public certificate lifecycle follows after safe archive validation, isolated workspace setup, and account checks are implemented under #29, #34, #36, and #37. A successful adapter read is intentionally not interpreted as successful issuance.
ADR-020 fixes the one-archive existing-account requirement and rejects automatic account creation. ADR-015 and ADR-016 govern dependency and network authority, ADR-008 governs documentation/test sequencing, and ADR-019 governs technical-task approval.