Skip to content

Commit

Permalink
Merge pull request #181 from KOSASIH/deepsource-transform-fac18bbf
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 12, 2024
2 parents bf43bdf + 9917583 commit 6fb44a8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions identity_verifier/identity_verifier/api.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
from flask import Flask, request, jsonify
from flask import Flask, jsonify, request

from identity_verifier.biometrics import BiometricVerifier

app = Flask(__name__)

@app.route('/verify', methods=['POST'])

@app.route("/verify", methods=["POST"])
def verify():
# Get the image from the request
image = request.files['image'].read()
image = request.files["image"].read()

# Verify the identity
verifier = BiometricVerifier('facial_recognition')
verifier = BiometricVerifier("facial_recognition")
is_verified = verifier.verify(image)

# Return the result
return jsonify({'is_verified': is_verified})
return jsonify({"is_verified": is_verified})

@app.route('/biometrics', methods=['GET'])

@app.route("/biometrics", methods=["GET"])
def biometrics():
# Return a list of available biometric verification methods
return jsonify({'biometrics': ['facial_recognition']})
return jsonify({"biometrics": ["facial_recognition"]})


if __name__ == '__main__':
if __name__ == "__main__":
app.run(debug=True)

0 comments on commit 6fb44a8

Please sign in to comment.