Skip to main content

Module task_key

Module task_key 

Source
Expand description

The app’s task-propose key (rc4-67): an Ed25519 key that lives only in LeanCTX Code and signs the person’s own task proposals (leanctx.cloud.task_propose_person.v1).

  • The engine never holds the private half and never signs with it: it keeps the public key (TASK_KEY_FILE, public part only), prepares the exact bytes the app signs (person_task_signing_input) and checks the signature the app made before it relays it.
  • Scope task_propose_person.v1 only: never a consent action, a chat post or anything else (the Cloud verifies it against this key only).
  • The app binds the key at pairing: the device-token request carries TaskKeyOffer (task_propose_key) with bind_signature, made by the task-propose key itself over bind_statement (proof of possession).
  • Encoding: base64url without padding for the key and signatures; key_id = hex(sha256(public key))[..16]; instance_public_key is exactly the string the device-token request sends (standard base64).

Structs§

BoundTaskKey
The bound task-propose key, public part only.
TaskKeyOffer
task_propose_key of the device-token request, as the app hands it over (lean-ctx cloud connect --json --task-propose-key -, stdin).

Constants§

ALG
The one algorithm.
BIND_DOMAIN
Domain of the bind statement.
PERSON_TASK_DOMAIN
Domain of a person’s signed task proposal.
REQUEST_MEMBER
The device-token request member.
SCOPE
The one scope a task-propose key is bound for.
TASK_KEY_FILE
The bound task-propose key’s public part, in the Cloud config directory.

Functions§

bind_statement
The bytes the task-propose key signs to bind itself: BIND_DOMAIN ‖ canonical_json({alg, instance_public_key, key_id, public_key, scope}).
bound_task_key
The bound task-propose key, when its file is consistent.
canonical_person_ids
(instance_id, vault_id) as the Cloud checks a person’s proposal against them: the dashed lowercase UUID of the instance (cloud v2 ids are always UUIDs) and the vault’s 32 lowercase hex. None when either is no such id, inst_ forms of old enrollments included: a signature over another spelling would be refused as unproven.
key_id_of
hex(sha256(public key bytes))[..16].
person_task_signing_input
The bytes the app signs for a person’s proposal request (sent as POST /v1/vaults/{vault_id}/tasks): PERSON_TASK_DOMAIN ‖ canonical_json(the body without task_signature, plus instance_id and vault_id).
remove_bound
Forget the bound task-propose key (a pairing without one).
store_bound
Keep the public part of offer as this machine’s task-propose key.