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

Create get vulnerability details API #2207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZhangChen199102
Copy link
Collaborator

Issue: #2152

This PR introduces a new GET vulnerability details API

@@ -237,102 +237,6 @@ def vulnerability_redirector(potential_vuln_id):
return None


def bug_to_response(bug, detailed=True):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving these functions to utils.py so they can be used by both of api_handlers and frontend_handlers.

@@ -0,0 +1,47 @@
# Copyright 2021 Google LLC
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new app for API

@ZhangChen199102 ZhangChen199102 force-pushed the get-vulnerability-data-endpoint branch 3 times, most recently from 985d7d8 to 4c2aee4 Compare May 16, 2024 15:14
@ZhangChen199102 ZhangChen199102 force-pushed the get-vulnerability-data-endpoint branch from 4c2aee4 to 3f12c8a Compare May 22, 2024 04:48
@another-rex another-rex self-requested a review May 28, 2024 03:57
@another-rex
Copy link
Contributor

Unless I'm misunderstanding the goal, rather than putting API code in the frontend as well, I think we can just put a link to the GET API endpoint on the page, or add a new handler to redirect requests ending in .json to the API endpoint.
https://google.github.io/osv.dev/get-v1-vulns/

E.g. https://api.osv.dev/v1/vulns/CVE-2023-45802

@andrewpollock
Copy link
Contributor

or add a new handler to redirect requests ending in .json to the API endpoint.

That was my understanding of the easiest way forward based on #2152 (comment)

@ZhangChen199102 ZhangChen199102 force-pushed the get-vulnerability-data-endpoint branch from 3f12c8a to 7a4ff83 Compare May 31, 2024 09:59
@ZhangChen199102
Copy link
Collaborator Author

So this time I just added a JSON Data field, with a GET vulnerability details link on the vulnerability details page:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants