Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Firecamp HTTP Archive (HAR) Format Conversion #146

Open
2 tasks
Nishchit14 opened this issue Nov 6, 2023 · 2 comments
Open
2 tasks

feat: Firecamp HTTP Archive (HAR) Format Conversion #146

Nishchit14 opened this issue Nov 6, 2023 · 2 comments

Comments

@Nishchit14
Copy link
Contributor

Overview

Add capability in Firecamp to convert between HTTP Archive (HAR) format and Firecamp's internal HTTP request format bidirectionally.

  • HAR to Firecamp collection: Parse a HAR request object and convert it to a Firecamp request object
  • Firecamp collection to HAR: Take a Firecamp request object and convert it to a HAR request object

User Stories

  • As a user, I want to import HTTP request data from HAR files into Firecamp for editing and replay
  • As a user, I want to export request data from Firecamp to HAR format to use in other tools
  • As a user, I want Firecamp to generate code snippets from HTTP requests in multiple languages

Proposed Solution

  • Create a new @firecamp/firecamp-har package
  • Implement transformer functions for:
    • HAR request -> Firecamp request
    • Firecamp request -> HAR request
  • Map relevant fields between the two formats
  • Write unit tests for bidirectional conversion
  • Add API in the package to convert between formats

Implementation Details

  • New @firecamp/firecamp-har package
    • Leverage existing Firecamp package boilerplate
    • Transformer functions
    • Mapping logic for request fields
    • Unit tests
  • Expose conversion APIs
    • harToFirecamp(harRequest)
    • firecampToHar(firecampRequest)
  • Update Firecamp CLI and GUI to leverage new package
    • Enable importing/exporting HAR files
    • Generate code snippets from requests

Testing

  • Unit tests validating field mapping and bidirectional conversion
  • Integration tests converting HAR fixture and validating output
  • Manual end-to-end test with actual HAR file import/export

Resources

@disalechinmay
Copy link

@Nishchit14 - I was trying to see how much time this feature would take. I see there is a service being called whenever I try to import a collection. Seems like the host is being picked up from here - https://github.com/firecamp-dev/firecamp/blob/main/.env.example#L1 I couldn't find the codebase related to that API service in this repo. Is it in some other repo which is private?

@Nishchit14
Copy link
Contributor Author

@disalechinmay you don't need to call any API. We only need to build an independent package that will handle the Firecamp <> HAR collection format conversion. Here is the package https://github.com/firecamp-dev/firecamp/tree/main/packages/firecamp-har

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

No branches or pull requests

2 participants