Skip to content

feat(folders): wrap folder contents list and unlink endpoints#199

Open
Valyrian-Code wants to merge 1 commit into
fossology:mainfrom
Valyrian-Code:feat/folder-contents
Open

feat(folders): wrap folder contents list and unlink endpoints#199
Valyrian-Code wants to merge 1 commit into
fossology:mainfrom
Valyrian-Code:feat/folder-contents

Conversation

@Valyrian-Code

Copy link
Copy Markdown
Contributor

Refs #52.

Adds wrappers for the folder-contents endpoints:

  • list_folder_contents(folder)GET /folders/{id}/contents — returns a list[FolderContent] (id / content / removable)
  • unlink_folder_content(content_id)PUT /folders/contents/{contentId}/unlink

Adds the FolderContent model to obj.py following the existing from_json convention. list_folder_contents() raises AuthorizationError on HTTP 403, consistent with the other folder endpoints.

API details

Verified against Fossology 4.4.0 (API 1.6.1) running in a container.

Tests

All 5 pass live: live listing of a folder's contents, mocked 403/404 for the listing, and mocked success/404 for the unlink.

ruff and mypy pass.

Refs fossology#52.

Adds two Folders methods:

- list_folder_contents() -> GET /folders/{id}/contents, returning a
  list[FolderContent] (id / content / removable)
- unlink_folder_content() -> PUT /folders/contents/{contentId}/unlink

Adds the FolderContent model to obj.py following the existing from_json
convention. list_folder_contents() raises AuthorizationError on HTTP 403,
consistent with the other folder endpoints.

Verified against Fossology 4.4.0 (API 1.6.1) running in a container: all 5
tests pass (live listing, mocked 403/404 for the listing, and mocked
success/404 for the unlink).

Signed-off-by: RAJVEER42 <irajveer.bishnoi2310@gmail.com>
Copilot AI review requested due to automatic review settings July 4, 2026 04:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants