Giter Club home page Giter Club logo

Comments (8)

sameer1046 avatar sameer1046 commented on August 22, 2024 4

That is correct. But if purl will be supported in api query then it will be easily integrated with other open source tools like owasp dependency track, nexb vulnerable code

from osv.dev.

oliverchang avatar oliverchang commented on August 22, 2024 4

curl -X POST -d '{"package": {"purl": "pkg:maven/org.apache.struts/[email protected]"}}' https://api.osv.dev/v1/query now works!

from osv.dev.

nscuro avatar nscuro commented on August 22, 2024 2

First, thank you for implementing PURL support! 🚀

In addition to the missing version though, the PURL syntax isn't quite right yet either (for Maven packages).

PURL is defined as:

scheme:type/namespace/name@version?qualifiers#subpath

For the maven type, groupId maps to namespace and artifactId to name, see here. So the correct PURL for the example above would be:

pkg:maven/org.apache.struts/struts2-core

Currently, the following does not yield any results:

$ curl -X POST -d '{"package": {"purl": "pkg:maven/org.apache.struts/struts2-core"}, "version": "2.0.14"}' https://api.osv.dev/v1/query

from osv.dev.

oliverchang avatar oliverchang commented on August 22, 2024 2

Thanks for pointing that out @nscuro. I have a PR out and this should be fixed shortly.

Querying by PURLs that have versions in them will also come shortly.

from osv.dev.

oliverchang avatar oliverchang commented on August 22, 2024 1

Hi!

Could I ask where you are suggesting to add support for purls? As part of an API query?

Our thinking with our current schema and API is to keep it compatible with PURLs where we can, i.e. keeping the "ecosystem" values consistent with the ones chosen by purl ("golang", "pypi" etc), so that in most cases you can just split the PURL into the ecosystem name and the package path and version and still have it accepted by OSV.

from osv.dev.

pombredanne avatar pombredanne commented on August 22, 2024

I could not agree more!

from osv.dev.

oliverchang avatar oliverchang commented on August 22, 2024

We support PURL API requests now:

curl -X POST -d '{"package": {"purl": "pkg:maven/org.apache.struts:struts2-core"}, "version": "2.0.14"}' https://api.osv.dev/v1/query

But @VinodAnandan pointed out that we don't support package URLs with versions in them. e.g. "pkg:maven/org.apache.struts:[email protected]". Re-opening to consider this feature.

from osv.dev.

VinodAnandan avatar VinodAnandan commented on August 22, 2024

Thank you @oliverchang !!

from osv.dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.