openapi: 3.0.3 info: title: API de Identidad (Auth Service) description: API de provisioning y recuperación de contraseñas para ms-auth. version: 1.0.0 servers: - url: /api/v1/auth description: Gateway Auth Path tags: - name: Publico description: Endpoints accesibles sin token. - name: Admin description: Operaciones administrativas (registro de staff). paths: /register/citizen: post: tags: - Publico summary: Registro de Ciudadano (Auto-servicio) operationId: registrarCiudadano requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegistroCiudadanoAuthRequest' responses: '201': description: Usuario creado exitosamente content: application/json: schema: $ref: '#/components/schemas/RegistroUsuarioResponse' '400': description: Datos inválidos '409': description: Email o Cédula ya registrados /register/staff: post: tags: - Admin summary: Registrar funcionario (Operador, Jefe, Supervisor) operationId: registrarStaff requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegistroStaffAuthRequest' responses: '201': description: Funcionario creado exitosamente content: application/json: schema: $ref: '#/components/schemas/RegistroUsuarioResponse' '400': description: Datos inválidos '409': description: Conflicto de datos /password/forgot: post: tags: - Publico summary: Solicitar recuperación de contraseña operationId: forgot requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PasswordForgotRequest' responses: '201': description: Token de reseteo generado (dev) content: application/json: schema: $ref: '#/components/schemas/PasswordResetResponse' /password/reset: post: tags: - Publico summary: Establecer nueva contraseña operationId: reset requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/PasswordResetRequest' responses: '204': description: Contraseña cambiada correctamente (No Content) '400': description: Token inválido o expirado /auth/logout: post: tags: - Publico summary: Cerrar sesión y revocar refresh token operationId: logout requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LogoutRequest' responses: '200': description: Logout procesado correctamente content: application/json: schema: $ref: '#/components/schemas/LogoutResponse' components: securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: RegistroCiudadanoAuthRequest: type: object required: [ email, nombre, cedula, password ] properties: email: type: string format: email maxLength: 120 nombre: type: string maxLength: 160 cedula: type: string minLength: 10 maxLength: 10 description: Cedula ecuatoriana (validador custom en código) password: type: string minLength: 8 maxLength: 120 RegistroStaffAuthRequest: type: object required: [ email, nombre, cedula, rol, entidad ] properties: email: type: string format: email maxLength: 120 nombre: type: string maxLength: 160 cedula: type: string minLength: 10 maxLength: 10 description: Cedula ecuatoriana (validador custom en código) rol: type: string entidad: type: string aliasPublico: type: string minLength: 3 maxLength: 40 password: type: string minLength: 8 maxLength: 120 RegistroUsuarioResponse: type: object properties: id: type: integer format: int64 publicCitizenId: type: string mensaje: type: string PasswordForgotRequest: type: object required: [ cedula ] properties: cedula: type: string minLength: 10 maxLength: 10 PasswordResetRequest: type: object required: [ token, newPassword ] properties: token: type: string newPassword: type: string minLength: 8 maxLength: 120 PasswordResetResponse: type: object properties: mensaje: type: string token: type: string description: Token de reseteo (dev only) LogoutRequest: type: object properties: refreshToken: type: string description: Token de refresco a revocar (opcional) LogoutResponse: type: object properties: mensaje: type: string refreshTokenRevocado: type: boolean sesionInvalidada: type: boolean ErrorResponse: type: object properties: timestamp: type: string format: date-time status: type: integer error: type: string message: type: string path: type: string correlationId: type: string