Loading capif_backend/backoffice_service/__main__.py +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ app = Flask(__name__) CORS(app) # Register blueprints (routes) # otra opciones modificar URL -> app.register_blueprint(backoffice_routes, url_prefix="/resources") # other option modify URL -> app.register_blueprint(backoffice_routes, url_prefix="/resources") app.register_blueprint(backoffice_routes) app.register_blueprint(access_routes) Loading capif_backend/backoffice_service/controllers/default_controller.py +0 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ from flask_jwt_extended import jwt_required, get_jwt_identity backoffice_routes = Blueprint("backoffice_routes", __name__) operations = Operations() # create operations object -> operations.py # https://10.95.82.71:8085 /resources/invokers @backoffice_routes.route("/resources/invokers", methods=["GET"]) @jwt_required() def get_invokers(): Loading capif_backend/backoffice_service/controllers/login.py +1 −10 Original line number Diff line number Diff line Loading @@ -5,17 +5,11 @@ from flask_jwt_extended import JWTManager, jwt_required, create_access_token, cr # create blueprint backoffice_routes access_routes = Blueprint("acces_routes", __name__) # Crea una ruta para autenticar a los usuarios y devolver el token JWT. # La función create_access_token() se utiliza para generar el JWT. @access_routes.route("/login", methods=["POST"]) def login(): username = request.form.get("username", None) password = request.form.get("password", None) #username = request.json.get("username", None) #password = request.json.get("password", None) #username = request().form['username'] #password = request().form['password'] print("username: ", username) print("password: ", password) Loading @@ -23,7 +17,7 @@ def login(): print("Bad username or password") return jsonify({"msg": "Bad username or password"}), 401 # identity es un dato serializable en json -> username = superadmin # identity is a data that can be serialized in json -> username = superadmin access_token = create_access_token(identity=username, expires_delta=False) refresh_token = create_refresh_token(identity=username) Loading @@ -36,10 +30,7 @@ def refresh(): new_access_token = create_access_token(identity=current_user) return jsonify(access_token=new_access_token) #https://10.95.82.71:8085/auth/me @access_routes.route('/auth/me', methods=["GET"]) #@jwt_refresh_token_required def authme(): print("ESTOY EN AUTHME") return jsonify(a=1) capif_backend/backoffice_service/core/operations.py +2 −14 Original line number Diff line number Diff line Loading @@ -138,8 +138,7 @@ class Operations: ]}, {"_id": 0}) return jsonify(message="Events retrieved succesfully", object=user), 200 return jsonify(user), 200 except Exception as e: return "Error when retreiving event: ", e Loading @@ -157,18 +156,7 @@ class Operations: ]}, {"_id": 0}) json_user = [ { "fullName": "Fogus", "info": "http://www.fogus.gr" }, { "fullName": "OWO", "info": "https://owogame.com" } ] num_users = len(json_user) num_users = len(user) return jsonify(num_users), 200 except Exception as e: Loading update_and_launch_containers.shdeleted 100644 → 0 +0 −10 Original line number Diff line number Diff line #!/bin/sh # Detiene los contenedores docker-compose down # Actualiza los archivos git pull # Lanza los contenedores docker-compose up --build -d No newline at end of file Loading
capif_backend/backoffice_service/__main__.py +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ app = Flask(__name__) CORS(app) # Register blueprints (routes) # otra opciones modificar URL -> app.register_blueprint(backoffice_routes, url_prefix="/resources") # other option modify URL -> app.register_blueprint(backoffice_routes, url_prefix="/resources") app.register_blueprint(backoffice_routes) app.register_blueprint(access_routes) Loading
capif_backend/backoffice_service/controllers/default_controller.py +0 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ from flask_jwt_extended import jwt_required, get_jwt_identity backoffice_routes = Blueprint("backoffice_routes", __name__) operations = Operations() # create operations object -> operations.py # https://10.95.82.71:8085 /resources/invokers @backoffice_routes.route("/resources/invokers", methods=["GET"]) @jwt_required() def get_invokers(): Loading
capif_backend/backoffice_service/controllers/login.py +1 −10 Original line number Diff line number Diff line Loading @@ -5,17 +5,11 @@ from flask_jwt_extended import JWTManager, jwt_required, create_access_token, cr # create blueprint backoffice_routes access_routes = Blueprint("acces_routes", __name__) # Crea una ruta para autenticar a los usuarios y devolver el token JWT. # La función create_access_token() se utiliza para generar el JWT. @access_routes.route("/login", methods=["POST"]) def login(): username = request.form.get("username", None) password = request.form.get("password", None) #username = request.json.get("username", None) #password = request.json.get("password", None) #username = request().form['username'] #password = request().form['password'] print("username: ", username) print("password: ", password) Loading @@ -23,7 +17,7 @@ def login(): print("Bad username or password") return jsonify({"msg": "Bad username or password"}), 401 # identity es un dato serializable en json -> username = superadmin # identity is a data that can be serialized in json -> username = superadmin access_token = create_access_token(identity=username, expires_delta=False) refresh_token = create_refresh_token(identity=username) Loading @@ -36,10 +30,7 @@ def refresh(): new_access_token = create_access_token(identity=current_user) return jsonify(access_token=new_access_token) #https://10.95.82.71:8085/auth/me @access_routes.route('/auth/me', methods=["GET"]) #@jwt_refresh_token_required def authme(): print("ESTOY EN AUTHME") return jsonify(a=1)
capif_backend/backoffice_service/core/operations.py +2 −14 Original line number Diff line number Diff line Loading @@ -138,8 +138,7 @@ class Operations: ]}, {"_id": 0}) return jsonify(message="Events retrieved succesfully", object=user), 200 return jsonify(user), 200 except Exception as e: return "Error when retreiving event: ", e Loading @@ -157,18 +156,7 @@ class Operations: ]}, {"_id": 0}) json_user = [ { "fullName": "Fogus", "info": "http://www.fogus.gr" }, { "fullName": "OWO", "info": "https://owogame.com" } ] num_users = len(json_user) num_users = len(user) return jsonify(num_users), 200 except Exception as e: Loading
update_and_launch_containers.shdeleted 100644 → 0 +0 −10 Original line number Diff line number Diff line #!/bin/sh # Detiene los contenedores docker-compose down # Actualiza los archivos git pull # Lanza los contenedores docker-compose up --build -d No newline at end of file