feat: complete SipConfiguration attributes for API 2026-04-16#51
Merged
Conversation
6cbf047 to
fb71432
Compare
Adds the 5 writable + 2 read-only SIP registration attributes introduced in API 2026-04-16: enabled_sip_registration, use_did_in_ruri, cnam_lookup, network_protocol_priority, diversion_inject_mode plus server-generated incoming_auth_username and incoming_auth_password (returned only when sip_registration is enabled, stripped from POST/PATCH bodies because the API rejects writes with 400 Param not allowed). Includes wire-format coverage of the create / read / disable PATCH flows, fixture alignment with real sandbox responses, and the SDK-specific changes needed to land the feature cleanly (typing / nullability fixes, read-only enforcement at the type level, constructor / builder ergonomics).
Override the SDK's idiomatic debug/log surface to replace credential field values with [FILTERED] before they reach default print(), logger output, debugger inspection, or unhandled exception traces. The wire payload is unaffected — serializers continue to emit the real values (or strip read-only ones via the existing read-only mechanism). Marks SIP auth_password and the server-generated incoming_auth_* on SipConfiguration, plus username and password on the credentials_and_ip authentication method, as sensitive.
4e62915 to
1aefc01
Compare
The server enforces multi-field invariants on the sip_registration
toggle (host / port must be absent when enabled, use_did_in_ruri
must be false when disabled). The SDK now applies those cascades
automatically so caller code never has to enumerate the rule set:
- enabled_sip_registration = true -> host = null, port = null
(always emitted on the wire,
even on a fresh config)
- enabled_sip_registration = false -> use_did_in_ruri = false
- host = <non-blank> -> enabled_sip_registration = false,
use_did_in_ruri = false
The host/port nullification fires unconditionally so a PATCH against
an existing trunk that already has them persisted server-side is
told to clear them — a conditional cascade would silently drop the
fields and the server would reject the merged request with 422.
The cascade fires only on application-driven assignments;
deserialization of server responses (which are already internally
consistent) bypasses it so existing combinations are not
clobbered.
Add a SIP registration usage section to the README that explains the cascade rules and shows the enable / disable examples. The disable example is a single setHost() / config.host = '...' call — the cascade flips the dependent fields automatically.
1aefc01 to
f0c6fea
Compare
The same one-line credential-mask ternary that returns [FILTERED] for non-null credential strings was inlined in two unrelated toString() overrides: SipConfiguration and CredentialsAndIpAuthenticationMethod. Extract it into a new com.didww.sdk.internal.Redact utility class. Both call sites now route through Redact.mask, removing the duplicate. Behaviour is unchanged — the helper body is character-for-character identical to the previous inline expressions, and the existing redaction tests on both types continue to pass.
|
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
Completes the API
2026-04-16SipConfigurationattribute set. Mirrors the Ruby reference PR #80.5 writable attributes (missed during the original 2026-04-16 rollout)
These attributes the server accepts under API
2026-04-16and are listed in the public 2026-04-16 changelog, but were absent from both this SDK and the public Postman collection. Server is authoritative — added all five:enabledSipRegistrationenabled_sip_registrationBooleanuseDidInRuriuse_did_in_ruriBooleannetworkProtocolPrioritynetwork_protocol_priorityNetworkProtocolPriorityenumdiversionInjectModediversion_inject_modeDiversionInjectModeenumcnamLookupcnam_lookupBooleanTwo new enums added:
DiversionInjectMode—none,did_numberNetworkProtocolPriority—force_ipv4,force_ipv6,any,prefer_ipv4,prefer_ipv62 read-only attributes
Server-generated, returned only when
enabledSipRegistration: true:incomingAuthUsernameincomingAuthPasswordThe API rejects writes (
400 Param not allowed). Both fields are annotated with@JsonProperty(access = JsonProperty.Access.WRITE_ONLY), which in Jackson's terminology means "deserialize from JSON, never serialize back to JSON" — exactly the read-only-on-write semantics required.Misc
4.0.1inbuild.gradle.kts.Test plan
./gradlew test— passesSipConfigurationthat has the 2 read-only fields populated (simulating round-trip after a GET); assert the resulting JSON does NOT includeincoming_auth_username/incoming_auth_password. This is the regression-prevention test for the read-only contract.4.0.1, JitPack auto-builds, publish GitHub Release