This is the Upload service which is part of the Conclave Document Upload Services
- Client: used for basic token authentication. For each application that can post to this service, a Client object needs to be created
- Document: used to store the state of the file and to be used to retrieve the file once threat scanning succeeds
- UncheckedDocument: used to store the file initially, until the threat scanning is run. This is also the object that gets passed through to the Checker service to run threat scanning
This is a Ruby on Rails application that takes a file or a file path, saves it in the database and on S3, and calls the Checker service to run threat scanning. It's only presented as an internal API and doesn't face public users.
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew install rbenv
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 3.3.3
rbenv global 3.3.3
gem install rails -v X.X.X
Go to https://www.postgresql.org/ and download the installer
rake db:create && rake db:migrate
To run the rails server, from your console do:
rails s
You can now use the service by sending a POST request to: localhost:3000/document-upload
To run the specs, from your console do:
rspec spec