Giter Site home page Giter Site logo

redactinator's Introduction

REDACTINATOR

A rails RESTful API to be used to facilitate the process of redacting sensitive information from images/documents.

Setup

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

Running test suite

bundle exec rspec

Key API Actions

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

Data model (resource attributes)

e_consults

Attribute Type
id integer

attachments

Attribute Type
id integer
e_consult_id integer
censorship_status string
attachment_url string

redactions

Attribute Type
id integer
attachment_id integer
x_origin float
y_origin float
height float
width float

Future Improvements

  • Additional specs
  • Rubofixes
  • Improve validations and error handling/guarding
  • Review default attributes
  • Add randomly generated image urls to seed file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.