[Feature request] Create a flexible endpoint for documents
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 180
- Forks
- 137
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 21
Description
Current behaviour
There is currently an endpoint /rest/v1/id/xxx-xxx in the application that is responsible for a particular CRE instance. Such an instance has a unique identifier, which is a pair of three-digit numbers separated by a dash. Within the body of this instance there are links to other CREs and documents. If we want to get any linked CRE instance, we can easily get it using the above mentioned endpoint via its id.
Problem
This approach allows us to easily move from parent to child CRE instances and vice versa, but it doesn't include other many-to-many relationships, i.e. between CRE and linked document. It doesn't allow us to get a lot of important information, such as
- documents of a certain type for a given CRE
- all CREs linked to this document
etc.
Feature Request
Using queryset parameters, we could easily solve both problems with the following requests:
/rest/v1/document/?CRE=xxx-xxx solves the first problem and
/rest/v1/document/?CRE=xxx-xxx&doctype=Standard solves the second.
So the request is to combine all documents within an endpoint and add the ability to filter document instances using the queryset parameter.
This would solve the problem mentioned in the https://github.com/OWASP/common-requirement-enumeration/issues/285 ticket and add other important functionality.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing /rest/v1/id/{id} endpoint and the current document resources; no implementation files or tests are named in the issue. Review issue #285, then define how the combined document endpoint and CRE, doctype query filters should behave, with the example requests returning the expected linked documents and CREs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100