files-server-fastapi 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- files_server_fastapi/__init__.py +20 -0
- files_server_fastapi/models/__init__.py +16 -0
- files_server_fastapi/models/area_model.py +10 -0
- files_server_fastapi/models/permisos_model.py +31 -0
- files_server_fastapi/models/rol_model.py +14 -0
- files_server_fastapi/models/rutas_model.py +16 -0
- files_server_fastapi/models/users_extend_model.py +11 -0
- files_server_fastapi/routers/__init__.py +16 -0
- files_server_fastapi/routers/area_router.py +26 -0
- files_server_fastapi/routers/files_router.py +123 -0
- files_server_fastapi/routers/permisos_router.py +36 -0
- files_server_fastapi/routers/rol_router.py +20 -0
- files_server_fastapi/routers/rutas_router.py +20 -0
- files_server_fastapi/routers/users_extend_router.py +33 -0
- files_server_fastapi-0.1.0.dist-info/METADATA +41 -0
- files_server_fastapi-0.1.0.dist-info/RECORD +18 -0
- files_server_fastapi-0.1.0.dist-info/WHEEL +4 -0
- files_server_fastapi-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# files_server_fastapi/__init__.py
|
|
2
|
+
# Exporta todos los routers para que main.py pueda importarlos directamente.
|
|
3
|
+
|
|
4
|
+
from files_server_fastapi.routers import (
|
|
5
|
+
area_router,
|
|
6
|
+
rol_router,
|
|
7
|
+
rutas_router,
|
|
8
|
+
permisos_router,
|
|
9
|
+
users_extend_router,
|
|
10
|
+
files_router,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"area_router",
|
|
15
|
+
"rol_router",
|
|
16
|
+
"rutas_router",
|
|
17
|
+
"permisos_router",
|
|
18
|
+
"users_extend_router",
|
|
19
|
+
"files_router",
|
|
20
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# models/__init__.py
|
|
2
|
+
from .area_model import Area
|
|
3
|
+
from .rol_model import Rol
|
|
4
|
+
from .rutas_model import Rutas
|
|
5
|
+
from .permisos_model import Permisos, Permiso_user, Permiso_rol
|
|
6
|
+
from .users_extend_model import Users_extend
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"Area",
|
|
10
|
+
"Rol",
|
|
11
|
+
"Rutas",
|
|
12
|
+
"Permisos",
|
|
13
|
+
"Permiso_user",
|
|
14
|
+
"Permiso_rol",
|
|
15
|
+
"Users_extend",
|
|
16
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from sqlmodel import Field
|
|
3
|
+
from oauth2fast_fastapi import AuthModel
|
|
4
|
+
|
|
5
|
+
class Area(AuthModel, table=True):
|
|
6
|
+
__tablename__ = "area"
|
|
7
|
+
|
|
8
|
+
id: Optional[int] = Field(default=None, primary_key=True)
|
|
9
|
+
area_name: str = Field(nullable=False)
|
|
10
|
+
description: Optional[str] = Field(default=None)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from sqlmodel import Field
|
|
3
|
+
from oauth2fast_fastapi import AuthModel
|
|
4
|
+
|
|
5
|
+
# Catálogo principal de permisos
|
|
6
|
+
class Permisos(AuthModel, table=True):
|
|
7
|
+
__tablename__ = "permisos"
|
|
8
|
+
|
|
9
|
+
id: Optional[int] = Field(default=None, primary_key=True)
|
|
10
|
+
permiso_name: str = Field(nullable=False)
|
|
11
|
+
description: Optional[str] = Field(default=None)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# Tabla intermedia: Permisos por Usuario
|
|
15
|
+
class Permiso_user(AuthModel, table=True):
|
|
16
|
+
__tablename__ = "permiso_user"
|
|
17
|
+
|
|
18
|
+
id: Optional[int] = Field(default=None, primary_key=True)
|
|
19
|
+
id_user: int = Field(foreign_key="users.id")
|
|
20
|
+
id_permiso: int = Field(foreign_key="permisos.id")
|
|
21
|
+
ruta_id: int = Field(foreign_key="rutas.id")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Tabla intermedia: Permisos por Rol
|
|
25
|
+
class Permiso_rol(AuthModel, table=True):
|
|
26
|
+
__tablename__ = "permiso_rol"
|
|
27
|
+
|
|
28
|
+
id: Optional[int] = Field(default=None, primary_key=True)
|
|
29
|
+
id_rol: int = Field(foreign_key="rol.id")
|
|
30
|
+
id_permiso: int = Field(foreign_key="permisos.id")
|
|
31
|
+
ruta_id: int = Field(foreign_key="rutas.id")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from datetime import datetime, timezone
|
|
3
|
+
from sqlmodel import Field
|
|
4
|
+
from oauth2fast_fastapi import AuthModel
|
|
5
|
+
|
|
6
|
+
def get_utc_now():
|
|
7
|
+
return datetime.now(timezone.utc)
|
|
8
|
+
|
|
9
|
+
class Rol(AuthModel, table=True):
|
|
10
|
+
__tablename__ = "rol"
|
|
11
|
+
|
|
12
|
+
id: Optional[int] = Field(default=None, primary_key=True)
|
|
13
|
+
role_name: str = Field(nullable=False)
|
|
14
|
+
description: Optional[str] = Field(default=None)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
from sqlmodel import Field
|
|
3
|
+
from oauth2fast_fastapi import AuthModel
|
|
4
|
+
|
|
5
|
+
class Rutas(AuthModel, table=True):
|
|
6
|
+
__tablename__ = "rutas"
|
|
7
|
+
|
|
8
|
+
id: Optional[int] = Field(default=None, primary_key=True)
|
|
9
|
+
ruta: str = Field(nullable=False)
|
|
10
|
+
name: str = Field(nullable=False)
|
|
11
|
+
|
|
12
|
+
# Llave foránea hacia Area
|
|
13
|
+
area_id: int = Field(foreign_key="area.id")
|
|
14
|
+
|
|
15
|
+
# Auto-referencia para sub-rutas (puede ser nula si es ruta principal)
|
|
16
|
+
ruta_id: Optional[int] = Field(default=None, foreign_key="rutas.id")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from sqlmodel import Field
|
|
2
|
+
from oauth2fast_fastapi import AuthModel
|
|
3
|
+
|
|
4
|
+
class Users_extend(AuthModel, table=True):
|
|
5
|
+
__tablename__ = "users_extend"
|
|
6
|
+
|
|
7
|
+
# Es Primary Key y Foreign Key al mismo tiempo (Relación 1 a 1)
|
|
8
|
+
user_id: int = Field(primary_key=True, foreign_key="users.id")
|
|
9
|
+
|
|
10
|
+
area_id: int = Field(foreign_key="area.id")
|
|
11
|
+
rol_id: int = Field(foreign_key="rol.id")
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# routers/__init__.py
|
|
2
|
+
from files_server_fastapi.routers import area_router
|
|
3
|
+
from files_server_fastapi.routers import rol_router
|
|
4
|
+
from files_server_fastapi.routers import rutas_router
|
|
5
|
+
from files_server_fastapi.routers import permisos_router
|
|
6
|
+
from files_server_fastapi.routers import users_extend_router
|
|
7
|
+
from files_server_fastapi.routers import files_router
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"area_router",
|
|
11
|
+
"rol_router",
|
|
12
|
+
"rutas_router",
|
|
13
|
+
"permisos_router",
|
|
14
|
+
"users_extend_router",
|
|
15
|
+
"files_router",
|
|
16
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from fastapi import APIRouter, Depends
|
|
2
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
3
|
+
from sqlalchemy import select
|
|
4
|
+
|
|
5
|
+
from pgsqlasync2fast_fastapi.dependencies import get_db_session
|
|
6
|
+
from files_server_fastapi.models.area_model import Area
|
|
7
|
+
|
|
8
|
+
router = APIRouter(prefix="/areas", tags=["Gestión de Áreas"])
|
|
9
|
+
|
|
10
|
+
@router.post("/", response_model=Area, summary="Crear una nueva Área")
|
|
11
|
+
async def create_area(area: Area, db: AsyncSession = Depends(get_db_session)):
|
|
12
|
+
"""
|
|
13
|
+
Guarda una nueva área en la base de datos.
|
|
14
|
+
"""
|
|
15
|
+
db.add(area)
|
|
16
|
+
await db.commit()
|
|
17
|
+
await db.refresh(area)
|
|
18
|
+
return area
|
|
19
|
+
|
|
20
|
+
@router.get("/", response_model=list[Area], summary="Obtener todas las Áreas")
|
|
21
|
+
async def get_areas(db: AsyncSession = Depends(get_db_session)):
|
|
22
|
+
"""
|
|
23
|
+
Devuelve la lista de todas las áreas registradas.
|
|
24
|
+
"""
|
|
25
|
+
result = await db.execute(select(Area))
|
|
26
|
+
return result.scalars().all()
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from fastapi import APIRouter, HTTPException
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
|
|
6
|
+
router = APIRouter(prefix="/files", tags=["Archivos del Sistema"])
|
|
7
|
+
|
|
8
|
+
# Directorio maestro (La ruta de red de Samba vista desde Windows)
|
|
9
|
+
BASE_DIR = r"\\192.168.1.122\Compartido"
|
|
10
|
+
|
|
11
|
+
@router.get("/list", summary="Listar archivos de una carpeta")
|
|
12
|
+
async def list_directory(area: str, subpath: str = "/"):
|
|
13
|
+
# Seguridad básica: Evitar que un hacker suba de nivel con "../"
|
|
14
|
+
if ".." in subpath:
|
|
15
|
+
raise HTTPException(status_code=400, detail="Ruta inválida")
|
|
16
|
+
|
|
17
|
+
safe_subpath = subpath.strip("/")
|
|
18
|
+
|
|
19
|
+
if safe_subpath == "":
|
|
20
|
+
ruta_real = os.path.join(BASE_DIR, area.upper())
|
|
21
|
+
else:
|
|
22
|
+
ruta_real = os.path.join(BASE_DIR, area.upper(), safe_subpath)
|
|
23
|
+
|
|
24
|
+
if not os.path.exists(ruta_real):
|
|
25
|
+
return []
|
|
26
|
+
|
|
27
|
+
if not os.path.isdir(ruta_real):
|
|
28
|
+
raise HTTPException(status_code=400, detail="La ruta no es un directorio")
|
|
29
|
+
|
|
30
|
+
items = []
|
|
31
|
+
try:
|
|
32
|
+
with os.scandir(ruta_real) as ficheros:
|
|
33
|
+
for fichero in ficheros:
|
|
34
|
+
info = fichero.stat()
|
|
35
|
+
fecha_mod = datetime.fromtimestamp(info.st_mtime).strftime("%Y-%m-%d %H:%M")
|
|
36
|
+
|
|
37
|
+
if fichero.is_dir():
|
|
38
|
+
items.append({
|
|
39
|
+
"name": fichero.name,
|
|
40
|
+
"type": "folder",
|
|
41
|
+
"updated": fecha_mod,
|
|
42
|
+
"size": "",
|
|
43
|
+
"locked": False
|
|
44
|
+
})
|
|
45
|
+
else:
|
|
46
|
+
size_kb = info.st_size / 1024
|
|
47
|
+
size_str = f"{size_kb:.1f} KB" if size_kb < 1024 else f"{size_kb/1024:.1f} MB"
|
|
48
|
+
items.append({
|
|
49
|
+
"name": fichero.name,
|
|
50
|
+
"type": "file",
|
|
51
|
+
"updated": fecha_mod,
|
|
52
|
+
"size": size_str,
|
|
53
|
+
"locked": False
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
items.sort(key=lambda x: (x["type"] == "file", x["name"].lower()))
|
|
57
|
+
return items
|
|
58
|
+
|
|
59
|
+
except PermissionError:
|
|
60
|
+
raise HTTPException(status_code=403, detail="Acceso denegado por el sistema operativo")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
# ==========================================
|
|
64
|
+
# RUTAS: CREAR CARPETAS
|
|
65
|
+
# ==========================================
|
|
66
|
+
|
|
67
|
+
class FolderCreate(BaseModel):
|
|
68
|
+
area: str
|
|
69
|
+
subpath: str
|
|
70
|
+
folder_name: str
|
|
71
|
+
|
|
72
|
+
@router.post("/folder", summary="Crear una nueva carpeta en el servidor")
|
|
73
|
+
async def create_folder(req: FolderCreate):
|
|
74
|
+
if ".." in req.subpath or ".." in req.folder_name or "/" in req.folder_name:
|
|
75
|
+
raise HTTPException(status_code=400, detail="Nombre de carpeta o ruta inválida")
|
|
76
|
+
|
|
77
|
+
safe_subpath = req.subpath.strip("/")
|
|
78
|
+
|
|
79
|
+
if safe_subpath == "":
|
|
80
|
+
ruta_final = os.path.join(BASE_DIR, req.area.upper(), req.folder_name)
|
|
81
|
+
else:
|
|
82
|
+
ruta_final = os.path.join(BASE_DIR, req.area.upper(), safe_subpath, req.folder_name)
|
|
83
|
+
|
|
84
|
+
try:
|
|
85
|
+
os.makedirs(ruta_final, exist_ok=False)
|
|
86
|
+
return {"message": "Carpeta creada exitosamente", "path": ruta_final}
|
|
87
|
+
except FileExistsError:
|
|
88
|
+
raise HTTPException(status_code=400, detail="Ya existe una carpeta con ese nombre aquí")
|
|
89
|
+
except PermissionError:
|
|
90
|
+
raise HTTPException(status_code=403, detail="El servidor rechazó el permiso de escritura")
|
|
91
|
+
except Exception as e:
|
|
92
|
+
raise HTTPException(status_code=500, detail=str(e))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# ==========================================
|
|
96
|
+
# RUTA: ESCANEAR EL ÁRBOL DE CARPETAS
|
|
97
|
+
# ==========================================
|
|
98
|
+
|
|
99
|
+
def get_directory_tree(path_to_scan, base_name=""):
|
|
100
|
+
"""Función recursiva de Python para leer subcarpetas"""
|
|
101
|
+
tree = []
|
|
102
|
+
try:
|
|
103
|
+
with os.scandir(path_to_scan) as entries:
|
|
104
|
+
for entry in entries:
|
|
105
|
+
if entry.is_dir():
|
|
106
|
+
relative_path = os.path.join(base_name, entry.name).replace("\\", "/")
|
|
107
|
+
tree.append({
|
|
108
|
+
"name": entry.name,
|
|
109
|
+
"path": f"/{relative_path}",
|
|
110
|
+
"children": get_directory_tree(entry.path, relative_path)
|
|
111
|
+
})
|
|
112
|
+
except PermissionError:
|
|
113
|
+
pass
|
|
114
|
+
return sorted(tree, key=lambda x: x["name"].lower())
|
|
115
|
+
|
|
116
|
+
@router.get("/tree", summary="Obtener el árbol de carpetas de un área")
|
|
117
|
+
async def get_area_tree(area: str):
|
|
118
|
+
area_path = os.path.join(BASE_DIR, area.upper())
|
|
119
|
+
|
|
120
|
+
if not os.path.exists(area_path):
|
|
121
|
+
return []
|
|
122
|
+
|
|
123
|
+
return get_directory_tree(area_path)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from fastapi import APIRouter, Depends
|
|
2
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
3
|
+
from sqlalchemy import select
|
|
4
|
+
|
|
5
|
+
from pgsqlasync2fast_fastapi.dependencies import get_db_session
|
|
6
|
+
from files_server_fastapi.models.permisos_model import Permisos, Permiso_user, Permiso_rol
|
|
7
|
+
|
|
8
|
+
router = APIRouter(prefix="/permisos", tags=["Gestión de Permisos"])
|
|
9
|
+
|
|
10
|
+
# --- Catálogo Maestro ---
|
|
11
|
+
@router.post("/", response_model=Permisos, summary="Crear Permiso Maestro")
|
|
12
|
+
async def create_permiso(permiso: Permisos, db: AsyncSession = Depends(get_db_session)):
|
|
13
|
+
db.add(permiso)
|
|
14
|
+
await db.commit()
|
|
15
|
+
await db.refresh(permiso)
|
|
16
|
+
return permiso
|
|
17
|
+
|
|
18
|
+
@router.get("/", response_model=list[Permisos], summary="Ver Permisos Maestros")
|
|
19
|
+
async def get_permisos(db: AsyncSession = Depends(get_db_session)):
|
|
20
|
+
result = await db.execute(select(Permisos))
|
|
21
|
+
return result.scalars().all()
|
|
22
|
+
|
|
23
|
+
# --- Asignaciones Intermedias ---
|
|
24
|
+
@router.post("/asignar-usuario", response_model=Permiso_user, summary="Asignar permiso a un Usuario")
|
|
25
|
+
async def assign_user(permiso: Permiso_user, db: AsyncSession = Depends(get_db_session)):
|
|
26
|
+
db.add(permiso)
|
|
27
|
+
await db.commit()
|
|
28
|
+
await db.refresh(permiso)
|
|
29
|
+
return permiso
|
|
30
|
+
|
|
31
|
+
@router.post("/asignar-rol", response_model=Permiso_rol, summary="Asignar permiso a un Rol")
|
|
32
|
+
async def assign_rol(permiso: Permiso_rol, db: AsyncSession = Depends(get_db_session)):
|
|
33
|
+
db.add(permiso)
|
|
34
|
+
await db.commit()
|
|
35
|
+
await db.refresh(permiso)
|
|
36
|
+
return permiso
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from fastapi import APIRouter, Depends
|
|
2
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
3
|
+
from sqlalchemy import select
|
|
4
|
+
|
|
5
|
+
from pgsqlasync2fast_fastapi.dependencies import get_db_session
|
|
6
|
+
from files_server_fastapi.models.rol_model import Rol
|
|
7
|
+
|
|
8
|
+
router = APIRouter(prefix="/roles", tags=["Gestión de Roles"])
|
|
9
|
+
|
|
10
|
+
@router.post("/", response_model=Rol, summary="Crear un nuevo Rol")
|
|
11
|
+
async def create_rol(rol: Rol, db: AsyncSession = Depends(get_db_session)):
|
|
12
|
+
db.add(rol)
|
|
13
|
+
await db.commit()
|
|
14
|
+
await db.refresh(rol)
|
|
15
|
+
return rol
|
|
16
|
+
|
|
17
|
+
@router.get("/", response_model=list[Rol], summary="Obtener todos los Roles")
|
|
18
|
+
async def get_roles(db: AsyncSession = Depends(get_db_session)):
|
|
19
|
+
result = await db.execute(select(Rol))
|
|
20
|
+
return result.scalars().all()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from fastapi import APIRouter, Depends
|
|
2
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
3
|
+
from sqlalchemy import select
|
|
4
|
+
|
|
5
|
+
from pgsqlasync2fast_fastapi.dependencies import get_db_session
|
|
6
|
+
from files_server_fastapi.models.rutas_model import Rutas
|
|
7
|
+
|
|
8
|
+
router = APIRouter(prefix="/rutas", tags=["Gestión de Rutas"])
|
|
9
|
+
|
|
10
|
+
@router.post("/", response_model=Rutas, summary="Registrar una Ruta")
|
|
11
|
+
async def create_ruta(ruta: Rutas, db: AsyncSession = Depends(get_db_session)):
|
|
12
|
+
db.add(ruta)
|
|
13
|
+
await db.commit()
|
|
14
|
+
await db.refresh(ruta)
|
|
15
|
+
return ruta
|
|
16
|
+
|
|
17
|
+
@router.get("/", response_model=list[Rutas], summary="Obtener todas las Rutas")
|
|
18
|
+
async def get_rutas(db: AsyncSession = Depends(get_db_session)):
|
|
19
|
+
result = await db.execute(select(Rutas))
|
|
20
|
+
return result.scalars().all()
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from fastapi import APIRouter, Depends
|
|
2
|
+
from sqlalchemy.ext.asyncio import AsyncSession
|
|
3
|
+
from sqlalchemy import select
|
|
4
|
+
|
|
5
|
+
from pgsqlasync2fast_fastapi.dependencies import get_db_session
|
|
6
|
+
from files_server_fastapi.models.users_extend_model import Users_extend
|
|
7
|
+
|
|
8
|
+
router = APIRouter(prefix="/users-extend", tags=["Extensión de Usuarios"])
|
|
9
|
+
|
|
10
|
+
@router.post("/", response_model=Users_extend, summary="Vincular Usuario con Área y Rol")
|
|
11
|
+
async def create_user_extend(user_ext: Users_extend, db: AsyncSession = Depends(get_db_session)):
|
|
12
|
+
db.add(user_ext)
|
|
13
|
+
await db.commit()
|
|
14
|
+
await db.refresh(user_ext)
|
|
15
|
+
return user_ext
|
|
16
|
+
|
|
17
|
+
@router.get("/", response_model=list[Users_extend], summary="Ver vínculos de usuarios")
|
|
18
|
+
async def get_users_extend(db: AsyncSession = Depends(get_db_session)):
|
|
19
|
+
result = await db.execute(select(Users_extend))
|
|
20
|
+
return result.scalars().all()
|
|
21
|
+
|
|
22
|
+
# ==========================================
|
|
23
|
+
# RUTA: Buscar Rol y Área por user_id
|
|
24
|
+
# ==========================================
|
|
25
|
+
@router.get("/by-user/{user_id}", summary="Obtener Área y Rol de un Usuario específico")
|
|
26
|
+
async def get_user_permissions(user_id: int, db: AsyncSession = Depends(get_db_session)):
|
|
27
|
+
result = await db.execute(select(Users_extend).where(Users_extend.user_id == user_id))
|
|
28
|
+
user_ext = result.scalars().first()
|
|
29
|
+
|
|
30
|
+
if not user_ext:
|
|
31
|
+
return {"role_id": None, "area_id": None}
|
|
32
|
+
|
|
33
|
+
return {"role_id": user_ext.rol_id, "area_id": user_ext.area_id}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: files-server-fastapi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Este repositorio es un paquete python desarrollado con FastAPI, gestiona la comunicación con un servidor Samba y utiliza PostgreSQL para administrar rutas de archivos y el control de acceso basado en roles (RBAC) de los usuarios.
|
|
5
|
+
Project-URL: Homepage, https://github.com/AldoBP/files-server-fastapi
|
|
6
|
+
Project-URL: Repository, https://github.com/AldoBP/files-server-fastapi
|
|
7
|
+
Project-URL: Issues, https://github.com/AldoBP/files-server-fastapi/issues
|
|
8
|
+
Author: Aldo Blancas
|
|
9
|
+
License: MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026 Aldo Blancas
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Keywords: fastapi,fileserver,postgresql,rbac,samba
|
|
32
|
+
Classifier: Framework :: FastAPI
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Requires-Python: >=3.10
|
|
37
|
+
Requires-Dist: oauth2fast-fastapi==0.2.2
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# files-server-fastapi
|
|
41
|
+
Este repositorio es un paquete python desarrollado con FastAPI, gestiona la comunicación con un servidor Samba y utiliza PostgreSQL para administrar rutas de archivos y el control de acceso basado en roles (RBAC) de los usuarios.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
files_server_fastapi/__init__.py,sha256=Q0cbh7qIDBh-5pTMdXsT0AlAYpF34AUmH5x_Z6YGFgI,415
|
|
2
|
+
files_server_fastapi/models/__init__.py,sha256=CDgpF4fYMOxnPhmfhvFKOrBX5Wx2sK-33p5WsEJJubQ,343
|
|
3
|
+
files_server_fastapi/models/area_model.py,sha256=H1gQGBitF_NKyWYb5VvP5gzCMz3cq1Y-niD8qmJpJTQ,322
|
|
4
|
+
files_server_fastapi/models/permisos_model.py,sha256=1K55EXIAfztS1h7V71XdDidvLm1GoKtxvDCwKyjpsfw,1040
|
|
5
|
+
files_server_fastapi/models/rol_model.py,sha256=_s2-GvELyKkO8MOcNkBBLDXh7uqhD02r5QxvkTJbVkI,418
|
|
6
|
+
files_server_fastapi/models/rutas_model.py,sha256=F9yw-QRC5Kxppe0mVsV-_4o1fw3w2ePcdbPNIOBck4A,542
|
|
7
|
+
files_server_fastapi/models/users_extend_model.py,sha256=ymxq7uyL6NIdPdtEDSrRBm8r9FEpTUJgwuMVXq-hrpA,387
|
|
8
|
+
files_server_fastapi/routers/__init__.py,sha256=C3McTrLaCU4aGilI_1LppwXxuGMbHHTkHDV4RMmHCVc,495
|
|
9
|
+
files_server_fastapi/routers/area_router.py,sha256=zhiwqdoP8zji5I-yWT8M59G8KXfIJdi8wvW_MiNm5Yo,897
|
|
10
|
+
files_server_fastapi/routers/files_router.py,sha256=oXGfaPmdGNab3d9BKdh-JIBkKimhaFWbbgVFrJ_11NY,4532
|
|
11
|
+
files_server_fastapi/routers/permisos_router.py,sha256=t2EbZfdfIDZbHMIdYaXTLMfNRxduprcgEJPIeVe4Mug,1453
|
|
12
|
+
files_server_fastapi/routers/rol_router.py,sha256=X1kUaeXTxpW6mdVvyEiPhuJI03jdy72fI3m3XbRfpCA,746
|
|
13
|
+
files_server_fastapi/routers/rutas_router.py,sha256=5lc32V1hYFcIF9YE-W9tuPjgEXcQ3uVtSw-z8Ibr9xo,763
|
|
14
|
+
files_server_fastapi/routers/users_extend_router.py,sha256=lLfa1skH0kk4tcZbDm-DGMgtLG39pvKHYvkTmH09xrk,1455
|
|
15
|
+
files_server_fastapi-0.1.0.dist-info/METADATA,sha256=rGI-viKWMsRo4MJ4FFUcboqlIvFpQ4v-fapNXiuAGVc,2396
|
|
16
|
+
files_server_fastapi-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
17
|
+
files_server_fastapi-0.1.0.dist-info/licenses/LICENSE,sha256=18y0AU3LAKBdqAnqG_ROAcKOYf6dTXXYRS19tqZrrx4,1069
|
|
18
|
+
files_server_fastapi-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aldo Blancas
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|