|
certbotbot
Reference documentation for a modular Bash project
|
Resolves safe archive key templates using released mktext. More...
Functions | |
| int | certbotbot_filename_error (String message) |
| Reports an untrusted-input failure without echoing its raw value. | |
| int | certbotbot_filename_date () |
| Obtains one fully validated UTC date and its padded components. | |
| int | certbotbot_filename_render (String template) |
| Lexically renders and validates one single-component tar.gz key. | |
| int | certbotbot_filename_resolve () |
| Freezes the effective current and optionally requested backup key. | |
Variables | |
| String | CERTBOTBOT_BACKUP_KEY |
| The validated dated key, empty while backup naming is not requested. | |
Resolves safe archive key templates using released mktext.
Implements ADR-032 without interpreting user templates as shell code. S3_KEY remains strictly literal. Only an explicitly chosen current template, an explicitly provided backup template, or a future enabled dated backup requires a UTC clock lookup. One validated date is frozen for the call. The renderer receives a caller-owned associative array of nonsecret values. This module never reads, writes, enumerates, or deletes remote objects.
| int certbotbot_filename_date | ( | ) |
Obtains one fully validated UTC date and its padded components.
Calls date once, not once per token. The numeric calendar checks guard malformed or replaced date implementations, including invalid leap days. The values are shell-local, never exported or derived from archive data.
| 0 | A consistent UTC snapshot was captured. |
| 64 | Clock unavailable or date invalid. |
| int certbotbot_filename_error | ( | String | message | ) |
Reports an untrusted-input failure without echoing its raw value.
| message | Fixed nonsecret diagnostic text. |
| 64 | Invalid filename, date, or rendering configuration. |
| int certbotbot_filename_render | ( | String | template | ) |
Lexically renders and validates one single-component tar.gz key.
The template grammar is deliberately narrower than generic mktext: only uppercase exact {YEAR}, {MONTH}, and {DOM} are supported. Replacing accepted macros with safe placeholders before validating the remaining characters rejects unknown macros, brace nesting, paths, whitespace, shell-looking syntax, traversal, and leading punctuation. The final name has separate constraints: 255 ASCII bytes maximum and exact .tar.gz suffix. mktext's single substitution pass never recursively renders values.
| template | Untrusted operator-specified template. |
| 0 | One safe gzip-tar basename produced. |
| 64 | Unsafe template or unavailable/failed renderer. |
| int certbotbot_filename_resolve | ( | ) |
Freezes the effective current and optionally requested backup key.
Ordinary MVP literal keys bypass mktext and clock reads. When needed, the UTC snapshot is computed just once and reused by both templates. The current selected key is replaced before the S3 fetch; the same variable is passed to the publisher later in the invocation. Backup resolution alone never authorizes an extra PutObject.
| 0 | Filename resolution succeeded. |
| 64 | Date/template/key collision failure before S3. |
| CERTBOTBOT_BACKUP_KEY |
The validated dated key, empty while backup naming is not requested.
Bash variable: read-write string