You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stack-encrypt: a field marker cannot query an ordered EQL type such as IntegerOrd — add order queries #1668
Stack Encrypt (packages/stack-encrypt) is the Rust encryption engine that every CipherStash language SDK runs on. A derived record gives each field a marker, such as EncryptedMember::AGE, with one method for each operator the field's type answers: EncryptedMember::AGE.gt(30).encrypt(&keyset). An EQL type (from eql-bindings, the Rust types of EQL, the SQL library we install in the customer's database) says which operators it answers through its op::Answers impls, which eql-codegen writes into eql_bindings::v4::answers.
Problem
The equality and match types answer their operators from a marker. The ordered types (IntegerOrd, TextOrd, IntegerOrdOre, and the others) answer nothing: v4/answers.rs has no Answers impl for op::Lt, Lte, Gt, Gte or Between. Their query twin needs an order term, and for text an equality term too, but a marker's query sends one index's term. So a Rust program that stores an ordered EQL type cannot run a range query on it except through a data plan (dynamic::query_term).
#1658 is closed by #1659, which does not include order queries. The plan's item EQL types as fields is finished only when order queries work too.
Proposal
Let a marker's query build a twin from more than one term, or give the ordered twins a single-term form that the SQL accepts.
Generate Answers impls for the ordered types in eql-codegen, by the same rule the data path uses.
Test that a marker's order query and the data path derive the same bytes, and that each finds the rows the other's terms find.
Activity