A RunQueue that encrypts the inputs inner stores, with keys from keys (#2449): the companion of EncryptingCheckpointer for a store's queue, which is a separate SPI and so is not covered by wrapping the checkpointer. Give it to every RunSubmitter and AgentWorker in place of the store's queue.
'''What is encrypted''': a Start input and each answer of a Resume, under the key of the submission's tenant, bound to the tenant, the thread, the agent and - for an answer - its interrupt. The store issues an entry's id as it inserts it, so an input is not bound to its entry: someone who can write to the database can exchange the inputs of two entries of one thread, tenant and agent, and nothing else.
'''What stays in plain''': everything the queue orders, leases, scopes and reports by - entry, thread, agent, tenant and run ids, the submission key, the policy, attempts and lease holders, timestamps, trace contexts, an input's kind and its interrupt ids - and an entry's outcome, with the failure message or cancel note it carries: close and cancel name an entry by its lease or id alone, without the tenant a key is chosen by.
A retried submission under a SubmissionKey still gets the first one's ticket. The store compares what it holds, and two encryptions of one input differ, so it reports the key as reused; this queue then reads that entry, opens it and compares the submissions itself.
An entry whose input cannot be opened fails the call that read it (EncryptionError) - after inner has acted: a take has leased it, a cancel has cancelled it. Such an entry stays at the head of its thread's queue, leased again as each lease expires, until its key is supplied or the entry is cancelled.
Attributes
- Companion
- object
- Source
- EncryptingRunQueue.scala
- Graph
-
- Supertypes
