Coder Social home page Coder Social logo

mlr-validator's Introduction

MLR-Validator

Validates inserts and updates to the MLR system

Build Status Coverage Status

This project has been built and tested with python 3.6.x. To build the project locally you will need python 3 and virtualenv installed.

% virtualenv --python=python3 env
% env/bin/pip install -r requirements.txt

To run the tests:

env/bin/python -m unittest

To run the application locally execute the following:

% env/bin/python app.py

The swagger documentation can then be accessed at http://127.0.0.1:5000/api

Configuration

Configuration is read from config.py. config.py tries to read most values from environment variables and provides defaults if they do not exist. A user running this app can customize config values by defining environment variables referenced in config.py.

Configuration is also read from an optional .env Python file. Any python variable defined in .env overrides values set in config.py For instance, though DEBUG = False in config.py, you can turn debug on by creating a .env file with the following:

DEBUG = True

For local development, you will need to provide a JWT token to the service. This can be done through the Swagger documents by clicking the Authorize button and entering 'Bearer your.jwt.token'.

You can use a valid JWT token generated by another service. You will need to set it's JWT_PUBLIC_KEY to the public key used to generate the token, as well as the JWT_DECODE_AUDIENCE (if any) and the JWT_ALGORITHM (if different than RS256). If you don't want to verify the cert on this service, set AUTH_CERT_PATH to False.

Alternatively, you can generate your own token by using the python package jwt. In the python interpreter, do the following

import jwt
jwt.encode({'authorities': ['one_role', 'two_role']}, 'secret', algorithm='HS256')

The output of this command will be the token that you can use. You will need to set JWT_SECRET_KEY to 'secret' in your local .env file. See http://flask-jwt-simple.readthedocs.io/en/latest/options.html for the other options that you can use.

mlr-validator's People

Contributors

mbucknell avatar kmschoep-usgs avatar ayan-usgs avatar skaymen avatar cschroedl-gov avatar mhines-usgs avatar dsteinich avatar zmoore-usgs avatar isuftin avatar

Watchers

James Cloos 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.