fix(sip): reject realm names with hyphens/uppercase; add DNS and cache waits to test workflow - #31
Open
michaela-band wants to merge 1 commit into
Open
fix(sip): reject realm names with hyphens/uppercase; add DNS and cache waits to test workflow#31michaela-band wants to merge 1 commit into
michaela-band wants to merge 1 commit into
Conversation
…e waits ValidateRealmName previously allowed uppercase letters and internal hyphens (DNS label rules), but the Bandwidth API rejects both with error 33013 — supported chars are [a-z0-9] only. The mismatch caused a confusing runtime failure after CLI validation passed. Updated the regex and error message to match the actual API constraint. The AGENTS.md ephemeral-realm SIP test workflow had two related gaps discovered during live testing: - New realm FQDNs can take 1–2 minutes to appear in public DNS after the realm reaches ACTIVE status. Added a dig poll loop after realm creation. - Bandwidth's SIP proxy caches credential hashes; a freshly created or rotated credential fails authentication for ~15 s. Added a sleep 15 after credential creation with an explanation. Also fixed the example realm name (sip-test → siptest) which would have failed the now-correct validation, and updated the baresip output table to distinguish a repeated-407 cache miss from a genuine 403 credential error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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
ValidateRealmNameregex fix — the previous regex allowed hyphens and uppercase letters (DNS label rules), but the Bandwidth API rejects both with error 33013 ([a-z0-9]only). Validation now matches the API constraint, so invalid names fail fast with a clear message before any HTTP request is made.TestRealmCreate_IfNotExistsMatchesNameCaseInsensitively(the uppercase-input scenario it covered is no longer reachable) and replaced it withTestRealmCreate_IfNotExistsRejectsUppercaseName, which verifies validation fires before any API call.ACTIVEstatus. Added adigpoll loop after realm creation to block until the FQDN resolves.sleep 15after credential creation with an explanation.sip-test→siptest(the hyphen would have failed the corrected validation).Test plan
make testpasses (all packages green)go vet ./...clean (golangci-lintnot installed locally; CI will cover it)183 Session Progressafter the 15 s credential cache wait🤖 Generated with Claude Code