示例#1
0
from src.utils.classifier import Classifier


if __name__ == '__main__':
    print(Classifier.__doc__)
    print(Classifier.classify(input('Password: ')))
示例#2
0
 def test_strong_3(self):
     self.assertEqual(Classifier.classify('5mgYm}jUy4pO0fl2gV94IK5~'), 2)
示例#3
0
 def test_weak_2(self):
     self.assertEqual(Classifier.classify('aaaaaaaa'), 0)
示例#4
0
 def test_strong_1(self):
     self.assertEqual(Classifier.classify('ah5@gn/4@%7U2F3'), 2)
示例#5
0
 def test_strong_2(self):
     self.assertEqual(Classifier.classify('89?>2&2/v>[7c&a7.5ts6}2,=g+D'),
                      2)
示例#6
0
 def test_good_3(self):
     self.assertEqual(Classifier.classify('0351garttb'), 1)
示例#7
0
 def test_good_2(self):
     self.assertEqual(Classifier.classify('3RgTaaaa$123'), 1)
示例#8
0
 def test_good_1(self):
     self.assertEqual(Classifier.classify('sfdsdfsd33257'), 1)
示例#9
0
 def test_weak_3(self):
     self.assertEqual(Classifier.classify('abcdefgh'), 0)
from src.utils.connect import Connector

import datetime

from src.utils.ocr import Reader

app = Flask(__name__)
jwt = JWTManager(app)
app.config.from_json('../resources/config.json')
cors = CORS(app)
reader = Reader()
connector = Connector(DB_CONFIG["host"], DB_CONFIG["port"])
connector.connect(DB_CONFIG["db_name"])
basic_processor = BasicProcessor()
authenticator = Authenticator(db_connector=connector)
classifier = Classifier()
traces = []


@app.route("/health_check", methods=["GET"])
@cross_origin()
def health_check():
    resp = jsonify(datetime.datetime.now())
    resp.status_code = 201
    return resp


@app.route("/auth/signin", methods=["POST"])
def sign_in():
    try:
        credentials = json.loads(request.data.decode('utf-8'))