├── src
├── defs
│ ├── __init__.py
│ ├── types.py
│ └── decorators.py
├── modules
│ ├── __init__.py
│ └── query_builder.py
├── tests
│ ├── __init__.py
│ ├── conftest.py
│ ├── test_config.py
│ └── test_auth.py
├── views
│ ├── auth
│ │ ├── __init__.py
│ │ ├── Login.py
│ │ ├── User.py
│ │ ├── Register.py
│ │ └── Logout.py
│ └── base
│ │ ├── __init__.py
│ │ └── Base.py
├── __init__.py
├── routers.py
├── config.py
└── models.py
├── Procfile
├── migrations
├── README
├── script.py.mako
├── alembic.ini
└── env.py
├── wsgi.py
├── example.env
├── requirements.txt
├── codecov.yml
├── makefile
├── manage.py
├── Pipfile
├── .github
└── workflows
│ └── lint-n-test.yml
├── README.md
├── .gitignore
├── Pipfile.lock
└── LICENSE
/src/defs/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/modules/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/tests/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/auth/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/views/base/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn wsgi:app
--------------------------------------------------------------------------------
/src/defs/types.py:
--------------------------------------------------------------------------------
1 | account_types = {}
2 |
--------------------------------------------------------------------------------
/migrations/README:
--------------------------------------------------------------------------------
1 | Generic single-database configuration.
--------------------------------------------------------------------------------
/wsgi.py:
--------------------------------------------------------------------------------
1 | # pylint: ignore=F401
2 | # pylint: disable=W0611
3 | from src import app
4 |
--------------------------------------------------------------------------------
/example.env:
--------------------------------------------------------------------------------
1 | TESTING=True
2 | FLASK_DEBUG=False
3 | SQLALCHEMY_TRACK_MODIFICATIONS=False
4 | SECRET_KEY=SoMeBiGsTrInGtHaTnEvErShOuLdBeExPoSeDdDdDdDdDdDdDdDdD
5 | APP_SETTINGS=src.config.DevConfig
6 | DATABASE_URL=sqlite:///test.db
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | alembic
2 | bcrypt
3 | cffi
4 | click
5 | Flask
6 | Flask-Bcrypt
7 | Flask-Cors
8 | Flask-Migrate
9 | Flask-Script
10 | Flask-SQLAlchemy
11 | pytest
12 | pytest-cov
13 | gunicorn
14 | itsdangerous
15 | markupsafe
16 | Psycopg2
17 | pycparser
18 | PyJWT
19 | python-dotenv
20 | six
21 | SQLAlchemy
22 | Werkzeug
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | codecov:
2 | require_ci_to_pass: yes
3 |
4 | coverage:
5 | precision: 2
6 | round: down
7 | range: "70...100"
8 |
9 | parsers:
10 | gcov:
11 | branch_detection:
12 | conditional: yes
13 | loop: yes
14 | method: no
15 | macro: no
16 |
17 | comment:
18 | layout: "reach,diff,flags,tree"
19 | behavior: default
20 | require_changes: no
21 |
--------------------------------------------------------------------------------
/src/__init__.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | from flask import Flask
4 | from flask_bcrypt import Bcrypt
5 | from flask_sqlalchemy import SQLAlchemy
6 | from flask_cors import CORS
7 |
8 | app = Flask(__name__)
9 | CORS(app)
10 |
11 | app_settings = os.getenv("APP_SETTINGS", "src.config.DevConfig")
12 | app.config.from_object(app_settings)
13 |
14 | bcrypt = Bcrypt(app)
15 | db = SQLAlchemy(app)
16 |
17 | from src.routers import auth_blueprint
18 |
19 | app.register_blueprint(auth_blueprint)
20 |
--------------------------------------------------------------------------------
/makefile:
--------------------------------------------------------------------------------
1 | install:
2 | sudo pip -r install --sequential -U requirements.txt
3 |
4 | run:
5 | python manage.py runserver
6 |
7 | test:
8 | python manage.py test
9 |
10 | db_create:
11 | python manage.py db_create
12 |
13 | db_init:
14 | python manage.py db init
15 |
16 | db_migrate:
17 | python manage.py db migrate
18 |
19 | db_upgrade:
20 | python manage.py db upgrade
21 |
22 | clean:
23 | find . -name \*.pyc -type f -delete
24 | find . -name __pycache__ -type d -delete
25 | rm -rf .pytest_cache/
26 |
--------------------------------------------------------------------------------
/src/modules/query_builder.py:
--------------------------------------------------------------------------------
1 | from src import db
2 |
3 |
4 | class QueryBuilder:
5 | def __init__(self, query_class: tuple, query_args: list, query_entities=None):
6 | self.query = db.session.query(query_class)
7 | for element in query_args:
8 | self.query = self.query.filter(
9 | element[0].__dict__[element[1]] == element[2]
10 | )
11 | self.query = self.query.with_entities(query_entities)
12 |
13 | def execute(self):
14 | return self.query.all()
15 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=D104
2 | from flask_script import Manager
3 | from flask_migrate import Migrate, MigrateCommand
4 |
5 | from src import app, db
6 |
7 | migrate = Migrate(app, db)
8 | manager = Manager(app)
9 |
10 | # migrations
11 | manager.add_command("db", MigrateCommand)
12 |
13 |
14 | @manager.command
15 | def create_db():
16 | """Creates the db tables."""
17 | db.create_all()
18 |
19 |
20 | @manager.command
21 | def drop_db():
22 | """Drops the db tables."""
23 | db.drop_all()
24 |
25 |
26 | if __name__ == "__main__":
27 | manager.run()
28 |
--------------------------------------------------------------------------------
/migrations/script.py.mako:
--------------------------------------------------------------------------------
1 | """${message}
2 |
3 | Revision ID: ${up_revision}
4 | Revises: ${down_revision | comma,n}
5 | Create Date: ${create_date}
6 |
7 | """
8 | from alembic import op
9 | import sqlalchemy as sa
10 | ${imports if imports else ""}
11 |
12 | # revision identifiers, used by Alembic.
13 | revision = ${repr(up_revision)}
14 | down_revision = ${repr(down_revision)}
15 | branch_labels = ${repr(branch_labels)}
16 | depends_on = ${repr(depends_on)}
17 |
18 |
19 | def upgrade():
20 | ${upgrades if upgrades else "pass"}
21 |
22 |
23 | def downgrade():
24 | ${downgrades if downgrades else "pass"}
25 |
--------------------------------------------------------------------------------
/Pipfile:
--------------------------------------------------------------------------------
1 | [[source]]
2 | name = "pypi"
3 | url = "https://pypi.org/simple"
4 | verify_ssl = true
5 |
6 | [dev-packages]
7 |
8 | [packages]
9 | alembic = "*"
10 | bcrypt = "*"
11 | cffi = "*"
12 | click = "*"
13 | pytest = "*"
14 | pytest-cov = "*"
15 | gunicorn = "*"
16 | itsdangerous = "*"
17 | psycopg2 = "*"
18 | pycparser = "*"
19 | python-dotenv = "*"
20 | six = "*"
21 | Flask = "*"
22 | Flask-Bcrypt = "*"
23 | Flask-Cors = "*"
24 | Flask-Migrate = "*"
25 | Flask-Script = "*"
26 | Flask-SQLAlchemy = "*"
27 | MarkupSafe = "*"
28 | PyJWT = "*"
29 | SQLAlchemy = "*"
30 | Werkzeug = "*"
31 |
32 | [requires]
33 | python_version = "3.8"
34 |
--------------------------------------------------------------------------------
/src/tests/conftest.py:
--------------------------------------------------------------------------------
1 | import pytest
2 |
3 | from src import app, db
4 |
5 |
6 | @pytest.fixture(scope="module")
7 | def client():
8 | # setup app with test config
9 | app.config.from_object("src.config.TestingConfig")
10 | # create test client
11 | client = app.test_client()
12 |
13 | # preparing app context for the testing phase
14 | ctx = app.app_context()
15 | ctx.push()
16 | # tests happen here
17 | yield client
18 |
19 | ctx.pop()
20 |
21 |
22 | @pytest.fixture(scope="module")
23 | def database():
24 |
25 | # initiate database
26 | db.create_all()
27 | # commit changes
28 | db.session.commit()
29 |
30 | # tests happen here
31 | yield db
32 |
33 | # teardown
34 | db.session.remove()
35 | db.drop_all()
36 |
--------------------------------------------------------------------------------
/src/routers.py:
--------------------------------------------------------------------------------
1 | from flask import Blueprint
2 |
3 | from src.views.auth.Register import RegisterAPI
4 | from src.views.auth.Login import LoginAPI
5 | from src.views.auth.User import UserAPI
6 | from src.views.auth.Logout import LogoutAPI
7 |
8 | auth_blueprint = Blueprint("auth", __name__)
9 |
10 | # define the API resources
11 | registration_view = RegisterAPI.as_view("register_api")
12 | login_view = LoginAPI.as_view("login_api")
13 | user_view = UserAPI.as_view("user_api")
14 | logout_view = LogoutAPI.as_view("logout_api")
15 |
16 | # add Rules for API Endpoints
17 | auth_blueprint.add_url_rule(
18 | "/auth/register", view_func=registration_view, methods=["POST"]
19 | )
20 | auth_blueprint.add_url_rule("/auth/login", view_func=login_view, methods=["POST"])
21 | auth_blueprint.add_url_rule("/auth/status", view_func=user_view, methods=["GET"])
22 | auth_blueprint.add_url_rule("/auth/logout", view_func=logout_view, methods=["POST"])
23 |
--------------------------------------------------------------------------------
/migrations/alembic.ini:
--------------------------------------------------------------------------------
1 | # A generic, single database configuration.
2 |
3 | [alembic]
4 | # template used to generate migration files
5 | # file_template = %%(rev)s_%%(slug)s
6 |
7 | # set to 'true' to run the environment during
8 | # the 'revision' command, regardless of autogenerate
9 | # revision_environment = false
10 |
11 |
12 | # Logging configuration
13 | [loggers]
14 | keys = root,sqlalchemy,alembic
15 |
16 | [handlers]
17 | keys = console
18 |
19 | [formatters]
20 | keys = generic
21 |
22 | [logger_root]
23 | level = WARN
24 | handlers = console
25 | qualname =
26 |
27 | [logger_sqlalchemy]
28 | level = WARN
29 | handlers =
30 | qualname = sqlalchemy.engine
31 |
32 | [logger_alembic]
33 | level = INFO
34 | handlers =
35 | qualname = alembic
36 |
37 | [handler_console]
38 | class = StreamHandler
39 | args = (sys.stderr,)
40 | level = NOTSET
41 | formatter = generic
42 |
43 | [formatter_generic]
44 | format = %(levelname)-5.5s [%(name)s] %(message)s
45 | datefmt = %H:%M:%S
46 |
--------------------------------------------------------------------------------
/src/config.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | basedir = os.path.abspath(os.path.dirname(__file__))
4 | dummy_database = "sqlite:///test.db"
5 | database_name = "flask_jwt_auth"
6 |
7 |
8 | class BaseConfig:
9 | """Base configuration."""
10 |
11 | SECRET_KEY = os.getenv("SECRET_KEY")
12 | DEBUG = False
13 | BCRYPT_LOG_ROUNDS = 13
14 | SQLALCHEMY_TRACK_MODIFICATIONS = False
15 |
16 |
17 | class DevConfig(BaseConfig):
18 | """Development configuration."""
19 |
20 | DEBUG = True
21 | BCRYPT_LOG_ROUNDS = 4
22 | SQLALCHEMY_DATABASE_URI = os.getenv("DATABASE_URL")
23 |
24 |
25 | class TestingConfig(BaseConfig):
26 | """Testing configuration."""
27 |
28 | DEBUG = True
29 | TESTING = True
30 | BCRYPT_LOG_ROUNDS = 4
31 | SQLALCHEMY_DATABASE_URI = "sqlite:///unittest_db.db"
32 | PRESERVE_CONTEXT_ON_EXCEPTION = False
33 |
34 |
35 | class ProductionConfig(BaseConfig):
36 | """Production configuration."""
37 |
38 | SECRET_KEY = os.getenv("SECRET_KEY")
39 | DEBUG = False
40 | SQLALCHEMY_DATABASE_URI = os.getenv("DATABASE_URL")
41 |
--------------------------------------------------------------------------------
/src/tests/test_config.py:
--------------------------------------------------------------------------------
1 | import os
2 | from src import app
3 |
4 |
5 | def test_testingConfig():
6 | """TestingConfig test."""
7 |
8 | app.config.from_object("src.config.TestingConfig")
9 |
10 | assert not app.config["SECRET_KEY"] is None
11 | assert app.config["DEBUG"] == True
12 | assert app.config["SQLALCHEMY_DATABASE_URI"] == "sqlite:///unittest_db.db"
13 |
14 |
15 | def test_devConfig():
16 | """DevConfig test."""
17 |
18 | app.config.from_object("src.config.DevConfig")
19 |
20 | assert not (app.config["SECRET_KEY"] is None)
21 | assert app.config["DEBUG"] == True
22 | assert app.config["SQLALCHEMY_DATABASE_URI"] == os.getenv(
23 | "DATABASE_URL", "sqlite:///test.db"
24 | )
25 |
26 |
27 | def test_productionConfig():
28 | """ProductionConfig test."""
29 |
30 | app.config.from_object("src.config.ProductionConfig")
31 |
32 | assert not (app.config["SECRET_KEY"] is None)
33 | assert app.config["DEBUG"] == False
34 | assert app.config["SQLALCHEMY_DATABASE_URI"] == os.getenv("DATABASE_URL")
35 | assert not (app.config["SQLALCHEMY_DATABASE_URI"] is None)
36 |
--------------------------------------------------------------------------------
/src/defs/decorators.py:
--------------------------------------------------------------------------------
1 | from flask import request, make_response, jsonify
2 |
3 | from src.models import User
4 |
5 |
6 | def login_required(function):
7 | def wrap(*args, **kwargs):
8 | auth_header = request.headers.get("Authorization")
9 | if auth_header:
10 | try:
11 | auth_token = auth_header.split(" ")[1]
12 | except IndexError:
13 | responseObject = {
14 | "status": "fail",
15 | "message": "Bearer token malformed.",
16 | }
17 | return make_response(jsonify(responseObject)), 401
18 | else:
19 | auth_token = None
20 | if auth_token:
21 | resp = User.decode_auth_token(auth_token)
22 | if not isinstance(resp, str):
23 | return function(*args, **kwargs)
24 | responseObject = {"status": "fail", "message": resp}
25 | return make_response(jsonify(responseObject)), 401
26 | else:
27 | responseObject = {
28 | "status": "fail",
29 | "message": "Provide a valid auth token.",
30 | }
31 | return make_response(jsonify(responseObject)), 401
32 |
33 | wrap.__name__ = function.__name__
34 | return wrap
35 |
--------------------------------------------------------------------------------
/src/views/auth/Login.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=R0201
2 | from flask import request, make_response, jsonify
3 | from flask.views import MethodView
4 |
5 | from src import bcrypt
6 | from src.models import User
7 |
8 |
9 | class LoginAPI(MethodView):
10 | """
11 | User Login Resource
12 | """
13 |
14 | def post(self):
15 | # get the post data
16 | post_data = request.get_json()
17 | try:
18 | # fetch the user data
19 | user = User.query.filter_by(username=post_data.get("username")).first()
20 | if user and bcrypt.check_password_hash(
21 | user.password, post_data.get("password")
22 | ):
23 | auth_token = user.encode_auth_token(user.id)
24 | if auth_token:
25 | responseObject = {
26 | "status": "success",
27 | "message": "Successfully logged in.",
28 | "auth_token": auth_token.decode(),
29 | }
30 | return make_response(jsonify(responseObject)), 200
31 | else:
32 | responseObject = {"status": "fail", "message": "User does not exist."}
33 | return make_response(jsonify(responseObject)), 404
34 | except Exception as e:
35 | print(e)
36 | responseObject = {"status": "fail", "message": "Try again"}
37 | return make_response(jsonify(responseObject)), 500
38 |
--------------------------------------------------------------------------------
/src/views/auth/User.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=R0201
2 | from flask import request, make_response, jsonify
3 | from flask.views import MethodView
4 |
5 | from src.models import User
6 |
7 |
8 | class UserAPI(MethodView):
9 | """
10 | User Resource
11 | """
12 |
13 | def get(self):
14 | # get the auth token
15 | auth_header = request.headers.get("Authorization")
16 | if auth_header:
17 | try:
18 | auth_token = auth_header.split(" ")[1]
19 | except IndexError:
20 | responseObject = {
21 | "status": "fail",
22 | "message": "Bearer token malformed.",
23 | }
24 | return make_response(jsonify(responseObject)), 401
25 | else:
26 | auth_token = None
27 | if auth_token:
28 | resp = User.decode_auth_token(auth_token)
29 | if not isinstance(resp, str):
30 | user = User.query.filter_by(id=resp).first()
31 | responseObject = {
32 | "status": "success",
33 | "data": {
34 | "user_id": user.id,
35 | "username": user.username,
36 | "registered_on": user.registered_on,
37 | },
38 | }
39 | return make_response(jsonify(responseObject)), 200
40 | responseObject = {"status": "fail", "message": resp}
41 | return make_response(jsonify(responseObject)), 401
42 | else:
43 | responseObject = {
44 | "status": "fail",
45 | "message": "Provide a valid auth token.",
46 | }
47 | return make_response(jsonify(responseObject)), 401
48 |
--------------------------------------------------------------------------------
/.github/workflows/lint-n-test.yml:
--------------------------------------------------------------------------------
1 | # This workflow will install Python dependencies, run tests and lint with a single version of Python
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3 |
4 | name: flask-boilerplate
5 |
6 | on:
7 | push:
8 | branches: [ master ]
9 | pull_request:
10 | branches: [ master ]
11 |
12 | jobs:
13 | build:
14 |
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - uses: actions/checkout@v2
19 | - name: Set up Python 3.8
20 | uses: actions/setup-python@v1
21 | with:
22 | python-version: 3.8
23 | - name: Install dependencies
24 | run: |
25 | python -m pip install --upgrade pip
26 | pip install flake8 pytest
27 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28 | - name: Lint with flake8
29 | run: |
30 | # stop the build if there are Python syntax errors or undefined names
31 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
32 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
33 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34 | - name: Run tests
35 | run: |
36 | pytest --cov-report=xml --cov=./
37 | env:
38 | TESTING: True
39 | FLASK_DEBUG: False
40 | SQLALCHEMY_TRACK_MODIFICATIONS: False
41 | SECRET_KEY: abcde
42 | APP_SETTINGS: src.config.TestingConfig
43 | DATABASE_URL: sqlite:///test.db
44 | - name: Upload coverage to Codecov
45 | uses: codecov/codecov-action@v1
46 | with:
47 | token: ${{ secrets.CODECOV_TOKEN }}
48 | file: ./coverage.xml
49 | flags: unittests
50 | env_vars: OS,PYTHON
51 | name: codecov-umbrella
52 | fail_ci_if_error: true
53 |
--------------------------------------------------------------------------------
/src/views/auth/Register.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=R0201
2 | from flask import request, make_response, jsonify
3 | from flask.views import MethodView
4 |
5 | from src import db
6 | from src.models import User
7 | from src.defs.types import account_types
8 |
9 |
10 | class RegisterAPI(MethodView):
11 | """
12 | User Registration Resource
13 | """
14 |
15 | def post(self):
16 | # get the post data
17 | post_data = request.get_json()
18 | number_of_types = len(account_types)
19 | # check if user already exists
20 | user = User.query.filter_by(username=post_data.get("username")).first()
21 | if not user:
22 | try:
23 | user = User(
24 | username=post_data.get("username"),
25 | password=post_data.get("password"),
26 | account_type=int(post_data.get("account_type"))
27 | if number_of_types != 0
28 | else None,
29 | )
30 | # insert the user
31 | db.session.add(user)
32 | db.session.commit()
33 | # generate the auth token
34 | auth_token = user.encode_auth_token(user.id)
35 | responseObject = {
36 | "status": "success",
37 | "message": "Successfully registered.",
38 | "auth_token": auth_token.decode(),
39 | }
40 | return make_response(jsonify(responseObject)), 201
41 | except Exception:
42 | responseObject = {
43 | "status": "fail",
44 | "message": "Some error occurred. Please try again.",
45 | }
46 | return make_response(jsonify(responseObject)), 401
47 | else:
48 | responseObject = {
49 | "status": "fail",
50 | "message": "User already exists. Please Log in.",
51 | }
52 | return make_response(jsonify(responseObject)), 409
53 |
--------------------------------------------------------------------------------
/src/views/auth/Logout.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=R0201
2 | from flask import request, make_response, jsonify
3 | from flask.views import MethodView
4 |
5 | from src import db
6 | from src.models import User, BlacklistToken
7 |
8 |
9 | class LogoutAPI(MethodView):
10 | """
11 | Logout Resource
12 | """
13 |
14 | def post(self):
15 | # get auth token
16 | auth_header = request.headers.get("Authorization")
17 | if auth_header:
18 | try:
19 | auth_token = auth_header.split(" ")[1]
20 | except IndexError:
21 | responseObject = {
22 | "status": "fail",
23 | "message": "Bearer token malformed.",
24 | }
25 | return make_response(jsonify(responseObject)), 401
26 | else:
27 | auth_token = None
28 | if auth_token:
29 | resp = User.decode_auth_token(auth_token)
30 | if not isinstance(resp, str):
31 | # mark the token as blacklisted
32 | blacklist_token = BlacklistToken(token=auth_token)
33 | try:
34 | # insert the token
35 | db.session.add(blacklist_token)
36 | db.session.commit()
37 | responseObject = {
38 | "status": "success",
39 | "message": "Successfully logged out.",
40 | }
41 | return make_response(jsonify(responseObject)), 200
42 | except Exception as e:
43 | responseObject = {"status": "fail", "message": e}
44 | return make_response(jsonify(responseObject)), 500
45 | else:
46 | responseObject = {"status": "fail", "message": resp}
47 | return make_response(jsonify(responseObject)), 401
48 | else:
49 | responseObject = {
50 | "status": "fail",
51 | "message": "Provide a valid auth token.",
52 | }
53 | return make_response(jsonify(responseObject)), 403
54 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flask Boilerplate
2 |
3 | [](https://github.com/YAS-opensource/flask-boilerplate/actions)
4 | [](https://codecov.io/gh/YAS-opensource/flask-boilerplate)
5 | [](https://codeclimate.com/github/YAS-opensource/flask-boilerplate/maintainability)
6 | [](https://app.codacy.com/gh/YAS-opensource/flask-boilerplate?utm_source=github.com&utm_medium=referral&utm_content=YAS-opensource/flask-boilerplate&utm_campaign=Badge_Grade_Settings)
7 |
8 | A boilerplate made for kick-starting your next flask project, with ready to go authentication(using JWT) module and a base REST api module. Godspeed!
9 |
10 | - Out of the box Authentication with JWT
11 | - And extendable base module to create new API endpoints with ease. Supported methods are: GET, POST
12 | - Out of the box Authentication checker decorator that you can add to any endpoint!
13 |
14 | ## Installing dependencies
15 |
16 | - Install and run dependencies on virtualenv:
17 |
18 | ```bash
19 | pipenv install
20 | pipenv run
21 | ```
22 |
23 | - Migrate the database:
24 |
25 | ```bash
26 | make create_db
27 | make db_init
28 | make db_migrate
29 | ```
30 |
31 | - Upgrade the database:
32 |
33 | ```bash
34 | make db_upgrade
35 | ```
36 |
37 | - Add a `.env` file. One is given here as an `example.env`, you must not use this file as is, always edit the secret key to a new secure key, when you develop your application. Modify other variables as per your necessary configuration for your own project.
38 |
39 | ## Usage
40 |
41 | - To run the project:
42 |
43 | ```bash
44 | make run
45 | ```
46 |
47 | Your server will run at
48 |
49 | > If you want to run the project on a different port, for example 8000, do this:
50 | >
51 | > ```bash
52 | > python manage.py runserver 8000
53 | > ```
54 |
55 | - To run tests:
56 |
57 | ```bash
58 | make test
59 | ```
60 |
61 | ## Documentations
62 |
63 | - Using `Base.py` to create custom views: [see wiki](https://github.com/YAS-opensource/flask-boilerplate/wiki/Base.py-superclass)
64 | - API endpoints: [see wiki](https://github.com/YAS-opensource/flask-boilerplate/wiki/API-endpoints)
65 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
131 | # vs code settings
132 | .vscode
133 |
134 | # SQLITE file
135 | *.db
136 |
137 | #temp files
138 | tmp/
--------------------------------------------------------------------------------
/migrations/env.py:
--------------------------------------------------------------------------------
1 | from __future__ import with_statement
2 |
3 | import logging
4 | from logging.config import fileConfig
5 |
6 | from sqlalchemy import engine_from_config
7 | from sqlalchemy import pool
8 |
9 | from alembic import context
10 |
11 | # this is the Alembic Config object, which provides
12 | # access to the values within the .ini file in use.
13 | config = context.config
14 |
15 | # Interpret the config file for Python logging.
16 | # This line sets up loggers basically.
17 | fileConfig(config.config_file_name)
18 | logger = logging.getLogger("alembic.env")
19 |
20 | # add your model's MetaData object here
21 | # for 'autogenerate' support
22 | # from myapp import mymodel
23 | # target_metadata = mymodel.Base.metadata
24 | from flask import current_app
25 |
26 | config.set_main_option(
27 | "sqlalchemy.url",
28 | str(current_app.extensions["migrate"].db.engine.url).replace("%", "%%"),
29 | )
30 | target_metadata = current_app.extensions["migrate"].db.metadata
31 |
32 | # other values from the config, defined by the needs of env.py,
33 | # can be acquired:
34 | # my_important_option = config.get_main_option("my_important_option")
35 | # ... etc.
36 |
37 |
38 | def run_migrations_offline():
39 | """Run migrations in 'offline' mode.
40 |
41 | This configures the context with just a URL
42 | and not an Engine, though an Engine is acceptable
43 | here as well. By skipping the Engine creation
44 | we don't even need a DBAPI to be available.
45 |
46 | Calls to context.execute() here emit the given string to the
47 | script output.
48 |
49 | """
50 | url = config.get_main_option("sqlalchemy.url")
51 | context.configure(url=url, target_metadata=target_metadata, literal_binds=True)
52 |
53 | with context.begin_transaction():
54 | context.run_migrations()
55 |
56 |
57 | def run_migrations_online():
58 | """Run migrations in 'online' mode.
59 |
60 | In this scenario we need to create an Engine
61 | and associate a connection with the context.
62 |
63 | """
64 |
65 | # this callback is used to prevent an auto-migration from being generated
66 | # when there are no changes to the schema
67 | # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
68 | def process_revision_directives(context, revision, directives):
69 | if getattr(config.cmd_opts, "autogenerate", False):
70 | script = directives[0]
71 | if script.upgrade_ops.is_empty():
72 | directives[:] = []
73 | logger.info("No changes in schema detected.")
74 |
75 | connectable = engine_from_config(
76 | config.get_section(config.config_ini_section),
77 | prefix="sqlalchemy.",
78 | poolclass=pool.NullPool,
79 | )
80 |
81 | with connectable.connect() as connection:
82 | context.configure(
83 | connection=connection,
84 | target_metadata=target_metadata,
85 | process_revision_directives=process_revision_directives,
86 | **current_app.extensions["migrate"].configure_args
87 | )
88 |
89 | with context.begin_transaction():
90 | context.run_migrations()
91 |
92 |
93 | if context.is_offline_mode():
94 | run_migrations_offline()
95 | else:
96 | run_migrations_online()
97 |
--------------------------------------------------------------------------------
/src/models.py:
--------------------------------------------------------------------------------
1 | # pylint: disable=401
2 | # pylint: disable=R0201
3 | import jwt
4 | import datetime
5 |
6 | from src import app, db, bcrypt
7 |
8 |
9 | class User(db.Model):
10 |
11 | """User Model for storing user related details."""
12 |
13 | __tablename__ = "users"
14 |
15 | id = db.Column(db.Integer, primary_key=True, autoincrement=True)
16 | username = db.Column(db.String(255), unique=True, nullable=False)
17 | password = db.Column(db.String(255), nullable=False)
18 | registered_on = db.Column(db.DateTime, nullable=False)
19 | account_type = db.Column(db.Integer, nullable=True)
20 |
21 | def __init__(self, username, password, account_type):
22 | self.username = username
23 | self.password = bcrypt.generate_password_hash(
24 | password, app.config.get("BCRYPT_LOG_ROUNDS")
25 | ).decode()
26 | self.registered_on = datetime.datetime.now()
27 | self.account_type = (
28 | account_type if account_type == 1 or account_type == 2 else None
29 | )
30 |
31 | def encode_auth_token(self, user_id):
32 | """
33 | Generates the Auth Token
34 | :return: string
35 | """
36 | try:
37 | payload = {
38 | "exp": datetime.datetime.utcnow()
39 | + datetime.timedelta(days=1, seconds=0),
40 | "iat": datetime.datetime.utcnow(),
41 | "sub": user_id,
42 | }
43 | return jwt.encode(payload, app.config.get("SECRET_KEY"), algorithm="HS256")
44 | except Exception as e:
45 | return e
46 |
47 | @staticmethod
48 | def decode_auth_token(auth_token):
49 | """
50 | Validates the auth token
51 | :param auth_token:
52 | :return: integer|string
53 | """
54 | try:
55 | payload = jwt.decode(
56 | auth_token, app.config.get("SECRET_KEY"), algorithms=["HS256"]
57 | )
58 | is_blacklisted_token = BlacklistToken.check_blacklist(auth_token)
59 | if is_blacklisted_token:
60 | return "Token blacklisted. Please log in again."
61 | else:
62 | return payload["sub"]
63 | except jwt.ExpiredSignatureError:
64 | return "Signature expired. Please log in again."
65 | except jwt.InvalidTokenError:
66 | return "Invalid token. Please log in again."
67 |
68 |
69 | class BlacklistToken(db.Model):
70 | """
71 | Token Model for storing JWT tokens
72 | """
73 |
74 | __tablename__ = "blacklist_tokens"
75 |
76 | id = db.Column(db.Integer, primary_key=True, autoincrement=True)
77 | token = db.Column(db.String(500), unique=True, nullable=False)
78 | blacklisted_on = db.Column(db.DateTime, nullable=False)
79 |
80 | def __init__(self, token):
81 | self.token = token
82 | self.blacklisted_on = datetime.datetime.now()
83 |
84 | def __repr__(self):
85 | return " 0 else False
6 |
7 | users = [
8 | ("user1", "user1", int(account_types["type1"]) if is_type else None),
9 | ("user2", "user2", int(account_types["type2"]) if is_type else None),
10 | ]
11 | non_registered_users = [
12 | ("user3", "user3", int(account_types["type1"]) if is_type else None),
13 | ("user4", "user4", int(account_types["type2"]) if is_type else None),
14 | ]
15 | resp_register = {}
16 |
17 |
18 | def base_register(client, data):
19 | return client.post(
20 | "/auth/register", data=json.dumps(data), content_type="application/json"
21 | )
22 |
23 |
24 | def base_login(client, data):
25 | return client.post(
26 | "/auth/login", data=json.dumps(data), content_type="application/json"
27 | )
28 |
29 |
30 | def base_auth_check(
31 | response, status, status_code, success_msg=None, is_auth_token=True
32 | ):
33 | data = json.loads(response.data.decode())
34 | assert data["status"] == status
35 | if success_msg:
36 | assert data["message"] == success_msg
37 | if is_auth_token:
38 | assert data["auth_token"]
39 | assert response.content_type == "application/json"
40 | assert response.status_code == status_code
41 |
42 |
43 | def test_registration(client, database):
44 | """User registration test."""
45 |
46 | for user in users:
47 | username = user[0]
48 | password = user[1]
49 | account_type = user[2]
50 |
51 | response = base_register(
52 | client,
53 | {"username": username, "password": password, "account_type": account_type,},
54 | )
55 |
56 | # set response of register to global var for later usage
57 | global resp_register
58 | resp_register[username] = response
59 |
60 | base_auth_check(
61 | response, "success", 201, "Successfully registered.",
62 | )
63 |
64 |
65 | def test_registered_with_already_registered_user(client, database):
66 | """Test registration with already registered email."""
67 |
68 | for user in users:
69 | username = user[0]
70 | password = user[1]
71 | account_type = user[2]
72 |
73 | response = base_register(
74 | client,
75 | {"username": username, "password": password, "account_type": account_type},
76 | )
77 | base_auth_check(
78 | response, "fail", 409, "User already exists. Please Log in.", False,
79 | )
80 |
81 |
82 | def test_registered_user_login(client, database):
83 | """Test for login of registered-user login."""
84 |
85 | for user in users:
86 | username = user[0]
87 | password = user[1]
88 |
89 | response = base_login(client, {"username": username, "password": password})
90 | base_auth_check(response, "success", 200, "Successfully logged in.")
91 |
92 |
93 | def test_non_registered_user_login(client, database):
94 | """Test for login of non-registered user."""
95 |
96 | for user in non_registered_users:
97 | username = user[0]
98 | password = user[1]
99 |
100 | response = base_login(client, {"username": username, "password": password})
101 | base_auth_check(response, "fail", 404, "User does not exist.", False)
102 |
103 |
104 | def test_user_status(client):
105 | """Test for user status."""
106 |
107 | for user in users:
108 | username = user[0]
109 | user_data = resp_register[username].data
110 |
111 | response = client.get(
112 | "/auth/status",
113 | headers={
114 | "Authorization": "Bearer "
115 | + json.loads(user_data.decode())["auth_token"]
116 | },
117 | )
118 |
119 | data = json.loads(response.data.decode())
120 | assert data["data"] is not None
121 | assert data["data"]["username"] == username
122 | base_auth_check(response, "success", 200, None, False)
123 |
124 |
125 | def test_user_status_malformed_bearer_token(client):
126 | """Test for user status with malformed bearer token."""
127 | for user in users:
128 | username = user[0]
129 | user_data = resp_register[username].data
130 |
131 | response = client.get(
132 | "/auth/status",
133 | headers={
134 | "Authorization": "Bearrr" + json.loads(user_data.decode())["auth_token"]
135 | },
136 | )
137 | base_auth_check(response, "fail", 401, "Bearer token malformed.", False)
138 |
139 |
140 | def test_valid_logout(client):
141 | """Testing logout before token expires."""
142 |
143 | for user in users:
144 | username = user[0]
145 | user_data = resp_register[username].data
146 |
147 | response = client.post(
148 | "/auth/logout",
149 | headers={
150 | "Authorization": "Bearer "
151 | + json.loads(user_data.decode())["auth_token"]
152 | },
153 | )
154 | base_auth_check(
155 | response, "success", 200, "Successfully logged out.", False,
156 | )
157 |
158 |
159 | def test_balcklisted_token_logout(client):
160 | """Testing blaclisted token logout before token expires."""
161 |
162 | for user in users:
163 | username = user[0]
164 | user_data = resp_register[username].data
165 |
166 | response = client.post(
167 | "/auth/logout",
168 | headers={
169 | "Authorization": "Bearer "
170 | + json.loads(user_data.decode())["auth_token"]
171 | },
172 | )
173 | base_auth_check(response, "fail", 401, is_auth_token=False)
174 |
--------------------------------------------------------------------------------
/Pipfile.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_meta": {
3 | "hash": {
4 | "sha256": "f2fb2e9270a58f398692d3f414913bacee191ec56e03eef903bfb6958786889d"
5 | },
6 | "pipfile-spec": 6,
7 | "requires": {
8 | "python_version": "3.8"
9 | },
10 | "sources": [
11 | {
12 | "name": "pypi",
13 | "url": "https://pypi.org/simple",
14 | "verify_ssl": true
15 | }
16 | ]
17 | },
18 | "default": {
19 | "alembic": {
20 | "hashes": [
21 | "sha256:035ab00497217628bf5d0be82d664d8713ab13d37b630084da8e1f98facf4dbf"
22 | ],
23 | "index": "pypi",
24 | "version": "==1.4.2"
25 | },
26 | "attrs": {
27 | "hashes": [
28 | "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6",
29 | "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"
30 | ],
31 | "markers": "python_version >= '3.5'",
32 | "version": "==22.1.0"
33 | },
34 | "bcrypt": {
35 | "hashes": [
36 | "sha256:0258f143f3de96b7c14f762c770f5fc56ccd72f8a1857a451c1cd9a655d9ac89",
37 | "sha256:0b0069c752ec14172c5f78208f1863d7ad6755a6fae6fe76ec2c80d13be41e42",
38 | "sha256:19a4b72a6ae5bb467fea018b825f0a7d917789bcfe893e53f15c92805d187294",
39 | "sha256:436a487dec749bca7e6e72498a75a5fa2433bda13bac91d023e18df9089ae0b8",
40 | "sha256:5432dd7b34107ae8ed6c10a71b4397f1c853bd39a4d6ffa7e35f40584cffd161",
41 | "sha256:6305557019906466fc42dbc53b46da004e72fd7a551c044a827e572c82191752",
42 | "sha256:69361315039878c0680be456640f8705d76cb4a3a3fe1e057e0f261b74be4b31",
43 | "sha256:6fe49a60b25b584e2f4ef175b29d3a83ba63b3a4df1b4c0605b826668d1b6be5",
44 | "sha256:74a015102e877d0ccd02cdeaa18b32aa7273746914a6c5d0456dd442cb65b99c",
45 | "sha256:763669a367869786bb4c8fcf731f4175775a5b43f070f50f46f0b59da45375d0",
46 | "sha256:8b10acde4e1919d6015e1df86d4c217d3b5b01bb7744c36113ea43d529e1c3de",
47 | "sha256:9fe92406c857409b70a38729dbdf6578caf9228de0aef5bc44f859ffe971a39e",
48 | "sha256:a190f2a5dbbdbff4b74e3103cef44344bc30e61255beb27310e2aec407766052",
49 | "sha256:a595c12c618119255c90deb4b046e1ca3bcfad64667c43d1166f2b04bc72db09",
50 | "sha256:c9457fa5c121e94a58d6505cadca8bed1c64444b83b3204928a866ca2e599105",
51 | "sha256:cb93f6b2ab0f6853550b74e051d297c27a638719753eb9ff66d1e4072be67133",
52 | "sha256:ce4e4f0deb51d38b1611a27f330426154f2980e66582dc5f438aad38b5f24fc1",
53 | "sha256:d7bdc26475679dd073ba0ed2766445bb5b20ca4793ca0db32b399dccc6bc84b7",
54 | "sha256:ff032765bb8716d9387fd5376d987a937254b0619eff0972779515b5c98820bc"
55 | ],
56 | "index": "pypi",
57 | "version": "==3.1.7"
58 | },
59 | "cffi": {
60 | "hashes": [
61 | "sha256:001bf3242a1bb04d985d63e138230802c6c8d4db3668fb545fb5005ddf5bb5ff",
62 | "sha256:00789914be39dffba161cfc5be31b55775de5ba2235fe49aa28c148236c4e06b",
63 | "sha256:028a579fc9aed3af38f4892bdcc7390508adabc30c6af4a6e4f611b0c680e6ac",
64 | "sha256:14491a910663bf9f13ddf2bc8f60562d6bc5315c1f09c704937ef17293fb85b0",
65 | "sha256:1cae98a7054b5c9391eb3249b86e0e99ab1e02bb0cc0575da191aedadbdf4384",
66 | "sha256:2089ed025da3919d2e75a4d963d008330c96751127dd6f73c8dc0c65041b4c26",
67 | "sha256:2d384f4a127a15ba701207f7639d94106693b6cd64173d6c8988e2c25f3ac2b6",
68 | "sha256:337d448e5a725bba2d8293c48d9353fc68d0e9e4088d62a9571def317797522b",
69 | "sha256:399aed636c7d3749bbed55bc907c3288cb43c65c4389964ad5ff849b6370603e",
70 | "sha256:3b911c2dbd4f423b4c4fcca138cadde747abdb20d196c4a48708b8a2d32b16dd",
71 | "sha256:3d311bcc4a41408cf5854f06ef2c5cab88f9fded37a3b95936c9879c1640d4c2",
72 | "sha256:62ae9af2d069ea2698bf536dcfe1e4eed9090211dbaafeeedf5cb6c41b352f66",
73 | "sha256:66e41db66b47d0d8672d8ed2708ba91b2f2524ece3dee48b5dfb36be8c2f21dc",
74 | "sha256:675686925a9fb403edba0114db74e741d8181683dcf216be697d208857e04ca8",
75 | "sha256:7e63cbcf2429a8dbfe48dcc2322d5f2220b77b2e17b7ba023d6166d84655da55",
76 | "sha256:8a6c688fefb4e1cd56feb6c511984a6c4f7ec7d2a1ff31a10254f3c817054ae4",
77 | "sha256:8c0ffc886aea5df6a1762d0019e9cb05f825d0eec1f520c51be9d198701daee5",
78 | "sha256:95cd16d3dee553f882540c1ffe331d085c9e629499ceadfbda4d4fde635f4b7d",
79 | "sha256:99f748a7e71ff382613b4e1acc0ac83bf7ad167fb3802e35e90d9763daba4d78",
80 | "sha256:b8c78301cefcf5fd914aad35d3c04c2b21ce8629b5e4f4e45ae6812e461910fa",
81 | "sha256:c420917b188a5582a56d8b93bdd8e0f6eca08c84ff623a4c16e809152cd35793",
82 | "sha256:c43866529f2f06fe0edc6246eb4faa34f03fe88b64a0a9a942561c8e22f4b71f",
83 | "sha256:cab50b8c2250b46fe738c77dbd25ce017d5e6fb35d3407606e7a4180656a5a6a",
84 | "sha256:cef128cb4d5e0b3493f058f10ce32365972c554572ff821e175dbc6f8ff6924f",
85 | "sha256:cf16e3cf6c0a5fdd9bc10c21687e19d29ad1fe863372b5543deaec1039581a30",
86 | "sha256:e56c744aa6ff427a607763346e4170629caf7e48ead6921745986db3692f987f",
87 | "sha256:e577934fc5f8779c554639376beeaa5657d54349096ef24abe8c74c5d9c117c3",
88 | "sha256:f2b0fa0c01d8a0c7483afd9f31d7ecf2d71760ca24499c8697aeb5ca37dc090c"
89 | ],
90 | "index": "pypi",
91 | "version": "==1.14.0"
92 | },
93 | "click": {
94 | "hashes": [
95 | "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a",
96 | "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"
97 | ],
98 | "index": "pypi",
99 | "version": "==7.1.2"
100 | },
101 | "coverage": {
102 | "hashes": [
103 | "sha256:01778769097dbd705a24e221f42be885c544bb91251747a8a3efdec6eb4788f2",
104 | "sha256:08002f9251f51afdcc5e3adf5d5d66bb490ae893d9e21359b085f0e03390a820",
105 | "sha256:1238b08f3576201ebf41f7c20bf59baa0d05da941b123c6656e42cdb668e9827",
106 | "sha256:14a32ec68d721c3d714d9b105c7acf8e0f8a4f4734c811eda75ff3718570b5e3",
107 | "sha256:15e38d853ee224e92ccc9a851457fb1e1f12d7a5df5ae44544ce7863691c7a0d",
108 | "sha256:354df19fefd03b9a13132fa6643527ef7905712109d9c1c1903f2133d3a4e145",
109 | "sha256:35ef1f8d8a7a275aa7410d2f2c60fa6443f4a64fae9be671ec0696a68525b875",
110 | "sha256:4179502f210ebed3ccfe2f78bf8e2d59e50b297b598b100d6c6e3341053066a2",
111 | "sha256:42c499c14efd858b98c4e03595bf914089b98400d30789511577aa44607a1b74",
112 | "sha256:4b7101938584d67e6f45f0015b60e24a95bf8dea19836b1709a80342e01b472f",
113 | "sha256:564cd0f5b5470094df06fab676c6d77547abfdcb09b6c29c8a97c41ad03b103c",
114 | "sha256:5f444627b3664b80d078c05fe6a850dd711beeb90d26731f11d492dcbadb6973",
115 | "sha256:6113e4df2fa73b80f77663445be6d567913fb3b82a86ceb64e44ae0e4b695de1",
116 | "sha256:61b993f3998ee384935ee423c3d40894e93277f12482f6e777642a0141f55782",
117 | "sha256:66e6df3ac4659a435677d8cd40e8eb1ac7219345d27c41145991ee9bf4b806a0",
118 | "sha256:67f9346aeebea54e845d29b487eb38ec95f2ecf3558a3cffb26ee3f0dcc3e760",
119 | "sha256:6913dddee2deff8ab2512639c5168c3e80b3ebb0f818fed22048ee46f735351a",
120 | "sha256:6a864733b22d3081749450466ac80698fe39c91cb6849b2ef8752fd7482011f3",
121 | "sha256:7026f5afe0d1a933685d8f2169d7c2d2e624f6255fb584ca99ccca8c0e966fd7",
122 | "sha256:783bc7c4ee524039ca13b6d9b4186a67f8e63d91342c713e88c1865a38d0892a",
123 | "sha256:7a98d6bf6d4ca5c07a600c7b4e0c5350cd483c85c736c522b786be90ea5bac4f",
124 | "sha256:8d032bfc562a52318ae05047a6eb801ff31ccee172dc0d2504614e911d8fa83e",
125 | "sha256:98c0b9e9b572893cdb0a00e66cf961a238f8d870d4e1dc8e679eb8bdc2eb1b86",
126 | "sha256:9c7b9b498eb0c0d48b4c2abc0e10c2d78912203f972e0e63e3c9dc21f15abdaa",
127 | "sha256:9cc4f107009bca5a81caef2fca843dbec4215c05e917a59dec0c8db5cff1d2aa",
128 | "sha256:9d6e1f3185cbfd3d91ac77ea065d85d5215d3dfa45b191d14ddfcd952fa53796",
129 | "sha256:a095aa0a996ea08b10580908e88fbaf81ecf798e923bbe64fb98d1807db3d68a",
130 | "sha256:a3b2752de32c455f2521a51bd3ffb53c5b3ae92736afde67ce83477f5c1dd928",
131 | "sha256:ab066f5ab67059d1f1000b5e1aa8bbd75b6ed1fc0014559aea41a9eb66fc2ce0",
132 | "sha256:c1328d0c2f194ffda30a45f11058c02410e679456276bfa0bbe0b0ee87225fac",
133 | "sha256:c35cca192ba700979d20ac43024a82b9b32a60da2f983bec6c0f5b84aead635c",
134 | "sha256:cbbb0e4cd8ddcd5ef47641cfac97d8473ab6b132dd9a46bacb18872828031685",
135 | "sha256:cdbb0d89923c80dbd435b9cf8bba0ff55585a3cdb28cbec65f376c041472c60d",
136 | "sha256:cf2afe83a53f77aec067033199797832617890e15bed42f4a1a93ea24794ae3e",
137 | "sha256:d5dd4b8e9cd0deb60e6fcc7b0647cbc1da6c33b9e786f9c79721fd303994832f",
138 | "sha256:dfa0b97eb904255e2ab24166071b27408f1f69c8fbda58e9c0972804851e0558",
139 | "sha256:e16c45b726acb780e1e6f88b286d3c10b3914ab03438f32117c4aa52d7f30d58",
140 | "sha256:e1fabd473566fce2cf18ea41171d92814e4ef1495e04471786cbc943b89a3781",
141 | "sha256:e3d3c4cc38b2882f9a15bafd30aec079582b819bec1b8afdbde8f7797008108a",
142 | "sha256:e431e305a1f3126477abe9a184624a85308da8edf8486a863601d58419d26ffa",
143 | "sha256:e7b4da9bafad21ea45a714d3ea6f3e1679099e420c8741c74905b92ee9bfa7cc",
144 | "sha256:ee2b2fb6eb4ace35805f434e0f6409444e1466a47f620d1d5763a22600f0f892",
145 | "sha256:ee6ae6bbcac0786807295e9687169fba80cb0617852b2fa118a99667e8e6815d",
146 | "sha256:ef6f44409ab02e202b31a05dd6666797f9de2aa2b4b3534e9d450e42dea5e817",
147 | "sha256:f67cf9f406cf0d2f08a3515ce2db5b82625a7257f88aad87904674def6ddaec1",
148 | "sha256:f855b39e4f75abd0dfbcf74a82e84ae3fc260d523fcb3532786bcbbcb158322c",
149 | "sha256:fc600f6ec19b273da1d85817eda339fb46ce9eef3e89f220055d8696e0a06908",
150 | "sha256:fcbe3d9a53e013f8ab88734d7e517eb2cd06b7e689bedf22c0eb68db5e4a0a19",
151 | "sha256:fde17bc42e0716c94bf19d92e4c9f5a00c5feb401f5bc01101fdf2a8b7cacf60",
152 | "sha256:ff934ced84054b9018665ca3967fc48e1ac99e811f6cc99ea65978e1d384454b"
153 | ],
154 | "markers": "python_version >= '3.7'",
155 | "version": "==6.4.4"
156 | },
157 | "flask": {
158 | "hashes": [
159 | "sha256:4efa1ae2d7c9865af48986de8aeb8504bf32c7f3d6fdc9353d34b21f4b127060",
160 | "sha256:8a4fdd8936eba2512e9c85df320a37e694c93945b33ef33c89946a340a238557"
161 | ],
162 | "index": "pypi",
163 | "version": "==1.1.2"
164 | },
165 | "flask-bcrypt": {
166 | "hashes": [
167 | "sha256:d71c8585b2ee1c62024392ebdbc447438564e2c8c02b4e57b56a4cafd8d13c5f"
168 | ],
169 | "index": "pypi",
170 | "version": "==0.7.1"
171 | },
172 | "flask-cors": {
173 | "hashes": [
174 | "sha256:6bcfc100288c5d1bcb1dbb854babd59beee622ffd321e444b05f24d6d58466b8",
175 | "sha256:cee4480aaee421ed029eaa788f4049e3e26d15b5affb6a880dade6bafad38324"
176 | ],
177 | "index": "pypi",
178 | "version": "==3.0.9"
179 | },
180 | "flask-migrate": {
181 | "hashes": [
182 | "sha256:4dc4a5cce8cbbb06b8dc963fd86cf8136bd7d875aabe2d840302ea739b243732",
183 | "sha256:a69d508c2e09d289f6e55a417b3b8c7bfe70e640f53d2d9deb0d056a384f37ee"
184 | ],
185 | "index": "pypi",
186 | "version": "==2.5.3"
187 | },
188 | "flask-script": {
189 | "hashes": [
190 | "sha256:6425963d91054cfcc185807141c7314a9c5ad46325911bd24dcb489bd0161c65"
191 | ],
192 | "index": "pypi",
193 | "version": "==2.0.6"
194 | },
195 | "flask-sqlalchemy": {
196 | "hashes": [
197 | "sha256:0078d8663330dc05a74bc72b3b6ddc441b9a744e2f56fe60af1a5bfc81334327",
198 | "sha256:6974785d913666587949f7c2946f7001e4fa2cb2d19f4e69ead02e4b8f50b33d"
199 | ],
200 | "index": "pypi",
201 | "version": "==2.4.1"
202 | },
203 | "gunicorn": {
204 | "hashes": [
205 | "sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626",
206 | "sha256:cd4a810dd51bf497552cf3f863b575dabd73d6ad6a91075b65936b151cbf4f9c"
207 | ],
208 | "index": "pypi",
209 | "version": "==20.0.4"
210 | },
211 | "itsdangerous": {
212 | "hashes": [
213 | "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19",
214 | "sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"
215 | ],
216 | "index": "pypi",
217 | "version": "==1.1.0"
218 | },
219 | "jinja2": {
220 | "hashes": [
221 | "sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419",
222 | "sha256:a6d58433de0ae800347cab1fa3043cebbabe8baa9d29e668f1c768cb87a333c6"
223 | ],
224 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
225 | "version": "==2.11.3"
226 | },
227 | "mako": {
228 | "hashes": [
229 | "sha256:3724869b363ba630a272a5f89f68c070352137b8fd1757650017b7e06fda163f",
230 | "sha256:8efcb8004681b5f71d09c983ad5a9e6f5c40601a6ec469148753292abc0da534"
231 | ],
232 | "index": "pypi",
233 | "version": "==1.2.2"
234 | },
235 | "markupsafe": {
236 | "hashes": [
237 | "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
238 | "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
239 | "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
240 | "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
241 | "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42",
242 | "sha256:195d7d2c4fbb0ee8139a6cf67194f3973a6b3042d742ebe0a9ed36d8b6f0c07f",
243 | "sha256:22c178a091fc6630d0d045bdb5992d2dfe14e3259760e713c490da5323866c39",
244 | "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
245 | "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
246 | "sha256:2beec1e0de6924ea551859edb9e7679da6e4870d32cb766240ce17e0a0ba2014",
247 | "sha256:3b8a6499709d29c2e2399569d96719a1b21dcd94410a586a18526b143ec8470f",
248 | "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
249 | "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
250 | "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
251 | "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
252 | "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b",
253 | "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
254 | "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15",
255 | "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
256 | "sha256:6f1e273a344928347c1290119b493a1f0303c52f5a5eae5f16d74f48c15d4a85",
257 | "sha256:6fffc775d90dcc9aed1b89219549b329a9250d918fd0b8fa8d93d154918422e1",
258 | "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
259 | "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
260 | "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
261 | "sha256:7fed13866cf14bba33e7176717346713881f56d9d2bcebab207f7a036f41b850",
262 | "sha256:84dee80c15f1b560d55bcfe6d47b27d070b4681c699c572af2e3c7cc90a3b8e0",
263 | "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
264 | "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
265 | "sha256:98bae9582248d6cf62321dcb52aaf5d9adf0bad3b40582925ef7c7f0ed85fceb",
266 | "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
267 | "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
268 | "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
269 | "sha256:a6a744282b7718a2a62d2ed9d993cad6f5f585605ad352c11de459f4108df0a1",
270 | "sha256:acf08ac40292838b3cbbb06cfe9b2cb9ec78fce8baca31ddb87aaac2e2dc3bc2",
271 | "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
272 | "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
273 | "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
274 | "sha256:b1dba4527182c95a0db8b6060cc98ac49b9e2f5e64320e2b56e47cb2831978c7",
275 | "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
276 | "sha256:b7d644ddb4dbd407d31ffb699f1d140bc35478da613b441c582aeb7c43838dd8",
277 | "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
278 | "sha256:bf5aa3cbcfdf57fa2ee9cd1822c862ef23037f5c832ad09cfea57fa846dec193",
279 | "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
280 | "sha256:caabedc8323f1e93231b52fc32bdcde6db817623d33e100708d9a68e1f53b26b",
281 | "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
282 | "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2",
283 | "sha256:d53bc011414228441014aa71dbec320c66468c1030aae3a6e29778a3382d96e5",
284 | "sha256:d73a845f227b0bfe8a7455ee623525ee656a9e2e749e4742706d80a6065d5e2c",
285 | "sha256:d9be0ba6c527163cbed5e0857c451fcd092ce83947944d6c14bc95441203f032",
286 | "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7",
287 | "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be",
288 | "sha256:feb7b34d6325451ef96bc0e36e1a6c0c1c64bc1fbec4b854f4529e51887b1621"
289 | ],
290 | "index": "pypi",
291 | "version": "==1.1.1"
292 | },
293 | "more-itertools": {
294 | "hashes": [
295 | "sha256:1bc4f91ee5b1b31ac7ceacc17c09befe6a40a503907baf9c839c229b5095cfd2",
296 | "sha256:c09443cd3d5438b8dafccd867a6bc1cb0894389e90cb53d227456b0b0bccb750"
297 | ],
298 | "markers": "python_version >= '3.5'",
299 | "version": "==8.14.0"
300 | },
301 | "packaging": {
302 | "hashes": [
303 | "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb",
304 | "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"
305 | ],
306 | "markers": "python_version >= '3.6'",
307 | "version": "==21.3"
308 | },
309 | "pluggy": {
310 | "hashes": [
311 | "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",
312 | "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"
313 | ],
314 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
315 | "version": "==0.13.1"
316 | },
317 | "psycopg2": {
318 | "hashes": [
319 | "sha256:132efc7ee46a763e68a815f4d26223d9c679953cd190f1f218187cb60decf535",
320 | "sha256:2327bf42c1744a434ed8ed0bbaa9168cac7ee5a22a9001f6fc85c33b8a4a14b7",
321 | "sha256:27c633f2d5db0fc27b51f1b08f410715b59fa3802987aec91aeb8f562724e95c",
322 | "sha256:2c0afb40cfb4d53487ee2ebe128649028c9a78d2476d14a67781e45dc287f080",
323 | "sha256:2df2bf1b87305bd95eb3ac666ee1f00a9c83d10927b8144e8e39644218f4cf81",
324 | "sha256:440a3ea2c955e89321a138eb7582aa1d22fe286c7d65e26a2c5411af0a88ae72",
325 | "sha256:6a471d4d2a6f14c97a882e8d3124869bc623f3df6177eefe02994ea41fd45b52",
326 | "sha256:6b306dae53ec7f4f67a10942cf8ac85de930ea90e9903e2df4001f69b7833f7e",
327 | "sha256:a0984ff49e176062fcdc8a5a2a670c9bb1704a2f69548bce8f8a7bad41c661bf",
328 | "sha256:ac5b23d0199c012ad91ed1bbb971b7666da651c6371529b1be8cbe2a7bf3c3a9",
329 | "sha256:acf56d564e443e3dea152efe972b1434058244298a94348fc518d6dd6a9fb0bb",
330 | "sha256:d3b29d717d39d3580efd760a9a46a7418408acebbb784717c90d708c9ed5f055",
331 | "sha256:f7d46240f7a1ae1dd95aab38bd74f7428d46531f69219954266d669da60c0818"
332 | ],
333 | "index": "pypi",
334 | "version": "==2.8.5"
335 | },
336 | "py": {
337 | "hashes": [
338 | "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719",
339 | "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"
340 | ],
341 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'",
342 | "version": "==1.11.0"
343 | },
344 | "pycparser": {
345 | "hashes": [
346 | "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0",
347 | "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"
348 | ],
349 | "index": "pypi",
350 | "version": "==2.20"
351 | },
352 | "pyjwt": {
353 | "hashes": [
354 | "sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf",
355 | "sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba"
356 | ],
357 | "index": "pypi",
358 | "version": "==2.4.0"
359 | },
360 | "pyparsing": {
361 | "hashes": [
362 | "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb",
363 | "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"
364 | ],
365 | "markers": "python_full_version >= '3.6.8'",
366 | "version": "==3.0.9"
367 | },
368 | "pytest": {
369 | "hashes": [
370 | "sha256:95c710d0a72d91c13fae35dce195633c929c3792f54125919847fdcdf7caa0d3",
371 | "sha256:eb2b5e935f6a019317e455b6da83dd8650ac9ffd2ee73a7b657a30873d67a698"
372 | ],
373 | "index": "pypi",
374 | "version": "==5.4.2"
375 | },
376 | "pytest-cov": {
377 | "hashes": [
378 | "sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b",
379 | "sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626"
380 | ],
381 | "index": "pypi",
382 | "version": "==2.8.1"
383 | },
384 | "python-dateutil": {
385 | "hashes": [
386 | "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86",
387 | "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"
388 | ],
389 | "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
390 | "version": "==2.8.2"
391 | },
392 | "python-dotenv": {
393 | "hashes": [
394 | "sha256:25c0ff1a3e12f4bde8d592cc254ab075cfe734fc5dd989036716fd17ee7e5ec7",
395 | "sha256:3b9909bc96b0edc6b01586e1eed05e71174ef4e04c71da5786370cebea53ad74"
396 | ],
397 | "index": "pypi",
398 | "version": "==0.13.0"
399 | },
400 | "python-editor": {
401 | "hashes": [
402 | "sha256:1bf6e860a8ad52a14c3ee1252d5dc25b2030618ed80c022598f00176adc8367d",
403 | "sha256:51fda6bcc5ddbbb7063b2af7509e43bd84bfc32a4ff71349ec7847713882327b",
404 | "sha256:5f98b069316ea1c2ed3f67e7f5df6c0d8f10b689964a4a811ff64f0106819ec8",
405 | "sha256:c3da2053dbab6b29c94e43c486ff67206eafbe7eb52dbec7390b5e2fb05aac77",
406 | "sha256:ea87e17f6ec459e780e4221f295411462e0d0810858e055fc514684350a2f522"
407 | ],
408 | "version": "==1.0.4"
409 | },
410 | "setuptools": {
411 | "hashes": [
412 | "sha256:2e24e0bec025f035a2e72cdd1961119f557d78ad331bb00ff82efb2ab8da8e82",
413 | "sha256:7732871f4f7fa58fb6bdcaeadb0161b2bd046c85905dbaa066bdcbcc81953b57"
414 | ],
415 | "markers": "python_version >= '3.7'",
416 | "version": "==65.3.0"
417 | },
418 | "six": {
419 | "hashes": [
420 | "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a",
421 | "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"
422 | ],
423 | "index": "pypi",
424 | "version": "==1.14.0"
425 | },
426 | "sqlalchemy": {
427 | "hashes": [
428 | "sha256:083e383a1dca8384d0ea6378bd182d83c600ed4ff4ec8247d3b2442cf70db1ad",
429 | "sha256:0a690a6486658d03cc6a73536d46e796b6570ac1f8a7ec133f9e28c448b69828",
430 | "sha256:114b6ace30001f056e944cebd46daef38fdb41ebb98f5e5940241a03ed6cad43",
431 | "sha256:128f6179325f7597a46403dde0bf148478f868df44841348dfc8d158e00db1f9",
432 | "sha256:13d48cd8b925b6893a4e59b2dfb3e59a5204fd8c98289aad353af78bd214db49",
433 | "sha256:211a1ce7e825f7142121144bac76f53ac28b12172716a710f4bf3eab477e730b",
434 | "sha256:2dc57ee80b76813759cccd1a7affedf9c4dbe5b065a91fb6092c9d8151d66078",
435 | "sha256:3e625e283eecc15aee5b1ef77203bfb542563fa4a9aa622c7643c7b55438ff49",
436 | "sha256:43078c7ec0457387c79b8d52fff90a7ad352ca4c7aa841c366238c3e2cf52fdf",
437 | "sha256:5b1bf3c2c2dca738235ce08079783ef04f1a7fc5b21cf24adaae77f2da4e73c3",
438 | "sha256:6056b671aeda3fc451382e52ab8a753c0d5f66ef2a5ccc8fa5ba7abd20988b4d",
439 | "sha256:68d78cf4a9dfade2e6cf57c4be19f7b82ed66e67dacf93b32bb390c9bed12749",
440 | "sha256:7025c639ce7e170db845e94006cf5f404e243e6fc00d6c86fa19e8ad8d411880",
441 | "sha256:7224e126c00b8178dfd227bc337ba5e754b197a3867d33b9f30dc0208f773d70",
442 | "sha256:7d98e0785c4cd7ae30b4a451416db71f5724a1839025544b4edbd92e00b91f0f",
443 | "sha256:8d8c21e9d4efef01351bf28513648ceb988031be4159745a7ad1b3e28c8ff68a",
444 | "sha256:bbb545da054e6297242a1bb1ba88e7a8ffb679f518258d66798ec712b82e4e07",
445 | "sha256:d00b393f05dbd4ecd65c989b7f5a81110eae4baea7a6a4cdd94c20a908d1456e",
446 | "sha256:e18752cecaef61031252ca72031d4d6247b3212ebb84748fc5d1a0d2029c23ea"
447 | ],
448 | "index": "pypi",
449 | "version": "==1.3.16"
450 | },
451 | "wcwidth": {
452 | "hashes": [
453 | "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784",
454 | "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
455 | ],
456 | "version": "==0.2.5"
457 | },
458 | "werkzeug": {
459 | "hashes": [
460 | "sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43",
461 | "sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c"
462 | ],
463 | "index": "pypi",
464 | "version": "==1.0.1"
465 | }
466 | },
467 | "develop": {}
468 | }
469 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------