af1b8e9956
- Updated Dockerfile to improve security with a non-root user and added health checks. - Modified docker-compose.yml to set containers as read-only, restrict ports to localhost, and implement health checks. - Enhanced .env.example with additional environment variables for security and configuration. - Improved FastAPI application with middleware for security headers, CORS, and body size limits. - Refactored authentication flow in auth.py to include state validation and improved error handling. - Added rate limiting to various endpoints to prevent abuse. - Updated researcher and publication handling to ensure better validation and error management.
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from pydantic import BaseModel
|
|
from uuid import UUID
|
|
from typing import Optional, List, Any
|
|
from datetime import datetime
|
|
|
|
# ---------------------------------------------------------
|
|
# Modelo de publicación
|
|
# ---------------------------------------------------------
|
|
|
|
class PublicationSchema(BaseModel):
|
|
id: UUID
|
|
put_code: int | None = None
|
|
title: str | None = None
|
|
subtitle: str | None = None
|
|
journal: str | None = None
|
|
doi: str | None = None
|
|
pub_year: int | None = None
|
|
pub_month: int | None = None
|
|
pub_day: int | None = None
|
|
type: str | None = None
|
|
url: str | None = None
|
|
short_description: str | None = None
|
|
citation_type: str | None = None
|
|
citation_value: str | None = None
|
|
language_code: str | None = None
|
|
country: str | None = None
|
|
external_ids: List[Any] | None = None
|
|
contributors: List[Any] | None = None
|
|
hash_fingerprint: str | None = None
|
|
last_modified: datetime | None = None
|
|
status: str | None = None
|
|
downloaded_by_me: bool | None = None
|
|
model_config = {"from_attributes": True}
|