A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.

Overview

har-rs

HTTP Archive format (HAR) serialization & deserialization library, written in Rust.

Build Status Latest version Documentation License

Install

Add the following to your Cargo.toml file:

[dependencies]
har = "0.6"

Use

extern crate har;

fn main() {
  match har::from_path("path/to/file.har") {
    Ok(spec) => println!("spec: {:?}", spec),
    Err(err) => println!("error: {}", err)
  }
}

Contribute

This project follows semver, conventional commits and semantic releasing using mandrean/semantic-rs.

Note

Inspired by softprops/openapi.

Comments
  • Support 1.3 draft?

    Support 1.3 draft?

    https://github.com/ahmadnassri/har-spec/blob/master/versions/1.3.md specifies some key fixes to HAR needed if one is dealing with binary APIs - e.g. GRPC.

    Would be lovely to have that supported. What do you think?

    opened by rbtcollins 6
  • invalid type: floating point

    invalid type: floating point

    error: invalid type: floating point 264.50300000033167, expected i64 at line 1 column 1

    har file:

    "time":` 264.50300000033167,

    error: Error(
        Yaml(
            Message(
                "invalid type: floating point `264.50300000033167`, expected i64",
                Some(
                    Pos {
                        marker: Marker {
                            index: 0,
                            line: 1,
                            col: 0,
                        },
                        path: ".",
                    },
                ),
            ),
        ),
        State {
            next_error: None,
            backtrace: InternalBacktrace {
                backtrace: None,
            },
        },
    )
    
    opened by D1mon 4
  • fix: Make some fields optional

    fix: Make some fields optional

    • I noticed that some fields populated by Charles Proxy (version 4.6.1 for certain) are set to null. These files include:
    • response.redirectURL
    • content.mimeType
    • Changing these fields to Option<String> improves compatibility with default Charles Proxy output.
    opened by swarkentin 2
  • charles_status meaning?

    charles_status meaning?

    Hi there,

    Nice crate, thanks for writing! I'm just picking it up for a project of mine but I'm unsure about one thing. What's the meaning of the charles_status field on Response? I'm assuming this is related to Charles - it feels strange to have a field in a generic library crate that's tied to a specific piece of software like that so just wanted to understand. Do you have a specific RFC that describes the format you are coding to? The link on the README goes to wikipedia, which links to an RFC that says 'DO NOT USE' at the top but I have no idea what the reference should be otherwise.

    Thanks!

    bug 
    opened by campbellC 2
  • Show original line number in parse error

    Show original line number in parse error

    Serde parse error is very vague with errors like the following:

    error: missing field `headersSize` at line 1 column 1
    

    or

    error: invalid type: boolean `false`, expected a string at line 1 column 1
    

    Ideally serde would send back the real line number and possibly column.

    enhancement 
    opened by jackinloadup 1
  • feat: Support HAR v1.3 proposal

    feat: Support HAR v1.3 proposal

    I found debugging the failing parsing excruciating with the untagged enum approach; I hope you'll consider the refactoring I've done here, though if its a problem, now that it parses, I can switch it back to untagged.

    opened by rbtcollins 1
  • test: Fix various issues

    test: Fix various issues

    I observed tests not being run on my platform ... The tests were in fact broken:

    • the fixtures were not located due to a faulty glob
    • the sample har file was invalid JSON
    • the round trip test failed due to about a thousand missing "comment" fields.

    I chose to remove the "" valued comment fields rather than adding all the missing ones, as eliding optional fields is entirely in spec.

    opened by rbtcollins 1
  • fix: Revert

    fix: Revert "Check in lockfile"

    This reverts commit 945247b46676d256dd33cdcf99af8297bc27fdd1, which checked in the lockfile.

    It was a blunder from my side, forgetting that har-rs is a library and not a binary, and that different Rust conventions apply then.

    opened by mandrean 0
  • Remove _charlesStatus

    Remove _charlesStatus

    This PR removes the _charlesStatus field that snuck into the codebase, fixing #13.

    It also: • Fixes a regression in the test fixtures introduced by #8 • Some minor maintenance and refactoring, like removing or bumping deps and using a macro to remove some repetitive serde annotations.

    opened by mandrean 0
  • refactor: Migrate to Rust 2018

    refactor: Migrate to Rust 2018

    This PR is mainly about migrating to Rust 2018 (using $ cargo fix --edition).

    The error_chain macro is now deprecated, but Rust's failure isn't a mature option either, so I'm silencing that deprecation warning for now.

    opened by mandrean 0
  • Fix release/crate publishing

    Fix release/crate publishing

    Currently, for some reason, the CI/CD fails when trying to publish a new release/crate.

    I'm noticing some discrepancies between using mandrean/semantic-rs locally, and the exact same version of it remotely.

    For example, running mandrean/semantic-rs locally @ 10cc3d2d17056d498627cc2afb2ec23e104acac3 results in a bump to 0.6.1, but in the CI it becomes 0.7.0.

    Needs further investigation.

    enhancement CI/CD 
    opened by mandrean 1
Releases(v0.7.1)
Owner
Sebastian Mandrean
Systems Engineer. Passionate about distributed systems, architecture, infrastructure, Go, Rust, Swagger/OpenAPI, functional programming, hardware hacking & RE.
Sebastian Mandrean
tnetstring serialization library for rust.

TNetStrings: Tagged Netstrings This module implements bindings for the tnetstring serialization format. API let t = tnetstring::str("hello world"); le

Erick Tryzelaar 16 Jul 14, 2019
Lazy Binary Serialization

LBS crates.io | docs.rs Library name stands for Lazy Binary Serialization. We call it "lazy" because it does not serizalize/deserialize struct fields

Roman Kuzmin 7 Feb 19, 2022
Implementation of Bencode encoding written in rust

Rust Bencode Implementation of Bencode encoding written in rust. Project Status Not in active developement due to lack of time and other priorities. I

Arjan Topolovec 32 Aug 6, 2022
Rust library for reading/writing numbers in big-endian and little-endian.

byteorder This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order. Dual-licensed under M

Andrew Gallant 811 Jan 1, 2023
A HTML entity encoding library for Rust

A HTML entity encoding library for Rust Example usage All example assume a extern crate htmlescape; and use htmlescape::{relevant functions here}; is

Viktor Dahl 41 Nov 1, 2022
A TOML encoding/decoding library for Rust

toml-rs A TOML decoder and encoder for Rust. This library is currently compliant with the v0.5.0 version of TOML. This library will also likely contin

Alex Crichton 1k Dec 30, 2022
rust-jsonnet - The Google Jsonnet( operation data template language) for rust

rust-jsonnet ==== Crate rust-jsonnet - The Google Jsonnet( operation data template language) for rust Google jsonnet documet: (http://google.github.io

Qihoo 360 24 Dec 1, 2022
MessagePack implementation for Rust / msgpack.org[Rust]

RMP - Rust MessagePack RMP is a pure Rust MessagePack implementation. This repository consists of three separate crates: the RMP core and two implemen

Evgeny Safronov 840 Dec 30, 2022
A Rust ASN.1 (DER) serializer.

rust-asn1 This is a Rust library for parsing and generating ASN.1 data (DER only). Installation Add asn1 to the [dependencies] section of your Cargo.t

Alex Gaynor 85 Dec 16, 2022
Encoding and decoding support for BSON in Rust

bson-rs Encoding and decoding support for BSON in Rust Index Overview of BSON Format Usage BSON Values BSON Documents Modeling BSON with strongly type

mongodb 304 Dec 30, 2022
Cap'n Proto for Rust

Cap'n Proto for Rust documentation blog Introduction Cap'n Proto is a type system for distributed systems. With Cap'n Proto, you describe your data an

Cap'n Proto 1.5k Dec 26, 2022
A Gecko-oriented implementation of the Encoding Standard in Rust

encoding_rs encoding_rs an implementation of the (non-JavaScript parts of) the Encoding Standard written in Rust and used in Gecko (starting with Fire

Henri Sivonen 284 Dec 13, 2022
Character encoding support for Rust

Encoding 0.3.0-dev Character encoding support for Rust. (also known as rust-encoding) It is based on WHATWG Encoding Standard, and also provides an ad

Kang Seonghoon 264 Dec 14, 2022
Rust implementation of CRC(16, 32, 64) with support of various standards

crc Rust implementation of CRC(16, 32, 64). MSRV is 1.46. Usage Add crc to Cargo.toml [dependencies] crc = "2.0" Compute CRC use crc::{Crc, Algorithm,

Rui Hu 120 Dec 23, 2022
A CSV parser for Rust, with Serde support.

csv A fast and flexible CSV reader and writer for Rust, with support for Serde. Dual-licensed under MIT or the UNLICENSE. Documentation https://docs.r

Andrew Gallant 1.3k Jan 5, 2023
pem-rs pem PEM jcreekmore/pem-rs [pem] — A Rust based way to parse and encode PEM-encoded data

pem A Rust library for parsing and encoding PEM-encoded data. Documentation Module documentation with examples Usage Add this to your Cargo.toml: [dep

Jonathan Creekmore 30 Dec 27, 2022
PROST! a Protocol Buffers implementation for the Rust Language

PROST! prost is a Protocol Buffers implementation for the Rust Language. prost generates simple, idiomatic Rust code from proto2 and proto3 files. Com

Dan Burkert 17 Jan 8, 2023
Rust implementation of Google protocol buffers

rust-protobuf Protobuf implementation in Rust. Written in pure rust Generate rust code Has runtime library for generated code (Coded{Input|Output}Stre

Stepan Koltsov 2.3k Dec 31, 2022
A fast, performant implementation of skip list in Rust.

Subway A fast, performant implementation of skip list in Rust. A skip list is probabilistic data structure that provides O(log N) search and insertion

Sushrut 16 Apr 5, 2022