Skip to content

Commit

Permalink
Update CHANGELOG.rst #504
Browse files Browse the repository at this point in the history
    * Add docstring for index_package_scan

Signed-off-by: Jono Yang <[email protected]>
  • Loading branch information
JonoYang committed Jul 31, 2024
1 parent ad3a4b4 commit 499e357
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ Next Release
removed.
- The `/api/collect/` and `/api/collect/index_packages/` API endpoints have been
updated such that Package scan and processing requests made with purls with
versions are processed ahead of those made with versionless purls. https://github.com/nexB/purldb/issues/502
versions are processed ahead of those made with versionless purls.
https://github.com/nexB/purldb/issues/502
- The `/api/scan_queue/` endpoint has been updated.
`/api/scan_queue/get_next_download_url/` now returns a `webhook_url`, where
the purldb scan worker will submit results. This is a URL to the
`/api/scan_queue/index_package_scan/` endpoint.
`/api/scan_queue/update_status/` is now an action on a ScannableURI.
https://github.com/nexB/purldb/issues/504


v5.0.0
Expand Down
6 changes: 6 additions & 0 deletions minecode/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ def update_status(self, request, *args, **kwargs):
@api_view(['POST'])
@csrf_exempt
def index_package_scan(request, key):
"""
Given a `request` to the `/api/scan_queue/index_package_scan/<key>/`
endpoint, where `key` is the id of the purldb scan queue worker that has
been encoded as a secret, save the package scan results and summary to files
and create a new rq worker task to index the scan results and summary.
"""
try:
json_data = json.loads(request.body.decode("utf-8"))
except json.JSONDecodeError:
Expand Down

0 comments on commit 499e357

Please sign in to comment.