CLI command
skarbiec subscription refuse
Record that the provider refused the grant a subscription holds now, which makes the grant due a sign-in.
Invocation#
skarbiec subscription refuse <item-id> --reason <the provider's words>Purpose#
Record that the provider refused the grant a subscription holds now, which makes the grant due a sign-in.
Required inputs and options#
- One subscription item and --reason, the provider's own answer. A consumer that met the refusal sends it as POST /v1/subscriptions/refused with provider, subscription_id and reason (the subscription as its brama:provider: and brama:id: tags name it) and the capability report:subscriptions, which covers every subscription item as it is created; the operator route POST /v1/operator/subscriptions/refuse takes item and reason.
Output and state effects#
- Writes refused (at, reason, by, revision) on the subscription's record in the vault document, journals subscription-refused and prints the subscription as list shows it with recorded new, or unchanged when the same reason was already recorded against the same revision: a refusal restated keeps the moment it was first recorded, so it buys no second sign-in. The refusal applies to the grant the item holds now; once a sign-in writes a new revision it no longer applies.
Refusals#
- No item, or more than one, exits 2 (item-argument); no --reason exits 2 (reason-missing). An item that is not a live subscription is refused naming the subscriptions (not-subscription). On a replica the write is refused naming the source. Over HTTP: a consumer without report:subscriptions is 403 (report-not-granted); a body without provider, subscription_id or reason is 400 naming it; a grant_sha256 that is not 64 hexadecimal digits is 400 (report-grant-malformed); no item carrying them is 404 (report-unknown); two items carrying them is 409 naming both (report-ambiguous); a grant_sha256 naming another grant than the item holds is 409 (report-stale), recording nothing, since a sign-in already replaced the refused grant. A grant issued with report:<anything but subscriptions> is refused at grant issue naming report:subscriptions.
- skarbiec.subscription form-unknown — exit 2: reading what skarbiec subscription is asked; fix: run subscription list, refuse, withdraw or run; skarbiec subscription help lists them
- skarbiec.subscription flag-unknown — exit 2: reading the flags of subscription {verb}; fix: drop --{flag}; subscription {verb} takes {takes}
- skarbiec.subscription item-argument — exit 2: reading which subscription subscription {verb} acts on; fix: name one item `skarbiec subscription list` shows: skarbiec subscription {verb} <item-id> …
- skarbiec.subscription reason-missing — exit 2: recording that the provider refused the grant of {item}; fix: pass the provider's answer: skarbiec subscription refuse {item} --reason '<what the provider said>'
- skarbiec.subscription now-without-item — exit 2: signing one subscription in before it is due; fix: name it: skarbiec subscription run --item <item-id> --now
- skarbiec.subscription not-subscription — exit 1: reading the subscription {item}; fix: name an item `skarbiec subscription list` shows; a subscription is a live item tagged brama:subscription
- skarbiec.subscription section-malformed — exit 1: reading the vault's subscription sign-in records; fix: run skarbiec upgrade to see what it can read; withdraw each damaged record with subscription withdraw, which writes it again
- skarbiec.subscription no-refusal — exit 1: withdrawing the recorded refusal of {item}; fix: name an item whose grant `skarbiec subscription list` shows as refused
- skarbiec.subscription unsignable — exit 1: signing the subscription {item} in; fix: tag {item} with exactly one brama:provider:<provider>, brama:id:<subscription id> and brama:login:<login item> (skarbiec retag --add <tag> {item}), naming a login item that exists and opens here, whose recorded second factor the vault can answer (skarbiec login factor list <login item> names what it lacks; skarbiec totp set adds a seed), then run skarbiec subscription run --item {item} --now
- skarbiec.subscription grant-unreadable — exit 69: reading the stored grant of the subscription {item}; fix: open it by hand (skarbiec get {item}) and repair what that names; skarbiec doctor names a missing key
- skarbiec.subscription stado-absent — exit 1: asking Stado's browser-automation family to sign {item} in; fix: install Stado (it puts stado on PATH), or point STADO_BIN at the installed stado
- skarbiec.subscription stado-unstarted — exit 69: asking Stado's browser-automation family to sign {item} in; fix: make {program} an executable Stado ({program} --version answers when it is), or point STADO_BIN at one
- skarbiec.subscription stado-answer-unreadable — exit 1: reading what Stado answered for the sign-in of {item}; fix: run the command above by hand and repair what it says; a Stado older than the browser-automation operation subscription-sign-in is updated with stado product update stado
- skarbiec.subscription sign-in-unavailable — exit 69: signing the subscription {item} ({provider} {subscription}) in; fix: {remedy}; the next skarbiec maintain or skarbiec subscription run asks again
- skarbiec.subscription sign-in-refused — exit 1: signing the subscription {item} ({provider} {subscription}) in; fix: {remedy}; then skarbiec subscription run --item {item} --now
- skarbiec.subscription sign-in-unconfirmed — exit 1: confirming the sign-in of the subscription {item}; fix: read the run Weles names (weles runs show <run>), repair why its grant did not reach {item}, then skarbiec subscription run --item {item} --now
- skarbiec.subscription run-refused — exit 1: signing the due subscriptions in; fix: read each subscription's last_error with skarbiec subscription list and act on it; the other due sign-ins ran
- skarbiec.subscription report-unknown — exit 1: finding the subscription {subscription} of {provider} a consumer named; fix: send the provider and subscription id the subscription item's own tags carry (skarbiec subscription list names both)
- skarbiec.subscription report-ambiguous — exit 1: finding the subscription {subscription} of {provider} a consumer named; fix: keep the id on one item: skarbiec retag --remove brama:id:{subscription} <item> on each other one
- skarbiec.subscription report-not-granted — exit 1: answering {route} for {consumer}; fix: add report:subscriptions to {consumer}'s grant on the vault owner (skarbiec grant list shows its capabilities; Brama's launcher issues it to brama-subscription-reporter at each start), then present that grant's bearer
- skarbiec.subscription report-stale — exit 1: recording that the provider refused the grant of subscription {item}, as {by} reported it; fix: read the grant {item} holds now and present it; report a refusal of that grant if the provider refuses it too
- skarbiec.subscription report-grant-malformed — exit 2: reading which grant {consumer} reports refused; fix: send the SHA-256 of the grant's JSON with its object members in name order and no whitespace, as 64 hexadecimal digits, or leave grant_sha256 out