Skip to content

Releases: bgpkit/bgpkit-commons

v0.10.3

21 Mar 19:01
3143351

Choose a tag to compare

New features

  • Added RPKISPOOL data source support (draft-snijders-rpkispool-format)
    • Parses CCR (draft-ietf-sidrops-rpki-ccr) files from RPKISPOOL .tar.zst archives
    • Uses bcder for DER parsing instead of processing ~942K individual .roa files
    • Added RpkiSpoolsCollector enum with three mirrors: SobornostNet, AttnJp, KerfuffleNet
    • Public API: parse_ccr(), parse_rpkispools_archive(), RpkiTrie::from_rpkispools()
    • Integrated into BgpkitCommons::load_rpki_historical(), load_rpki_from_files(), list_rpki_files()
    • Added rpkispools example

Bug fixes

  • Fixed typo in RpkiViewsCollector enum variant: SoborostNet renamed to SobornostNet

Feature flags

  • Added bcder and zstd as optional dependencies under the rpki feature flag

Documentation

  • Rewrote README.md independently from lib.rs docstrings; README now includes a Mermaid architecture diagram and module summary table
  • Removed cargo-readme workflow step and readme.tpl template
  • Added CLAUDE.md to .gitignore

v0.10.2

26 Feb 04:03
b1a6aaf

Choose a tag to compare

Bug fixes

  • Fixed RPKI validation bug where max_length exceeded returned Unknown instead of Invalid
    • Prefixes covered by an ROA but exceeding the max_length restriction now correctly return Invalid
    • Added lookup_covering_roas() helper method to find all covering ROAs without max_length filter
    • Fixed both validate() and validate_check_expiry() methods
    • Added comprehensive tests for the bug scenarios

Code improvements

  • Replaced reqwest with oneio for RPKIviews file fetching
    • Simplifies HTTP handling by using the existing oneio dependency
    • Maintains streaming optimization for .tgz archives

Maintenance

  • Fixed test failures related to AS info name matching
  • Updated list_aspas example date range to 2023-2025

v0.10.1

18 Dec 08:03
e0d70a5

Choose a tag to compare

Dependency update

  • switch reqwest defualt ssl backend to rustls

v0.10.0

05 Dec 05:19
7dc1f40

Choose a tag to compare

RPKIviews Historical Data Support

  • Added RPKIviews as a historical RPKI data source: Users can now load historical RPKI data from RPKIviews collectors in addition to RIPE NCC archives

    • New RpkiViewsCollector enum with four collectors: SoborostNet (default), MassarsNet, AttnJp, and KerfuffleNet
    • Added RpkiTrie::from_rpkiviews(collector, date) method for loading from a specific collector
    • Added RpkiTrie::from_rpkiviews_file(url, date) and from_rpkiviews_files(urls, date) for loading from specific archive URLs
    • Added list_rpkiviews_files(collector, date) function to discover available archives for a given date
    • New HistoricalRpkiSource enum to explicitly select between RIPE and RPKIviews sources
  • Streaming optimization for .tgz archives: RPKIviews archives are streamed efficiently without downloading the entire file

    • rpki-client.json is located at position 3-4 in the archive, allowing early termination after ~80MB instead of downloading 300+ MB
    • New extract_file_from_tgz(url, target_path) function for streaming extraction of specific files
    • New list_files_in_tgz(url, max_entries) function for listing archive contents with early termination
    • New tgz_contains_file(url, target_path) function for checking file existence
    • Uses reqwest for HTTP streaming and external gunzip for decompression
    • Test completion time reduced from several minutes to ~8 seconds
  • Unified rpki-client JSON parsing: Extracted shared parsing logic for rpki-client JSON format

    • New internal rpki_client.rs module with RpkiClientData struct and robust deserializers
    • Handles variations in ASN formats (numeric 12345 vs string "AS12345")
    • Handles variations in ASPA field names (customer_asid vs customer)
    • Handles provider arrays as both numbers and strings
    • Used by Cloudflare, RIPE historical, and RPKIviews sources
  • Public ROA and ASPA structs: Added stable public API types

    • New Roa struct with fields: prefix, asn, max_length, not_before, not_after
    • New Aspa struct with fields: customer_asn, providers
    • Internal rpki-client format structs are now pub(crate) only
  • Updated RIPE historical to use JSON format: Changed from CSV to output.json.xz for consistency

    • Requires xz feature in oneio (now enabled by default for rpki feature)
    • Provides richer data including expiry timestamps
  • New BgpkitCommons methods:

    • load_rpki_historical(source, date) - Load historical RPKI data from specified source
    • list_rpki_files(source, date) - List available RPKI files for a date from specified source
    • load_rpki_from_files(urls, date) - Load and merge RPKI data from multiple file URLs
  • New example: Added examples/rpki_historical.rs demonstrating historical RPKI data loading

  • Updated example: examples/list_aspas.rs now counts ASPA objects for first day of years 2020-2025

Dependencies

  • Added reqwest (with blocking feature) for HTTP streaming
  • Added tar crate for reading tar archives
  • Enabled xz feature in oneio for RIPE historical JSON support

Crate Consolidation

  • Migrated as2org-rs into bgpkit-commons: The CAIDA AS-to-Organization mapping functionality previously provided by the external as2org-rs crate has been fully integrated into the asinfo module

    • New src/asinfo/as2org.rs module provides As2org struct with new(), get_as_info(), get_siblings(), and are_siblings() methods
    • Removed external as2org-rs dependency from Cargo.toml
    • Single codebase simplifies maintenance and patch application
  • Migrated peeringdb-rs into bgpkit-commons: The PeeringDB API access functionality previously provided by the external peeringdb-rs crate has been fully integrated into the asinfo module

    • Updated src/asinfo/peeringdb.rs with full PeeringDB API client implementation
    • Includes PeeringdbNet struct and load_peeringdb_net() function for direct API access
    • Removed external peeringdb-rs dependency from Cargo.toml
  • Updated feature flags: The asinfo feature now uses regex instead of external crate dependencies

    • Before: asinfo = ["as2org-rs", "peeringdb-rs", "oneio", "serde_json", "tracing", "chrono"]
    • After: asinfo = ["oneio", "serde_json", "tracing", "chrono", "regex"]

API Improvements

  • AsInfoBuilder: Added a new builder pattern for loading AS information with specific data sources
    • New AsInfoBuilder struct with fluent API methods: with_as2org(), with_population(), with_hegemony(), with_peeringdb(), with_all()
    • Added asinfo_builder() method to BgpkitCommons for creating builders
    • Added load_asinfo_with(builder) method to BgpkitCommons for loading with builder configuration
    • The existing load_asinfo(bool, bool, bool, bool) method is preserved for backward compatibility

Before (confusing boolean parameters):

commons.load_asinfo(true, false, true, false)?;

After (clear builder pattern):

let builder = commons.asinfo_builder()
    .with_as2org()
    .with_hegemony();
commons.load_asinfo_with(builder)?;

Public API Enhancements

  • asinfo module: Added PeeringdbData to public exports for direct module access
  • All modules now consistently support both:
    • Central access via BgpkitCommons instance
    • Direct module access (e.g., bgpkit_commons::bogons::Bogons::new())

Testing Improvements

  • Comprehensive as2org module tests: Added extensive unit tests for the migrated CAIDA AS-to-Organization functionality

    • JSON deserialization tests for As2orgJsonOrg and As2orgJsonAs structures
    • Tests for optional fields and default values
    • As2orgAsInfo struct creation and serialization round-trip tests
    • fix_latin1_misinterpretation function tests for edge cases
    • Integration tests (ignored by default) for As2org::new(), get_as_info(), get_siblings(), and are_siblings() methods
  • Comprehensive peeringdb module tests: Added extensive unit tests for the migrated PeeringDB functionality

    • PeeringdbData struct creation, serialization, and deserialization tests
    • PeeringdbNet struct tests with all optional fields
    • PeeringdbNetResponse API response deserialization tests
    • Peeringdb struct tests for get_data(), contains(), len(), is_empty(), and get_all_asns() methods
    • Empty database edge case tests
    • Integration tests (ignored by default) for live API access
  • New Peeringdb helper methods: Added utility methods to the Peeringdb struct for better usability

    • len(): Get the number of networks in the database
    • is_empty(): Check if the database is empty
    • contains(asn): Check if an ASN exists in PeeringDB
    • get_all_asns(): Get all ASNs in the database

v0.9.6

30 Oct 00:24
4d9749f

Choose a tag to compare

Maintenance

  • Update dependencies to better handle rustls crypto providers:
    • peeringdb-rs to 0.1.3
    • oneio to 0.20.0
    • as2org-rs to 1.1.1

v0.9.5

29 Oct 17:50
5931df7

Choose a tag to compare

Fix CAIDA as2org data loading issue

  • Update as2org-rs to 1.1.0 to fix CAIDA as2org data loading issue.

Maintenance

  • Update dependencies

v0.9.4

09 Sep 21:38
a7c2c32

Choose a tag to compare

Hot-fix

  • Remove let-chain coding style to maintain compatibility with older Rust versions.

v0.9.3

09 Sep 21:18
1dc464c

Choose a tag to compare

Maintenance

  • Updated peeringdb-rs to 0.1.2 to address 403 error from PeeringDB API
  • Updated oneio to 0.19.0

Code quality

  • Addressed clippy warnings across the codebase with focus on asinfo module.
  • Refactored asinfo_are_siblings to use if-let chains and Option combinators, removing unnecessary unwrap() calls.
  • Simplified conditional logic (collapsible if) for better readability and safety.

v0.9.2

31 Jul 22:38
b9bd915

Choose a tag to compare

Features

  • RPKI expiry support: Added support for Cloudflare RPKI ROA expiry timestamps
    • Added expires field to CfRoaEntry structure for Cloudflare RPKI data
    • ROA expiry timestamps are now mapped to not_after field in RoaEntry
    • Added validate_check_expiry() method to RpkiTrie for time-aware validation
    • Added rpki_validate_check_expiry() method to BgpkitCommons for expiry-aware validation
    • Expired or not-yet-valid ROAs now return Unknown instead of Invalid (correct RPKI behavior)

Bug fixes

  • Fixed typo in rpki_validate() method (vapidatevalidate)

Documentation

  • RPKI documentation: Added module documentation covering:
    • Data structures and validation process explanation
    • Usage examples for both real-time (Cloudflare) and historical (RIPE) data sources
    • Performance considerations and error handling guidance
    • Multiple ROAs per prefix handling examples
  • Added no_run attribute to RPKI documentation examples to prevent timeouts during doc tests

Testing

  • Added unit tests for expiry checking functionality
  • Added manual integration test for Cloudflare RPKI data loading with expiry validation
    • Run with: cargo test --release --features rpki test_cloudflare_rpki_expiry_loading -- --ignored --nocapture

v0.9.1

31 Jul 18:58
36df00d

Choose a tag to compare

Dependencies

  • Made serde a required dependency (no longer optional) to ensure all public types can be serialized/deserialized
  • Added Serialize and Deserialize derives to all public structs that were missing them