Skip to content

maintenance: bound SMS client failure details - #4282

Open
zqr10159 wants to merge 2 commits into
apache:masterfrom
zqr10159:maintenance/sms-client-logging
Open

maintenance: bound SMS client failure details#4282
zqr10159 wants to merge 2 commits into
apache:masterfrom
zqr10159:maintenance/sms-client-logging

Conversation

@zqr10159

@zqr10159 zqr10159 commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • keep AWS, Alibaba Cloud, UniSMS, Twilio, Tencent Cloud, and SMSLocal request logs provider-only
  • separate provider diagnostics from outward failures so response bodies, signed URLs, payloads, phone numbers, message identifiers, and transport exception messages are not copied to logs or SendMessageException
  • retain only the provider name, HTTP status, or a bounded provider error code in failures
  • treat malformed provider responses as explicit failures instead of logging or returning provider-controlled content
  • add sentinel-based contracts for successful requests, non-2xx responses, provider errors, and network exceptions across all six clients

Validation

  • ./mvnw -pl hertzbeat-alerter -Dtest=SmsClientLoggingTest,UniSmsClientImplTest test -DskipITs -Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
    • 5 tests passed; Checkstyle passed
  • ./mvnw -pl hertzbeat-alerter -am test -DskipITs
    • full reactor passed; hertzbeat-alerter ran 439 tests with 0 failures, 0 errors, and 2 skips
  • git diff --cached --check

AI assistance: used for draft implementation and test iteration.
Human validation: focused failure-path contracts and the complete alerter reactor passed locally, including all six supported SMS clients.
Risk notes: outward errors intentionally omit provider response text and transport details. Operators retain provider, HTTP status, and bounded provider code for correlation; deeper provider diagnostics must be obtained from the provider console or request tracing outside application logs.

@zqr10159 zqr10159 changed the title maintenance: limit SMS client request logging maintenance: bound SMS client failure details Jul 30, 2026
@zqr10159

Copy link
Copy Markdown
Member Author

Author remediation update:

All six SMS client failure paths now separate bounded diagnostic metadata from provider-controlled content. Non-2xx responses, provider errors, and transport exceptions no longer place response bodies, signed URLs, phone numbers, request payloads, access-key parameters, or raw exception messages into the propagated exception or application log.

Sentinel-value failure tests passed, and the complete alerter reactor passed (439 tests). Backend, license, and label checks are green on the current head; the image E2E job is still queued at the time of this update. Maintainer review remains required.

@zqr10159

Copy link
Copy Markdown
Member Author

CI follow-up: backend build, Maven E2E, image E2E, license, and label checks have all completed successfully on the current head.

@zqr10159
zqr10159 marked this pull request as ready for review July 31, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant