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.
19 lines
686 B
Python
19 lines
686 B
Python
from pydantic import BaseModel, Field
|
|
|
|
# ---------------------------------------------------------
|
|
# Modelo de solicitud de login OAuth
|
|
# ---------------------------------------------------------
|
|
|
|
class OrcidLoginRequestSchema(BaseModel):
|
|
# `code` is the authorization code returned by ORCID OAuth after the user signs in.
|
|
# Exchanging it for tokens must happen server-side.
|
|
code: str = Field(..., examples=["Q70Y3A"])
|
|
|
|
# ---------------------------------------------------------
|
|
# Modelo de respuesta de login OAuth
|
|
# ---------------------------------------------------------
|
|
|
|
class OrcidLoginResponseSchema(BaseModel):
|
|
access_token: str
|
|
token_type: str = "bearer"
|