Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 0 additions & 133 deletions .aws/redema-back-https-def-revision4.json

This file was deleted.

96 changes: 0 additions & 96 deletions .github/workflows/aws.yml

This file was deleted.

18 changes: 2 additions & 16 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
builtins.unicode = str

import os
import json
import psycopg2
from firebase_admin import credentials, auth as firebase_auth
from flask import Flask, request, jsonify
Expand Down Expand Up @@ -75,21 +76,6 @@ def shutdown_session(exception=None):
"""Cierra la sesión de base de datos al finalizar el contexto de la app."""
cerrar_sesion()

# Configuración Firebase
service_account_info = {
"type": os.environ.get("FIREBASE_TYPE"),
"project_id": os.environ.get("FIREBASE_PROJECT_ID"),
"private_key_id": os.environ.get("FIREBASE_PRIVATE_KEY_ID"),
"private_key": str(os.environ.get("FIREBASE_PRIVATE_KEY")).replace('\\n', '\n'),
"client_email": os.environ.get("FIREBASE_CLIENT_EMAIL"),
"client_id": os.environ.get("FIREBASE_CLIENT_ID"),
"auth_uri": os.environ.get("FIREBASE_AUTH_URI"),
"token_uri": os.environ.get("FIREBASE_TOKEN_URI"),
"auth_provider_x509_cert_url": os.environ.get("FIREBASE_AUTH_PROVIDER_X509_CERT_URL"),
"client_x509_cert_url": os.environ.get("FIREBASE_CLIENT_X509_CERT_URL"),
"universe_domain": os.environ.get("FIREBASE_UNIVERSE_DOMAIN")
}

# Inicializar Firebase
# cred = credentials.Certificate("firebase/firebase-credentials.json")
cred = credentials.Certificate(json.loads(os.environ["FIREBASE_CREDENTIALS"]))
Expand Down Expand Up @@ -214,4 +200,4 @@ def tarea_archivar_publicaciones():
minute=0
)

app.run(host='0.0.0.0', port=5000, debug=True)
app.run(host='0.0.0.0', port=5000, debug=True)
2 changes: 1 addition & 1 deletion components/publicaciones/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,4 @@ def subir_imagen_a_cloudinary(file):
return result.get("secure_url")
except Exception as e:
print("Error Cloudinary:", str(e))
return None
return None
14 changes: 9 additions & 5 deletions components/roles/routes.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from flask import Blueprint, request, jsonify
from .services import obtener_roles, crear_rol, actualizar_rol, eliminar_rol

roles_bp = Blueprint("roles", __name__, url_prefix="/api/roles")
roles_bp = Blueprint("roles", __name__)

@roles_bp.route("/", methods=["GET"])

@roles_bp.route("/api/roles", methods=["GET"])
def listar_roles():
roles = obtener_roles()
return jsonify(roles), 200

@roles_bp.route("/", methods=["POST"])

@roles_bp.route("/api/roles", methods=["POST"])
def nuevo_rol():
data = request.get_json()
nombre = data.get("nombre")
Expand All @@ -20,7 +22,8 @@ def nuevo_rol():
return jsonify(rol), 201
return jsonify({"error": "No se pudo crear el rol"}), 500

@roles_bp.route("/<int:id>", methods=["PUT"])

@roles_bp.route("/api/roles/<int:id>", methods=["PUT"])
def editar_rol(id):
data = request.get_json()
nombre = data.get("nombre")
Expand All @@ -32,7 +35,8 @@ def editar_rol(id):
return jsonify(rol), 200
return jsonify({"error": "Rol no encontrado"}), 404

@roles_bp.route("/<int:id>", methods=["DELETE"])

@roles_bp.route("/api/roles/<int:id>", methods=["DELETE"])
def borrar_rol(id):
ok = eliminar_rol(id)
if ok:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ supabase-auth==2.20.0
supabase-functions==2.20.0
tomlkit==0.13.3
typing-inspection==0.4.1
typing_extensions==4.15.0
typing_extensions==4.13.2
tzdata==2025.3
tzlocal==5.3.1
Expand Down