Skip to content

Conversation

calvinbrewer
Copy link
Contributor

@calvinbrewer calvinbrewer commented Oct 3, 2025

  • Update @cipherstash/protect-ffi from 0.16.0 to 0.17.0
  • Add searchableJson() method to schema for JSON field indexing (the search operations still don't work but this interface exists)
  • Refactor type system: EncryptedPayload → Encrypted, add JsPlaintext
  • Add comprehensive test suites for JSON, integer, and basic encryption
  • Update encryption format to use 'k' property for searchable JSON
  • Remove deprecated search terms tests for JSON fields
  • Simplify schema data types to text, int, jsonb only
  • Update model helpers to handle new encryption format
  • Fix type safety issues in bulk operations and model encryption

- Add searchableJson() method to schema for JSON field indexing
- Update @cipherstash/protect-ffi from 0.16.0 to 0.17.0
- Refactor type system: EncryptedPayload → Encrypted, add JsPlaintext
- Add comprehensive test suites for JSON, integer, and basic encryption
- Update encryption format to use 'k' property for searchable JSON
- Remove deprecated search terms tests for JSON fields
- Simplify schema data types to text, int, jsonb only
- Update model helpers to handle new encryption format
- Fix type safety issues in bulk operations and model encryption
… EncryptedPayload

- Replace EncryptedPayload imports with Encrypted type across all DynamoDB operations
- Update EQL payload structure in toItemWithEqlPayloads helper function
- Simplify payload structure by removing unused fields (bf, hm, ob)
- Update type annotations in decrypt operations and bulk operations
- Add TODO comment for future ste_vec EQL type support
- Remove empty test suite that was causing 'No test found' error
- Remove unused test variable
- Add comment placeholder for future tests
- Keep boilerplate setup for when tests are needed
- Add searchable JSON column support with ste_vec indexes
- Update toItemWithEqlPayloads to construct proper EQL payloads for JSON types
- Handle both standard ciphertext (ct) and searchable vector (sv) payloads
- Pass ProtectTable schema to helpers for column metadata access
- Add comprehensive test coverage for JSON and nested JSON encryption
- Support nested protectNestedJson values in test data
- Add comment noting need to implement new Encrypt payload type
- Reminder to update when FFI interface is updated for sv payloads
Copy link
Contributor

@coderdan coderdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work! Great tests. I'd like to get clarity on some of the comments before approving.

Comment on lines +11 to +14
metadata: {
count: csValue('metadata.count').dataType('int'),
level: csValue('metadata.level').dataType('int'),
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to store this as a JSON instead of nested scalars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's up to the customer - one of our customers (which I will not name here) helped define this interface from a direct use case.

value: '42',
column: users.age,
table: users,
returnType: 'composite-literal' as const,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the composite literal for here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to above: searches

value: '99',
column: users.score,
table: users,
returnType: 'escaped-composite-literal' as const,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the escaped composite literal type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to above: searches

createdAt?: Date
updatedAt?: Date
address?: string | null
json?: Record<string, unknown> | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the | null is redundant because you have made the field itself optional.

@calvinbrewer calvinbrewer changed the title feat: ✨ add searchable JSON encryption and update FFI to v0.17.0 feat: ✨ add searchable JSON encryption and update FFI to v0.18.0 Oct 21, 2025
@calvinbrewer calvinbrewer changed the title feat: ✨ add searchable JSON encryption and update FFI to v0.18.0 feat: ✨ add JSON and INT data types and update FFI to v0.18.0 Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants