Expand description
f3129 app keys S2+S3: binding the app’s no-prompt signing keys to an
instance inside the device flow (docs/contracts/app-key-bind-v1.md).
- S2,
POST /v1/device/code: the engine announces the keys (AppKeyAnnouncementV1,app_keys) only to a Cloud whose code answer listsFEATURE_DEVICE_APP_KEYS. The approval page names each key with its fingerprint (key_id) before the person allows the connection. - S3,
POST /v1/device/token: the instance key signsapp_key_bind_signing_input(app_keys_bind_signature) over the one-timedevice_code, its own public key and the announced keys. The offered keys (chat_key,task_propose_key,optin_key) must equal the announced set.
Every signature here is verified strictly (verify_strict: canonical
64-byte signature, no small-order key or R).
Encoding (unlike the crate-wide standard base64): app public keys and all
signatures here are base64url without padding; key_id is
hex(sha256(raw public key))[..16]; instance_public_key enters every
statement exactly as the token request carries it (standard base64).
Structs§
- AppKey
Announcement V1 - One entry of
DeviceCodeRequestV1.app_keys(S2). - AppKey
Offer V1 chat_key/task_propose_key/optin_keyof the device-token request.
Enums§
- AppKey
Kind - Which app key. Ordered by wire name, the order the lists are sorted in.
Constants§
- APP_
KEY_ ALG - The one algorithm of an app key.
- APP_
KEY_ BIND_ DOMAIN - Domain of the instance key’s bind signature (S3).
- APP_
KEY_ ERROR_ CODE - Error
codeof every app-key refusal (HTTP 400). - APP_
KEY_ ID_ LEN - Length of
key_idin hex characters. - FEATURE_
DEVICE_ APP_ KEYS DeviceCodeV1.featuresentry of a Cloud that takesapp_keys(S2) andapp_keys_bind_signature(S3). Without it the engine announces, offers and binds no app key.- MAX_
APP_ KEYS - At most one key per kind.
- PAIRING_
FAILED_ TEXT - What the engine and the app show for either reason.
- REASON_
APP_ KEY_ BIND_ INVALID reason:app_keys_bind_signatureis missing or does not verify.- REASON_
APP_ KEY_ NOT_ ANNOUNCED reason: the offered keys are not exactly the announced ones.
Functions§
- app_
key_ bind_ signing_ input - The bytes the instance key signs for S3 (
app_keys_bind_signature):APP_KEY_BIND_DOMAIN‖ canonical_json({device_code_sha256, instance_public_key, keys: [{alg, kind, key_id, public_key}] sorted by kind}).keysare the announced keys; the caller validated them. - app_
key_ bind_ statement - The JSON value under
app_key_bind_signing_input. - app_
key_ id hex(sha256(public key bytes))[..16].- app_
key_ offer_ bind_ input - The bytes an app key signs for its own offer (
bind_signature): the kind’s bind domain ‖ canonical_json({alg, instance_public_key, key_id, public_key, scope}), as !622/!627/!628 define them. - app_
key_ refusal_ text - The text the engine shows for an app-key refusal,
Nonefor any otherreason. - decode_
b64url_ exact - Decode canonical base64url without padding of exactly
lenbytes. - offered_
equals_ announced - Announced-set equality (check 4 of the Cloud’s order): every announced
key is offered with identical
alg,key_idandpublic_key, nothing else is offered, and no kind is offered twice.Errnames the first differing (or repeated) request member; the Cloud answers 400invalid_field, reasonREASON_APP_KEY_NOT_ANNOUNCED, with thatfield. - validate_
app_ keys DeviceCodeRequestV1.app_keys: each entry valid, sorted by kind, at most one per kind (so at mostMAX_APP_KEYS). The Cloud answers any failure with 400invalid_field,field: "app_keys".