Giter Club home page Giter Club logo

unicorn_api_proxy's Introduction

unicorn_api

This is our API Proxy code for use by trusted Unicorn Rentals partners, and less trusted DevOps teams. Its purpose is to proxy API calls to our backend. Every 4 minutes it uses a different auth secret to auth to the backend, and to validate the result with caller. Currently the auth is updated by a gitpush every 4 minutes.

Architecture

Below was/is the proposed architecture for deploying this application. We have partially fulfilled the design in our MVP deployment.

AWS Architecture

Getting Started

If you want to locally test etc:

  • Have python 2.7

This will deploy the python dependencies, and run a local web server.

pip install -r requirements.txt
python app.py

Tests

If deploying with CICD tooling, run tests via CodeBuild or any other CI tool.

python tests_app.py -v

Or you can manually test with cURL, httpie or a browser.

Deployment

Configure AWS Parameter Store BACKEND_API value.

Then deploy how suits you, but included is a Dockerfile if you want to use Docker, and an appspec.yml for CodeDeploy.

docker build -t unicorn_api .
docker run unicorn_api -p 5000:5000

Optionally have AWS xray deployed (executable not in this repo):

curl https://s3.dualstack.us-east-1.amazonaws.com/aws-xray-assets.us-east-1/xray-daemon/aws-xray-daemon-linux-2.x.zip -o xray.zip
unzip xray.zip
chmod +x xray 
nohup ./xray &

And have a default AWS region set, either via environment variable, or aws configure.

Built With

Python
Flask
flask_restful
Requests
watchtower

unicorn_api_proxy's People

Watchers

James Cloos avatar Levi avatar  avatar

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.