Cloud push rejects an identical encryption key supplied from another path

Đang mở Phù hợp với người mới
#766 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@pcbeingused333 đang làm issue này rồi.

Từ ngày 23/11/2026.

  • #771 của @pcbeingused333 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
cli, cloud

Hướng nghiên cứu

Bắt đầu tại lean/components/util/encryption_helper.py, ở _validate_key_state_for_local_project, sau đó tìm các bài kiểm tra chuẩn bị tệp cục bộ cho thao tác đẩy lên cloud. Tái hiện trường hợp nội dung khóa giống hệt nhau ở các đường dẫn khác nhau và kiểm tra rằng khóa thực sự khác vẫn bị từ chối. Hoàn tất khi bài kiểm tra hồi quy thành công và thao tác đẩy bằng khóa đã sao chép thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

priority:P2

Observed

An encrypted project configured with /keys/original.txt cannot be pushed with --encrypt --key /keys/backup.txt even when the two files have identical contents. Cloud-key validation accepts the matching hash, but local file preparation rejects the different path.

Reproduced on master at 3842533 with real push/encryption helpers and config storage, a fake filesystem, and a mocked API. Both synthetic files had the same contents and hash; the cloud project had that hash. The push returned False, made no project update, and reported:

Registered encryption key /keys/original.txt is different from the one provided /keys/backup.txt

Reproduction

  1. Encrypt a project using a synthetic key and push it successfully.
  2. Copy the key to another filesystem path without changing its contents.
  3. Run lean cloud push --project Example --encrypt --key /path/to/copied-key.txt.

Cause and required result

_validate_key_state_for_local_project in lean/components/util/encryption_helper.py compares filesystem paths rather than key identity. An explicitly supplied identical key should remain usable from another path; genuinely different keys must still be rejected. Add a regression test for identical contents at different paths.

Priority P2: a valid-key operation fails, with a workaround of using the configured path.

Ngôn ngữ chính
Python
Star
335
Fork
172
Merge trung bình
6 giờ 54 phút
Pull request đã merge (30 ngày)
37

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của QuantConnect/lean-cli

Tất cả issue của QuantConnect/lean-cli

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.