feat(core): HashProperty keeps values that must be read back #66

Merged
crapougnax merged 3 commits from feat/65-hash-property-reversible into develop 2026-11-17 20:10:12 +00:00
Member

Closes #65

HashProperty gains a reversible algorithm, ALGORITHM_AES256GCM, so credentials are kept the same way everywhere instead of each application encrypting around a string property.

  • Sealed on set under a 256-bit key: key option (bytes, base64 text or function) or HashProperty.setDefaultKey() for models declared statically.
  • val(), toJSON() and backends only see the sealed text (aes-256-gcm.v1.…).
  • reveal() reads the value back; compare() works as for digests, in constant time.
  • context (text or function of the parent object) binds a value to what it belongs to.
  • A value already sealed is stored as it is: loading an object does not seal twice.
  • HashPropertyUnreadableError never carries a value.

One-way algorithms are unchanged. Not addressed here: with those, a digest loaded from a backend is still hashed again by set (see the note in UserRepository).

Tests: 22 passing on the property (8 new).

🤖 Generated with Claude Code

Closes #65 `HashProperty` gains a reversible algorithm, `ALGORITHM_AES256GCM`, so credentials are kept the same way everywhere instead of each application encrypting around a string property. - Sealed on `set` under a 256-bit key: `key` option (bytes, base64 text or function) or `HashProperty.setDefaultKey()` for models declared statically. - `val()`, `toJSON()` and backends only see the sealed text (`aes-256-gcm.v1.…`). - `reveal()` reads the value back; `compare()` works as for digests, in constant time. - `context` (text or function of the parent object) binds a value to what it belongs to. - A value already sealed is stored as it is: loading an object does not seal twice. - `HashPropertyUnreadableError` never carries a value. One-way algorithms are unchanged. Not addressed here: with those, a digest loaded from a backend is still hashed again by `set` (see the note in `UserRepository`). Tests: 22 passing on the property (8 new). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(core): HashProperty keeps values that must be read back (#65)
Some checks failed
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Has been cancelled
Quatrain Core CI / Publish Changed Packages to npm (push) Has been cancelled
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Has been cancelled
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been cancelled
1e53798cd1
New reversible algorithm ALGORITHM_AES256GCM, for credentials an application
must use again. The value is sealed on set under a 256-bit key given by the
property or set once for the process; val(), toJSON() and backends only see
the sealed text; reveal() reads it back and compare() works as for digests.
An optional context binds a sealed value to what it belongs to. A value
already sealed is stored as it is, so loading an object does not seal twice.

One-way algorithms are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs(core): keep the property table whole (#65)
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Successful in 7m1s
Quatrain Core CI / Publish Changed Packages to npm (push) Has been skipped
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 7m58s
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been skipped
9ce72db4ae
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge branch 'develop' into feat/65-hash-property-reversible
All checks were successful
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (push) Successful in 10m10s
Quatrain Core CI / Monorepo Build, Tests & Quality Audit (pull_request) Successful in 10m17s
Quatrain Core CI / Publish Changed Packages to npm (push) Has been skipped
Quatrain Core CI / Publish Changed Packages to npm (pull_request) Has been skipped
c9654c72eb
crapougnax merged commit 16fab52b90 into develop 2026-11-17 20:10:12 +00:00
crapougnax deleted branch feat/65-hash-property-reversible 2026-11-17 20:10:12 +00:00
Sign in to join this conversation.
No description provided.