[TECH DEBT] Encapsulate the sign-in state in AsyncAuth
Maintainer thường phản hồi trong vòng 3 ngày
@charzl đang làm issue này rồi.
Từ ngày 6/11/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Description of the tech debt to be addressed, include links and screenshots
The sign-in state in salt.crypt.AsyncAuth is spread over several places:
_authenticate_futureis created inauthenticate()and__singleton_init__, written by_authenticate(), read byauthenticatedandauthenticate(), and deleted byinvalidate(). It does not exist before the first sign-in, so every reader checkshasattr.- With #70603 it holds a task instead of a future, and the number of waiters lives in a second attribute,
_authenticate_waiters.
This is hard to follow, and it is what #70642 had to untangle: a cancelled shared future, a result set twice, and authenticated raising CancelledError.
Only salt/crypt.py touches the attribute. The rest of the code uses authenticate(), authenticated and invalidate().
Proposed change
Keep the public API. Hold the current sign-in in one small object: the task and its waiter count, with the join, leave and cancel logic inside it. AsyncAuth keeps one attribute that is None until the first sign-in, and authenticated is derived from that object.
Steps, one commit each:
- Add tests that pin the current behavior: one cancelled caller does not cancel the others, an error reaches every caller,
authenticatedis false after a cancelled sign-in, the last caller leaving cancels the sign-in, andinvalidate()makes the next call sign in again. - Move the waiter counting and cleanup into the new object.
- Replace the uses of
_authenticate_future. - Remove the
hasattrchecks, thedel, and_authenticate_waiters.
This should land after #70603, which already gives each caller its own waiter.
Out of scope: invalidate() clearing the shared creds_map, and removing the AsyncAuth singleton.
Related: #70642, #70603, #70366, #70714.
Versions Report
No user-visible change. Targets the master branch.
- Ngôn ngữ chính
- Python
- Star
- 15.8k
- Fork
- 5.6k
- Merge trung bình
- 5 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 99
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của saltstack/salt
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme loadCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
saltstack/salt#70789 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: pip.installed with upgrade=True upgrades a package but returns an empty changes dictionaryCó thể đã có người làm @ITJamie đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'Có thể đã có người làm @shawnrruss đã nhận 9 ngày trước. Đang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 3 ngày
-
[Bug]: mine.update clear=True raises UnboundLocalError on the master and stores nothingCó thể đã có người làm @cestercian đã nhận 11 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
saltstack/salt#70622 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của saltstack/salt
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
btclib-org/btclib-wallet#872 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
btclib-org/btclib#3093 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
patrickballard/wheelgap#269 ·
-
priority: low python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
LearningCircuit/local-deep-research#8635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
README says the land/sea mask must match the XS grid; the demo mask does not, and Step 4 worksĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
buckai-observatory/Automated-Cloud-Removal-and-Seamless-Satellite-Image-Mosaicking-Pipeline#52 ·
Maintainer thường phản hồi trong vòng 1 ngày