Skip to content

Commit 4b039db

Browse files
committed
docs(stack-encrypt): an 8- or 16-bit leaf under a 32-bit type is refused when it seals too
The breaking note named the open path only. A host that sends a narrow leaf for a field declared int32 is now refused with FieldType at seal, where it was widened; Go code generated before still seals, because gensupport converts to the declared width. ValueFrame::of's errors no longer name a 128-bit integer and a date as outside the model.
1 parent a5d4d66 commit 4b039db

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎packages/stack-encrypt/CHANGELOG.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
184184
was sealed; now it is sealed as itself, so a field declared `int16` seals
185185
an int16 leaf. A record sealed before under a 32-bit `type` does not open
186186
under a plan that declares the narrower kind (`Plan(FieldType)`): the
187-
typed decrypt checks the leaf's kind against the plan's.
187+
typed decrypt checks the leaf's kind against the plan's. The seal side
188+
breaks the same way: a host that sends an 8- or 16-bit leaf for a field
189+
whose plan declares a 32-bit `type` is refused (`Reason::FieldType`, naming
190+
the field), where the leaf used to be widened. Send the declared width, or
191+
declare the narrower kind. The Go SDK converts to the declared width itself,
192+
so Go code generated before this change still seals.
188193

189194
- **A dynamic plaintext is a frame, not a value tree** (`dynamic` feature;
190195
#1232, vitaminc ADR 0001). vitaminc 0.6 has no shared value type: a value

‎packages/stack-encrypt/src/dynamic/value_frame.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ impl ValueFrame {
7878
///
7979
/// # Errors
8080
///
81-
/// [`DecodeError::Expected`] for a scalar outside the model (a 128-bit
82-
/// integer, a date), [`DecodeError::DuplicateKey`] for a map with a
81+
/// [`DecodeError::Expected`] for a scalar outside the model (a uuid, a
82+
/// logical type this build does not know, a date, decimal or timestamp
83+
/// outside vitaminc's range), [`DecodeError::DuplicateKey`] for a map with a
8384
/// repeated key, and [`DecodeError::Source`] for a source that fails or
8485
/// a value deeper or longer than a frame carries.
8586
pub fn of<P: Encrypt>(value: P) -> Result<Self, DecodeError> {

0 commit comments

Comments
 (0)