Skip to main content

Module web

Module web 

Source
Expand description

Web channel lean-ctx cloud consent --web <id> (SPEC-ENGINE §3.8.2 “Web channel flow”, RESOLUTIONS R49, R61, R82).

  1. A pairing code (40 random bits, Crockford base32, XXXX-XXXX) lives only in this process and on the terminal.
  2. E35 POST /v1/consents carries the stored subject (canonical, so a repeat is byte-identical) and code_hash = hex(sha256(consent_id ‖ code)); a repeat replaces the code.
  3. One line on stdout names the URL, the code and the request fingerprint the consent page shows too.
  4. The engine waits up to 10 min: a consent.answered frame seen by the relay (a marker file) or E35 GET every 2 s.
  5. Only a Cloud-signed leanctx.cloud.consent.v1 statement for this request and the owner account is stored (proof = {statement}).

Structs§

WebRun
What --web needs from its surroundings; tests replace the clock and the sleep.

Enums§

Polled
An E35 GET answer.

Constants§

BROWSER_TTL_MS
The longest a browser-bound request waits (Cloud caps it at 15 min).
CODE_TTL_MS
How long a pairing code and the wait last.
POLL_EVERY

Functions§

answered_marker
The marker the relay writes for a consent.answered frame.
browser_body
The E35 create body of a request the person answers on a Cloud page opened by an app (consent_create.browser_binding.request.json): no pairing code; the page asks for the account’s second factor, or its password or a mailed link without one.
browser_interval
The poll interval Cloud names (interval_s), kept within 1–30 s.
code_hash
hex(sha256(consent_id ‖ code)), code uppercase without the dash.
create_body
The E35 create body. The subject is the stored one, so its canonical form is the same on every repeat (R82).
device_body
The E35 create body of a request bound to the device approval page (C0 2.1 consent_create.device_binding.request.json): no pairing code.
display
XXXX-XXXX.
link
The consent page with the pairing code in its fragment: the browser fills the code in, and a fragment never reaches a server or its logs.
new_code
8 Crockford characters (40 random bits), uppercase, no dash.
note_answered
Record a consent.answered frame for a waiting --web (relay side).
output_line
The stdout lines of step 3: the link to open (with the code in it) and the code itself, for a browser on another device. The request fingerprint stays on the page under “Details” and in consent list.
parse_state
withdraw_relayed
Withdraw a relayed request that no longer needs an answer (C0 2.1 DELETE /v1/consents/{id}), so no page lists it as waiting. Best effort: a Cloud without the route or without the request ignores it.