[TECH DEBT] Encapsulate the sign-in state in AsyncAuth
メンテナーはふだん 3 日以内に返信
@charzl がすでに取り組んでいます。
2026年11月6日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Python
- スター
- 15.8k
- フォーク
- 5.6k
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 99
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
saltstack/salt のほかの issue
-
[Bug]: Scheduled returns scan all accepted minion keys causing extreme load対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
saltstack/salt#70789 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
[Bug]: pip.installed with upgrade=True upgrades a package but returns an empty changes dictionary対応中かも @ITJamie が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
[Bug]: Minion with file_client: local crashes on connect: 'AsyncPillar' object has no attribute 'aclose'対応中かも @shawnrruss が 9 日前に担当しました。 オープンbug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
[Bug]: mine.update clear=True raises UnboundLocalError on the master and stores nothing対応中かも @cestercian が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
saltstack/salt#70622 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
btclib-org/btclib-wallet#872 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
btclib-org/btclib#3093 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
patrickballard/wheelgap#269 ·
-
priority: low python
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
LearningCircuit/local-deep-research#8635 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
buckai-observatory/Automated-Cloud-Removal-and-Seamless-Satellite-Image-Mosaicking-Pipeline#52 ·
メンテナーはふだん 1 日以内に返信