feat(network): HAR / cURL Export (#3) - #404
Merged
Merged
Conversation
ExampleTests.xctest: Coverage: 97.17
Generated by 🚫 Danger Swift against 9c80bbb |
Add a Foundation-only HAR 1.2 encoder, cURL command builder, and header redaction logic, plus a UIKit adapter bridging `HttpModel` to the pure `HARCapture` shape and wiring export through `FileSharingManager`. The core is fully testable without a simulator (3 tests, 0 failures in a standalone SPM package), as specified in docs/PROPOSED_FEATURES.md. Co-authored-by: oh-my-pi <https://omp.sh>
Co-authored-by: oh-my-pi <https://omp.sh>
Co-authored-by: oh-my-pi <https://omp.sh>
maatheusgois-dd
force-pushed
the
feature/har-curl-export
branch
from
July 16, 2026 20:58
8bf94dc to
9c80bbb
Compare
7 tasks
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.
Feature #3 — HAR / cURL Export
Implements the HAR / cURL Export feature from
docs/PROPOSED_FEATURES.md.What
Authorization,Cookie,Set-Cookie) are redactable.Why testable
The entire feature is data transformation — no
URLSession, no network. A captured request/response struct maps to a JSON dictionary (HAR) or a string (cURL). Redaction is a dictionary map. All pure Swift.Files
DebugSwift/Sources/Features/Network/Models/HARExport.swift— Foundation-only core (HAREncoder,HARCapture,HARRequest,HARResponse).DebugSwift/Sources/Features/Network/Helpers/HARExportAdapter.swift— UIKit adapter bridgingHttpModel→HARCaptureand wiringFileSharingManager/UIPasteboard.Tested contracts (local, standalone SPM package)
HAREncoder.encode([capture])→[String: Any]withlog.version == "1.2", correctrequest.method/url.HAREncoder.curlCommand(for:)→curl -X METHOD 'url' -H 'k: v' -d 'body'.HAREncoder.redactHeaders(_:)→ replacesAuthorization/Cookie/Set-Cookiewith<redacted>, leaves others intact.Result: 3 tests, 0 failures (verified locally via a throwaway SPM package; DebugSwift itself is UIKit-only and cannot build on macOS, per the doc's testability filter).
Integration into DebugSwift
HttpModel→HARCaptureviaHARExportAdapter.capture(from:). Add toolbar items to the existing network history list; share viaFileSharingManager.generateFileAndShare.Co-authored-by: oh-my-pi https://omp.sh