feat(zenoh): usrpwd password auth defaulting to machine id#3143
Draft
jeff-hykin wants to merge 6 commits into
Draft
feat(zenoh): usrpwd password auth defaulting to machine id#3143jeff-hykin wants to merge 6 commits into
jeff-hykin wants to merge 6 commits into
Conversation
Adds optional Zenoh usrpwd authentication. Password defaults to the machine id (via DIMOS_ZENOH_PASSWORD / zenoh_password config), scoping sessions to a single host. Writes the required auth dictionary file and folds user/password into the session pool key.
| directory.mkdir(parents=True, exist_ok=True) | ||
| digest = hashlib.sha256(f"{user}:{password}".encode()).hexdigest()[:16] | ||
| path = directory / f"{digest}.txt" | ||
| path.write_text(f"{user}:{password}\n") |
…lobal config - Add `dimos_domain` (default machine id, DIMOS_DOMAIN) as the isolation knob. - `zenoh_password` now defaults to `dimos_domain` instead of the machine id directly. - Expose `zenoh_username` (default "dimos", DIMOS_ZENOH_USERNAME) on global config. - ZenohConfig user/password read from global config; drop the temp log-silence hack.
Hashes a domain string to a stable multicast group + port in the safe admin-scoped space (239.255.76.0/24, dynamic ports). Not yet wired into the default LCM url.
Derives the dictionary filename from the username only, so no password hash lands in a filename (clears the CodeQL weak-hash-on-password alert).
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #3143 +/- ##
==========================================
+ Coverage 73.33% 73.44% +0.10%
==========================================
Files 1038 1049 +11
Lines 94300 94952 +652
Branches 8546 8651 +105
==========================================
+ Hits 69154 69735 +581
- Misses 22797 22837 +40
- Partials 2349 2380 +31
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 31 files with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Summary
usrpwdauthentication so sessions are scoped by a shared user/password.DIMOS_ZENOH_PASSWORD/zenoh_passwordconfig), effectively partitioning discovery per machine.CACHE_DIR/zenoh_auth) and folds user+password into the session-pool key.Touches only 3 files:
dimos/constants.py,dimos/core/global_config.py,dimos/protocol/service/zenohservice.py.Notes
zenoh_transport::unicast::establishment"close (reason INVALID)" log spam — can drop before merge if unwanted.Test plan
DIMOS_ZENOH_PASSWORDfail to establish a session.