from flask import Flask from flask import Flask, request, jsonify from tfa import * app = Flask(__name__) store = customstore() @app.route('/') def hello_world(): return """Hello, World! This is an authentication server Available directories are: /c to create a key /a to authorise a key /v to verify that a key is authorised """ @app.route('/c', methods=['GET']) def create(): return store.create() @app.route('/a/', methods=['GET']) def authenticate(code): if store.authenticate(code): return "True" else: return "False" @app.route('/v/', methods=['GET']) def verify(code): if store.check(code): return "True" else: return "False" if __name__ == '__main__': app.run(host='0.0.0.0', port=5000, debug=True)