GithubHelp home page GithubHelp logo

sapagat / evidence Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 65 KB

Evidence is a service that provides HTTP descriptors for making pre-signed requests and keep track of uploads in progress.

Ruby 96.86% Makefile 1.83% Shell 1.31%
pre-signed s3 service ruby

evidence's Introduction

Evidence

Evidence is a service that provides HTTP descriptors for making pre-signed requests and keep track of uploads in progress.

Docs

You can read about the service capabilities here

Development

Requirements

Commands

  • Boot up development server on http://localhost:7000: make up
  • Run tests: make test
  • Show logs: make logs
  • Stop services: make down
  • Clean up: make clean

Test

Suites available

  • end2end
  • features
  • integration
  • health

Any of the above mentioned test suites can be executed by running:

make test-<suite-name>

end2end

This suite checks that the service HTTP API provides the capabilities expected by its consumers.

It is an out of process test, i.e, it execises the service as a deployed artifact. To achieve this it uses stubbed external services.

For example it uses minio as an s3 stub.

features

This suite checks the behaviour of each endpoint. It relies on the app booted in test mode, this way more variabilty can be introduced and errors and exceptions can be tested in a faster and controlled manner.

It is an in process test, i.e, endpoints are excesided directly (not via HTTP) and external services are consumed via stubbed clients.

For example, it uses a stubbed s3 client.

integration

This suite checks that the gateways behaviour is the expected. To achieve this it consumes the stubbed external service.

For example, when testing Warehouse::Gateway consumes minio in order to check that it can retrieve pre-signed request instructions.

health

This suite checks that the health endpoint behaviour is the expected.

CI

This project is integrated with Travis CI: https://travis-ci.org/sapagat/evidence

Production

Dependencies

  • Amazon S3
  • Redis

Note You can check if the dependencies are met by checking the health endpoint: GET /health

Environment variables

The following environment variables must be set:

RACK_ENV=production

AUTH_TOKEN=<shared-key>

S3_BUCKET=<bucket-name>
S3_REGION=<region>
S3_ACCESS_KEY_ID=<access-key-id>
S3_SECRET_ACCESS_KEY=<secret-access-key>

REDIS_URL=<redis-url>
REDIS_TIMEOUT=<redis-timeout>

Procfile

Use a Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start your app.

An example app you deployed looks like this:

web: bundle exec rackup config.ru -p $PORT

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.