CLI command
skarbiec request approve
Approve a pending request, stating how long what it grants lives and, for a capability, how many times it may be used.
Invocation#
skarbiec request approve <request-id> --by <uid> (--ttl-seconds <N> | --until-revoked) [--uses <N>]Purpose#
Approve a pending request, stating how long what it grants lives and, for a capability, how many times it may be used.
Required inputs and options#
- The request id; --by, the deciding recipient, who must have role owner or admin and whose secret key must be in this host's key file; exactly one lifetime; --uses for a bounded capability, at most what the request asked. POST /v1/operator/requests/approve takes id, by, ttl-seconds, until-revoked and uses.
Output and state effects#
- Records the decision and journals access-approved. A capability is issued with the request id as its authorization id, a standing grant's bearer is written to an owner-only file named in the answer. A dual-control request is granted only once two different deciders approved it, within the narrower of their lifetimes and the fewest uses. Prints ok, request_id, state, status (granted or awaiting-second-decider) and issued.
Refusals#
- A flag other than --by, --ttl-seconds, --until-revoked and --uses exits 2 (arguments-flag-unknown). No --by exits 2 with `request approve needs --by <uid>, naming who decides`; no lifetime, both lifetimes or one that is not whole seconds are lifetime-missing, -twice and -unfit, the causes and words grant issue and grant register refuse with; a capability without --uses, approved until revoked or with zero uses is request-uses-missing, request-capability-forever and request-uses-zero; --uses on a standing grant is request-uses-uncounted. Refused with nothing issued: an id the register does not hold (request-unknown), a request no longer pending (request-not-pending), a decider who is not an owner or admin recipient (request-not-a-decider) or whose key is not here (request-decider-key-absent), a second decision by the same decider (request-already-decided), a consumer that already holds a grant (request-consumer-held), and a recorded lifetime of another shape (request-lifetime-recorded).
- skarbiec.request.register request-register-not-json — exit 1: reading the access request register {path}; fix: restore {path} from a backup taken before the damage, or move it aside and file the open requests again; it is a JSON object holding a requests list
- skarbiec.request.register request-register-damaged — exit 1: reading the access request register {path}; fix: restore {path} from a backup taken before the damage, or move it aside and file the open requests again; it is a JSON object holding a requests list
- skarbiec.request.register request-record-damaged — exit 1: reading access request {id} from the register {path}; fix: remove the record {id} from {path} and file the request again; skarbiec request list shows the others
- skarbiec.request.register request-record-field-unreadable — exit 1: reading access request {id} from the register {path}; fix: remove the record {id} from {path} and file the request again; skarbiec request list shows the others
- skarbiec.request.register request-recipient-damaged — exit 1: reading {by}'s recipient record to decide access request {id}; fix: restore {by}'s recipient record from a backup taken before the damage; skarbiec recipient list shows the record and skarbiec doctor names what else is wrong
- skarbiec.request.register request-id-unavailable — exit 69: drawing a request id from /dev/urandom; fix: file the request again; if it fails again, the operating system's random source is broken and skarbiec doctor on this host says what else is
- skarbiec.request.register request-grant-unanswered — exit 1: issuing the {form} grant access request {id} names; fix: deny the request with skarbiec request deny {id} --by <uid> and issue the grant with skarbiec grant {leaf}