Skip to content

feat: add safe configurable iOS HTTP logging - #223

Draft
mohamede1945 wants to merge 2 commits into
mainfrom
afifi/ios-http-debug-logging
Draft

feat: add safe configurable iOS HTTP logging#223
mohamede1945 wants to merge 2 commits into
mainfrom
afifi/ios-http-debug-logging

Conversation

@mohamede1945

Copy link
Copy Markdown
Collaborator

Summary

  • Configure Darwin Ktor logging through MOBILE_SYNC_HTTP_LOG_LEVEL (ALL, BODY, HEADERS, INFO, or NONE).
  • Emit Ktor messages to standard output so Xcode and Simulator log capture receive request and response bodies.
  • Redact authorization, cookie, and x-auth-token headers.
  • Scrub OAuth access tokens, refresh tokens, ID tokens, authorization codes, and PKCE verifiers from verbose bodies.
  • Add regression coverage for OAuth log sanitization.

Why

KMP API traffic was difficult to inspect from the iOS example app because the prior logger did not reach the captured console. Enabling verbose OAuth logging also exposed credentials, so debugging must remain safe by default.

Validation

  • ./gradlew :auth:allTests
  • ./gradlew :syncengine:allTests
  • Built the debug XCFramework and consumed it through mobile-sync-spm in the QuranEngine example app.
  • Captured a live sync request/response and verified credential redaction.

Route Ktor logs through Kermit, support runtime log levels, and redact authentication and cookie headers.
Route iOS Ktor output to the captured console and sanitize authentication headers.

Redact OAuth tokens, authorization codes, and PKCE verifiers from verbose request and response bodies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant