Repository navigation
Conversation
- rest/unit/encoding/crypto.md: Crypto::getDefaultParams (RSE1a-e: the defaults, keyLength from the key, base64 and base64url keys, invalid and inconsistent key lengths) and Crypto::generateRandomKey (RSE2a-b). - realtime/unit/channels/channel_encryption.md: the RSL5c tests over ably-common's crypto-data-128.json and crypto-data-256.json. Publishing encrypts to the fixtures over JSON and MessagePack (RTL6a), subscribing and history decrypt them (RTL7d, RSL6a), a channel without a cipher delivers the payload still encrypted and logs an error (RSL6b), and a CipherParamOptions cipher is resolved with getDefaultParams (TB2b2). Encrypting reproduces the fixtures through a set_fixed_iv test hook. - completion-status.md and the README's file counts are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TZ2a gives the default algorithm as `AES`, but realtime/unit/TB3/with-cipher-key-0 asserted "aes". SDKs report it in either case, as crypto.md's tests allow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UTS suite has no encryption tests:
completion-status.mdlists RSE1, RSE2, RSL5, TZ and CO as uncovered, although RSL5c requires tests against ably-common's crypto fixtures. This adds them.rest/unit/encoding/crypto.md(9 tests)Crypto.getDefaultParams(RSE1a–e):AESoraes);keyLengthcalculated from the key;+and/);keyLengththat contradicts the key.Crypto.generateRandomKey(RSE2a–b): 256 bits by default, an explicit 128, and binary keys that differ.realtime/unit/channels/channel_encryption.md(7 tests)Every test runs over both
crypto-data-128.jsonandcrypto-data-256.json(RSL5b, RSL5c).encryptedform over JSON, and to itsmsgpackform (binary ciphertext, no finalbase64) over MessagePackhistory()returns the encrypted items decryptedencodingutf-8/cipher+aes-256-cbc, and logs an errorCipherParamOptionscipher is resolved withgetDefaultParams: checked by the ciphertext's shape and a round trip, as its IV is randomThe Fixtures section defines the harness helpers:
load_fixturesreads a fixture file.fixture_dataturns anencodedmessage into what a publisher passes.set_fixed_ivis a test hook that makes encryption deterministic. The features spec has the IV come from a secure random source, so how a test fixes it is SDK-specific; TZ2 allows extraCipherParamsattributes.TB3
realtime/unit/TB3/with-cipher-key-0assertedalgorithm == "aes", while TZ2a gives the default asAES. It now compares case-insensitively.completion-status.mdand the README's file counts are updated.Written for, and derived into, ably-pubsub-swift, where all 16 tests pass against both fixtures.
🤖 Generated with Claude Code