CLI command
skarbiec bindings check
Find the line of a committed bindings file that would leave a program without its credential — an item renamed, trashed or reshaped since — before exec, a deploy or ci set runs into it.
Invocation#
skarbiec bindings check <file> [--refuse]Purpose#
Find the line of a committed bindings file that would leave a program without its credential — an item renamed, trashed or reshaped since — before exec, a deploy or ci set runs into it.
Required inputs and options#
- A bindings file as exec --env-from reads it, NAME=<id>:<field> a line, relative to the working directory; --refuse makes a failing line an error. POST /v1/operator/bindings/check takes file, an absolute path on the machine the vault runs on, and an optional refuse.
Output and state effects#
- Reads every line, then for each says whether the item is live, opens here and holds text in that field. It prints ok, file and bindings — each with variable, item, field and ok, and when ok is false the problem: in the trash with restore as the step, no such item as it may have been renamed or purged, a field the item does not hold or holds empty, or the error opening it gave. It journals bindings-checked with the file and the failing variables; no value is printed.
Refusals#
- A flag other than --refuse exits 2 before the file is read (arguments-flag-unknown): a mistyped --refuse used to let a failing line pass. Anything but check and one file exits 2 with the usage. A file that cannot be read, holds no binding, or holds a line that is not NAME=<id>:<field> is refused quoting the line, as exec refuses it. With --refuse, a failing line exits non-zero naming each failing variable and its problem.
- skarbiec.bindings bindings-failing — exit 1: checking the bindings in {file}; fix: point each failing line at a live item's text field, or restore the item (skarbiec restore <id>)
- skarbiec.bindings bindings-unknown — exit 1: forgetting the bindings file {file}; fix: skarbiec bindings list names those it does
- skarbiec.bindings bindings-store-damaged — exit 1: {doing} the known bindings files in {store}; fix: make {store} a JSON list of file paths again, or remove it and remember each file anew
Examples#
skarbiec bindings check .skarbiec-env skarbiec bindings check deploy/bindings --refuse