Skip to content

Upgrade crates.io URL from "api/v1" to "static" in purl2url #234

Description

@tdruez

Following aboutcode-org/dejacode#563

The packageurl-python library currently return https://crates.io/api/v1/ URLs in the purl2url function.

purl = "pkg:cargo/allocator-api2@0.2.21"
purl2url.get_download_url(purl)
'https://crates.io/api/v1/crates/allocator-api2/0.2.21/download'

Looking at https://crates.io/data-access

you are welcome to use the crates.io API provided you abide by the following limits:

  1. A maximum of 1 request per second, and
  2. A user-agent header that identifies your application.

Since the https://static.crates.io/ type URL have no rate limits at present, it could be an improvement for purl2url to return such URL:

https://static.crates.io/crates/allocator-api2/allocator-api2-0.2.21.crate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions