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#

Shell
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).