Skip to content

Commit d352691

Browse files
committed
docs(stack-encrypt): changelog the derive's grammar removals and Encrypted<Terms>
stack-encrypt-derive 0.2.0 is published and has no changelog of its own, so its upgrade notes go in this one, under Unreleased. Each removal says what to write instead and whether stored data moves: dropping a field literal or writing `identity` in its place, and dropping `nested`, key fields under a different context, so 0.2.0 data must be re-encrypted; one output per plaintext field (`Encrypted<Terms>`) keeps the contexts and changes only the record's shape. `TermSet`, `Encrypted<Terms>` as a target, and the `identity` attribute are Added.
1 parent 2926114 commit d352691

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

‎packages/stack-encrypt/CHANGELOG.md‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
`dynamic::term` take an `IndexSpec` (the last two by reference), and
2929
`Output` is no longer `Copy`. A plan's wire form is unchanged: a bare
3030
`"match"` still means the default options.
31+
- **`stack-encrypt-derive`: a field-level `#[stash(context = "..")]` is
32+
removed on every derive form** (0.2.0 accepted it). On a `plaintext = T`
33+
record, remove it: all outputs of the record share the caller's context. On
34+
a field of a `struct = ..` derive, write `#[stash(identity = "..")]`, which
35+
keys the field under `("<context>", "<identity>")` (`users/nickname`), not
36+
under the bare literal (`nickname`). Either way the field moves to a
37+
different context from the one 0.2.0 used: data written by 0.2.0 does not
38+
decrypt under it (ZeroKMS refuses the key, `Error::Kms`) and its equality,
39+
match and order terms do not match new query terms, so re-encrypt that
40+
data. Before the literal went, a non-plain literal such as
41+
`"readings/unit"` was already refused, for the same reason.
42+
- **`stack-encrypt-derive`: `#[stash(nested)]` is removed** (0.2.0 accepted
43+
it). Remove it: a record-typed field of a `struct = ..` derive is an
44+
ordinary field, keyed under `("<context>", "<field>")`, and its inner
45+
fields sit under that (`("user/age", "accounts/user")` where `nested` gave
46+
`user/age`). That is a different context from the one 0.2.0 used: data
47+
written by 0.2.0 does not decrypt under it and its terms do not match, so
48+
re-encrypt that data.
49+
- **`stack-encrypt-derive`: a plaintext field of a `struct = ..` derive has
50+
one output.** 0.2.0 accepted several fields `from` one plaintext field
51+
(`email: StackCipherText` beside `#[stash(from = email)] email_hm:
52+
EqualityTerm`). Write one field of type `Encrypted<Terms>` instead
53+
(`email: Encrypted<EqualityTerm>`). Its ciphertext and terms are derived
54+
under the same context as before (an equality term is the same bytes), so
55+
stored data still opens and its terms still match; what changes is the
56+
record's shape, one field where it held two.
3157

3258
### Added
3359

@@ -77,6 +103,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77103
- A passthrough field's name may be any text: it is under no label, so
78104
`FieldPlan::label` is `None` for one.
79105
- `IntoLabel` for `&String`, and `KeysetChoice` from a `&String`.
106+
- `target::TermSet`: a term type, or a tuple of two to four, names the
107+
indexes that derive it (`MatchTerms<O>` names `Match<O>`, options
108+
included).
109+
- `Encrypted<Terms>` is a target: it implements `EncryptFrom<S>`
110+
(described as `indexed(Terms::INDEXES)`), `Decryptable` and
111+
`DecryptField`, so a derived record can hold a ciphertext and its terms
112+
in one field.
113+
- `stack-encrypt-derive`: `#[stash(identity = "..")]` on a field of a
114+
`struct = ..` derive keys it under that segment in place of the plaintext
115+
field's name, the plan builder's `.identity(segment)`.
80116

81117
## [0.2.0] - 2026-10-04
82118

0 commit comments

Comments
 (0)