Repository navigation
LW-481 [MISC] Accept masked webhook auth_token in GET assertions - #41
Merged
Merged
Conversation
GET /whisper-manage-callback now returns a stored, non-empty auth_token as "********" (an empty one stays ""). Accept either the raw token or the mask until the change is deployed everywhere; an empty token must still read back as "". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-481) The service now shows a token longer than 4 characters as "********" plus its last 4 characters, a shorter one as "********", and an empty one as "". Compute that exact masked form and accept it or the raw token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
johnyrahul
marked this pull request as ready for review
November 4, 2026 08:49
Contributor
[Low impact] This change appears safe to merge before the service rollout.
|
Contributor
|
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.
What
Integration test
test_webhookaccepts the maskedauth_tokenreturned byget_webhook_details.Why
GET /api/v2/whisper-manage-callbackused to echo a webhook's storedauth_token. API Hub registers its in-cluster receiver under customers' own LLMWhisperer keys, so those customers could read API Hub's bearer token back. Zipstack/unstract-llm-whisperer#822 (LW-481) masks it on read: a token longer than 4 characters reads back as"********"plus its last 4 characters (dummy-token→"********oken"), a token of 4 characters or fewer as"********", and an empty one stays"". POST/PUT with anyauth_tokenstarting with"********"returns 400 (auth_token is the masked value returned by GET; send the actual token).Dependencies
How
New helpers in
tests/integration/client_v2_test.py:masked_webhook_auth_token(token)mirrors the service's rule, andassert_webhook_auth_token(returned, sent)accepts either the raw token or exactly that masked form (so an empty token must read back as""). Used at both GETs intest_webhook.Notes on Testing
ruff checkandruff format --checkclean; the masking helper was checked offline against"",abcd,abcde,new_tokenanddummy-token-updated; the integration module collects (19 tests); unit suite: 293 passed.🤖 Generated with Claude Code