Feat/har capture and logger improvements#292
Conversation
- PrintableSecret handles structured formats (Basic/Bearer, user:pass) - Add NonSensitiveKeys (token_type, grant_type) to avoid false positives - SanitizeHeaders uses PrintableSecret instead of full redaction - Remove log-to-stderr flag (logs always go to stderr now)
- Add har/ package with HAR types, middleware, and collector - HTTP client gains HAR(), HARCollector(), and RedirectPolicy() methods - HAR middleware captures innermost requests (after auth headers) - OAuth TokenTransport allows HAR capture of token fetches
- Bump go-yaml, tint, ginkgo, otel, prometheus, oops, crypto, oauth2 - Add build/install targets to root Makefile - Add HAR output flag and fixtures target to hx CLI - Simplify hx integration tests - Update upload-artifact hash in release workflow
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (22)
WalkthroughThis PR introduces HAR (HTTP Archive) capture capabilities to the HTTP client infrastructure, enabling request/response logging in standardized format. Changes include new HAR data models, middleware for capturing HTTP details, CLI integration via Changes
Sequence DiagramsequenceDiagram
participant Client as Client Code
participant HAR as HAR Middleware
participant RoundTripper as HTTP Transport
participant Server as HTTP Server
participant Collector as HAR Collector
Client->>HAR: Send HTTP Request
HAR->>HAR: Record Timestamp<br/>Build Request Object
HAR->>RoundTripper: Execute Request
RoundTripper->>Server: Send Request
Server-->>RoundTripper: Send Response
HAR->>HAR: Capture Response<br/>Build Response Object<br/>Read Body (respecting maxSize)
HAR->>HAR: Redact Sensitive Headers<br/>Build Timings
HAR->>Collector: Handler(HAR Entry)
Collector->>Collector: Thread-safe Add Entry<br/>to entries slice
HAR-->>Client: Return Response
Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🎉 This PR is included in version 1.47.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary by CodeRabbit
Release Notes
New Features
Improvements
Chores