Skip to content

fix(async-watcher): forward auth metadata to GetConfig and Subscribe#78

Merged
zeevdr merged 1 commit into
mainfrom
fix/async-watcher-auth-metadata
May 20, 2026
Merged

fix(async-watcher): forward auth metadata to GetConfig and Subscribe#78
zeevdr merged 1 commit into
mainfrom
fix/async-watcher-auth-metadata

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 20, 2026

Summary

  • AsyncConfigWatcher bypassed the per-call auth metadata injection that AsyncConfigClient uses for all unary calls, causing auth-enabled servers to reject the Subscribe stream (and the initial GetConfig snapshot) with UNAUTHENTICATED.
  • Added a metadata parameter to AsyncConfigWatcher.__init__ and threaded it through both _load_snapshot and _subscribe_loop.
  • Updated AsyncConfigClient.watch() to pass self._metadata() when constructing the watcher.

Test plan

  • Added test_auth_metadata_forwarded — asserts that both GetConfig and Subscribe receive the correct metadata tuples when the watcher is constructed with auth metadata.
  • All 187 existing tests pass (make test, 97.69% coverage).

Closes #48

🤖 Generated with Claude Code

AsyncConfigClient cannot use channel interceptors, so it injects auth
metadata per-call via self._metadata(). AsyncConfigWatcher was not
receiving this metadata, causing both the initial GetConfig snapshot
and the Subscribe streaming call to omit auth headers. Auth-enabled
servers rejected the Subscribe with UNAUTHENTICATED.

Added a metadata parameter to AsyncConfigWatcher.__init__ and thread
it through both _load_snapshot and _subscribe_loop. Updated
AsyncConfigClient.watch() to pass self._metadata(). Added a unit test
asserting that both gRPC calls receive the correct metadata tuples.

Co-Authored-By: Claude <noreply@anthropic.com>

Closes #48
@zeevdr zeevdr added this to the Beta Readiness milestone May 20, 2026
@zeevdr zeevdr added bug Something isn't working size: S Quick win — a few hours or less priority: P1 Current milestone work labels May 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr zeevdr merged commit 111eb7e into main May 20, 2026
14 checks passed
@zeevdr zeevdr deleted the fix/async-watcher-auth-metadata branch May 20, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: P1 Current milestone work size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async watcher Subscribe call is missing auth metadata

1 participant