|
@@ -10,6 +10,10 @@ secret = Blueprint('secret', __name__)
|
|
|
|
|
|
@secret.route('/znwr/jit/ai/v1/crypto-label', methods=['POST'])
|
|
|
def gen_crypto_label():
|
|
|
+ """
|
|
|
+ 生成密码标签
|
|
|
+ :return: 密码标签
|
|
|
+ """
|
|
|
gen_label_form = GenLabelFormSchema().load(request.json) # 反序列化 JSON 数据为对象
|
|
|
info = gen_label_form.info
|
|
|
owner = info.owner
|
|
@@ -20,8 +24,24 @@ def gen_crypto_label():
|
|
|
return GenLabelRespSchema().dump(resp)
|
|
|
|
|
|
|
|
|
+@secret.route('/znwr/jit/ai/v1/crypto-check', methods=['POST'])
|
|
|
+def check_sign_verify():
|
|
|
+ """
|
|
|
+ 密码标签功能自检
|
|
|
+ :return: 自检结果
|
|
|
+ """
|
|
|
+ label = secret_func.get_secret(512)
|
|
|
+ result = secret_func.verify(label)
|
|
|
+ resp = VerifyLabelResp(code=0, msg='ok') if result else VerifyLabelResp(code=-1, msg='verify error')
|
|
|
+ return VerifyLabelRespSchema().dump(resp)
|
|
|
+
|
|
|
+
|
|
|
@secret.route('/znwr/jit/ai/v1/verify-label', methods=['POST'])
|
|
|
def verify_crypto_label():
|
|
|
+ """
|
|
|
+ 密码标签验证
|
|
|
+ :return: 验证结果
|
|
|
+ """
|
|
|
verify_label_form = VerifyLabelFormSchema().load(request.json)
|
|
|
label = verify_label_form.label
|
|
|
info = verify_label_form.info
|