A rails RESTful API to be used to facilitate the process of redacting sensitive information from images/documents.
In your terminal cd to the project directory and run:
bin/setup
To start the project:
rails server
By default it will run on port 3000
bundle exec rspec
GET /e_consults?include=attachments
Successful response will return:
- 200 status
- All e_consults and their associated attachments
PUT /attachments/:id
Sample Payload:
{
"data": {
"type": "attachments",
"id": 1,
"attributes": {
"censorship_status": "IN_PROGRESS"
}
}
}
Successful response will return:
- 200 status
- The updated attachment
GET /attachments/:id?include=redactions
Successful response will return:
- 200 status
- All attachments and their associated redactions
POST /redactions
Sample Payload:
{
"data": {
"type": "redactions",
"attributes": {
"attachment_id": 1,
}
}
}
Successful response will return:
- 200 status
- The updated entity
PUT /redactions/:id
Sample Payload:
Note: redaction attrs should be in pixels (e.g. x_origin =~ html left attr, y_origin =~ html top attr, etc.
{
"data": {
"type": "redactions",
"id": 1,
"attributes": {
"x_origin": 25,
"y_origin": 34,
"height": 15,
"width": 6
}
}
}
Successful response will return:
- 200 status
- The updated redaction
DELETE /redactions/:id
Successful response will return:
- 204 status
Attribute | Type |
---|---|
id | integer |
Attribute | Type |
---|---|
id | integer |
e_consult_id | integer |
censorship_status | string |
attachment_url | string |
Attribute | Type |
---|---|
id | integer |
attachment_id | integer |
x_origin | float |
y_origin | float |
height | float |
width | float |
- Additional specs
- Rubofixes
- Improve validations and error handling/guarding
- Review default attributes
- Add randomly generated image urls to seed file