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

Search REST via Purl #2089

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

nathannaveen
Copy link
Contributor

@nathannaveen nathannaveen commented Aug 26, 2024

Description of the PR

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • If GraphQL schema is changed, make generate has been run
  • If GraphQL schema is changed, GraphQL client updates/additions have been made
  • If OpenAPI spec is changed, make generate has been run
  • If ent schema is changed, make generate has been run
  • If collectsub protobuf has been changed, make proto has been run
  • All CI checks are passing (tests and formatting)
  • All dependent PRs have already been merged

@nathannaveen nathannaveen changed the title Nathan/search rest via purl Search REST via Purl Aug 26, 2024
@funnelfiasco
Copy link
Contributor

while the queries like vulns or dependencies are being passed in as parameters (i.e. http://localhost:8081/v1/package/pkg%3Agolang%2Ftest-namespace-1%2Ftest-name-1?vulns=true)

I think it would be better from a usability point of view (assuming the initial way people interact with this will be manually creating the search with curl on in a browser) to have something like query=vulns instead of vulns=true, unless we expect to support querying multiple aspects in a single call (thus vulns=true&deps=true), but even then I think something like query=vulns,deps would be better. Is this something you considered and if not, does it make the implementation or maintainability more difficult?

@nathannaveen
Copy link
Contributor Author

@funnelfiasco thank you for your input! I think this is a great idea! I never thought about passing all of the flags as a single query parameter. So, now our endpoint will look similar to: http://localhost:8081/v1/package/pkg%3Agolang%2Ftest-namespace-1%2Ftest-name-1?query=vulns,dependencies

@nathannaveen nathannaveen force-pushed the nathan/searchRestViaPurl branch 8 times, most recently from 7900dbc to fa57306 Compare September 3, 2024 20:16
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/server/server.go Outdated Show resolved Hide resolved
pkg/guacrest/helpers/getPackageInfo.go Outdated Show resolved Hide resolved
pkg/guacrest/helpers/getPackageInfo.go Outdated Show resolved Hide resolved
@nathannaveen nathannaveen force-pushed the nathan/searchRestViaPurl branch 6 times, most recently from 8ed557a to c6f4e28 Compare October 8, 2024 17:57
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Show resolved Hide resolved
pkg/guacrest/server/server.go Outdated Show resolved Hide resolved
pkg/guacrest/server/server.go Outdated Show resolved Hide resolved
pkg/guacrest/openapi.yaml Show resolved Hide resolved
pkg/guacrest/openapi.yaml Outdated Show resolved Hide resolved
pkg/guacrest/helpers/getPackageInfo.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants