Repository navigation
bug: keep the key path and leave libraries alone on cloud pull --encrypt - #689
Open
Amadeus-22 wants to merge 1 commit into
Open
Amadeus-22 wants to merge 1 commit into
Amadeus-22 wants to merge 1 commit into
Conversation
cloud pull --encrypt set `encrypted` without `encryption-key-path`, so a later plain push uploaded the encrypted contents as source code with no encryption key, leaving the cloud project unencrypted. --decrypt left a stale key path behind. Set and remove the key path the same way `lean encrypt` and `lean decrypt` do. The encryption action was also applied to the libraries added to the pull, while push deliberately leaves associated libraries unencrypted. Apply it only to the projects that were asked for. Closes QuantConnect#688 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #688
Description
lean cloud pull --encryptmarked the projectencryptedbut never storedencryption-key-path.PushManager._push_projectonly re-encrypts when that path is set, so the next plainlean cloud pushsent the encrypted file contents as source code withencryption_key='', leaving the cloud project unencrypted with ciphertext as its code.--decryptleft a staleencryption-key-pathbehind._pull_projectnow sets the key path on encrypt and removes it on decrypt, the same waylean encryptandlean decryptdo.pull_projectsalso passed the encryption action and key to the libraries it adds to the pull, sopull --project P --encryptencrypted the shared libraries P references. Push deliberately leaves associated libraries unencrypted, so the action now applies only to the projects that were asked for; libraries are pulled as they are in the cloud.How Has This Been Tested?
Three new tests in
tests/commands/cloud/test_pull.py, all failing on master and passing with the fix:test_cloud_pull_stores_the_key_path_with_encrypted_flag_given: pull with--encrypt, then a plain push sends the key hash.test_cloud_pull_removes_the_key_path_with_decrypted_flag_giventest_cloud_pull_does_not_encrypt_referenced_libraries_with_encrypted_flag_givenpytest tests/commands/cloud/test_pull.pypasses on Python 3.12. In my environment a few tests intest_push.py,test_project_manager.pyandtest_api_client.pyfail on master too, and the set changes between runs, so they are unrelated to this change.🤖 Generated with Claude Code