Commit Graph

814 Commits

Author SHA1 Message Date
65832a92bc feat(e2e): replicar patrón de autenticación de aduanasoft-hub
- fixtures/keycloak.ts: Admin REST API helpers (createTestUser, assignRoles,
  deleteTestUser) — copia exacta del hub
- global-setup.ts: crea usuario e2e-anexo76 en KC antes de los tests
- global-teardown.ts: elimina el usuario al finalizar
- auth.setup.ts: navega a /login → Workspace → llena form → /dashboard
  (ya no usa password grant ni Direct Access Grants)
- playwright.config.ts: agrega globalSetup y globalTeardown
- Jenkinsfile: a76-e2e-credentials ahora son credenciales de KC admin;
  usuario de prueba es efímero (creado/borrado por global-setup/teardown)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 13:50:39 -05:00
844c8c4c6b feat(e2e): implement authentication setup for Playwright tests using Keycloak tokens 2026-05-20 12:27:27 -05:00
f18532087f fix(schema): remove unused ENUM types from PostgreSQL during downgrade 2026-05-20 11:59:32 -05:00
64d81c83f9 feat(company): add tenant_id support for hub_admin in company creation and updates 2026-05-15 10:28:47 -05:00
7a7e8a67a3 fix(auth): ensure id_token is cleared and set during SSO exchange for Keycloak logout 2026-05-14 12:15:37 -05:00
0ed350ca11 fix(auth): enhance logout and login flow with Keycloak integration and cookie management 2026-05-14 12:07:10 -05:00
dacfe8f6e8 docs: update frontend .env.example with all required vars for dev local
Agrega INTERNAL_API_URL, INTERNAL_HUB_URL, HUB_URL, KEYCLOAK_URL y ORIGIN
al ejemplo para que el dev local tenga el mismo conjunto de variables que
usa Docker Compose, evitando que el SSO exchange y el refresh proactivo
fallen silenciosamente por vars indefinidas.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 09:19:24 -05:00
85f31f8eca fix(auth): replace all /login redirects with redirectToWorkspaceLogin
Todos los page.server.ts que hacían throw redirect(302, '/login') ahora
usan redirectToWorkspaceLogin(cookies, url) para enviar al usuario directo
al login del workspace en lugar de pasar por la página /login local de Anexo76.

Archivos actualizados:
- dashboard/pedimentos/+page.server.ts
- dashboard/pedimentos/edit/[id]/+page.server.ts (2 redirects)
- dashboard/invoices/+page.server.ts
- dashboard/invoices/edit/[id]/+page.server.ts
- dashboard/invoices/settings/+page.server.ts
- dashboard/goods/parts/edit/[[id]]/+page.server.ts
- dashboard/general_catalogs/ports/+page.server.ts
- dashboard/general_catalogs/seal/+page.server.ts
- dashboard/reports/vencimiento/+page.server.ts
- dashboard/reports/invoices/+page.server.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 09:09:34 -05:00
228cd533d2 fix(sso): reduce cookie chunk threshold and add defensive error handling in SSO exchange
- Reduce ACCESS_TOKEN_MAX_SINGLE y ACCESS_TOKEN_CHUNK_SIZE de 3500 a 2800
  para garantizar que cada cookie fragmentada no supere el límite de 4096 bytes
  del navegador (incluye overhead del nombre, path, attrs).
- Agrega try/catch alrededor de response.json() en el load de /auth/sso para
  evitar SyntaxError no manejado si el body no es JSON.
- Type guards explícitos en tokens.access_token, refresh_token y tenant_id
  para detectar respuestas incompletas del hub antes de llamar cookies.set().
- .catch(() => ({})) en refreshRes.json() para que el refresh proactivo nunca
  bloquee el flujo SSO aunque el body sea inesperado.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 08:30:15 -05:00
35c47e32df fix: update secure cookie handling to use origin-based context for improved security 2026-05-12 17:32:03 -05:00
2436a4d563 fix: update logout flow to use registered post-logout route and add redirect handler 2026-05-12 11:01:34 -05:00
52577b9e66 refactor: update SSO handling and remove deprecated components
- Changed the hub-net network configuration to external in docker-compose.
- Removed the Single Sign-On (SSO) service implementation and associated login form component.
- Enhanced authentication callback logic to improve error handling and redirect management.
- Updated various routes to streamline login and authentication processes, ensuring proper redirection to workspace login.
- Cleaned up unused code and improved overall structure for better maintainability.
2026-05-11 17:17:37 -05:00
5dbce1a523 fix: remove cacheDir from Vite configuration 2026-05-11 10:17:20 -05:00
c9d8bf666a fix: update docker-compose network to external and enhance avatar URL resolution logic 2026-05-11 08:39:16 -05:00
fb89ed0569 Merge pull request 'feat: enhance user avatar handling and synchronization with Workspace' (#381) from feature/profile-photo into development
Reviewed-on: ADUANASOFT/anexo76#381
2026-05-08 22:34:06 +00:00
1dbc75107f feat: enhance user avatar handling and synchronization with Workspace
- Updated sidebar component to merge user data from Keycloak and Workspace, including avatar URLs.
- Refactored nav-user component to utilize new avatar resolution logic and display user information more effectively.
- Introduced a new utility function to resolve user avatar URLs, prioritizing Workspace avatars.
- Implemented backend changes to support synchronization of user profile data, including avatar URLs from Workspace.
- Added database migration to include new fields for Workspace profile synchronization in user_tenants.
- Created a new client for fetching user profiles from Workspace.
- Updated dashboard components to reflect changes in user data structure and avatar handling.
- Removed avatar upload functionality from the profile update process, relying on Workspace for avatar management.
- Added tests for avatar resolution logic to ensure correct prioritization of avatar sources.
2026-05-08 17:03:29 -05:00
315c94219b feature/api-sittar-actualizacion 2026-05-08 12:54:19 -06:00
9bcbc5bc02 Merge pull request 'Se movio la parte de descargas del sidbar al botoncito en reportes' (#378) from fix/descargas-reportes into development
Reviewed-on: ADUANASOFT/anexo76#378
2026-05-08 16:25:20 +00:00
0dd947becf Merge pull request 'Docble click implemnetado, ademas de habilitar permisos para mostrar editar y elimnar correctamente' (#377) from fix/botones-empresas into development
Reviewed-on: ADUANASOFT/anexo76#377
2026-05-08 16:24:22 +00:00
4cadce77fe Merge pull request 'fix/pediemntos-fecha-inicio' (#375) from fix/pediemntos-fecha-inicio into development
Reviewed-on: ADUANASOFT/anexo76#375
2026-05-08 16:23:30 +00:00
1a7e4e7e89 Merge pull request 'fix/clases-selector' (#374) from fix/clases-selector into development
Reviewed-on: ADUANASOFT/anexo76#374
2026-05-08 16:22:51 +00:00
39209501ab Merge pull request 'fix/facturas-ame-mex-2' (#373) from fix/facturas-ame-mex-2 into development
Reviewed-on: ADUANASOFT/anexo76#373
2026-05-08 16:22:24 +00:00
2c550eed04 Se movio la parte de descargas del sidbar al botoncito en reportes 2026-05-08 11:10:29 -05:00
61193c4a21 Docble click implemnetado, ademas de habilitar permisos para mostrar editar y elimnar correctamente 2026-05-08 10:33:43 -05:00
4eeec0efd2 Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into fix/pediemntos-fecha-inicio 2026-05-08 09:48:40 -05:00
a9cd2b73ce Validacion de errores en pediemntos y tipos de transporte 2026-05-08 09:48:24 -05:00
fd26b8e1dd Merge pull request 'feature/profile-photo' (#372) from feature/profile-photo into development
Reviewed-on: ADUANASOFT/anexo76#372
2026-05-08 14:25:32 +00:00
4409d07599 Se puso la fecha inico automatico por la fecha del dia que se hace 2026-05-08 09:04:46 -05:00
ec04edd8c0 Se homologalizo el estilo igual que en clases 2026-05-07 17:06:17 -05:00
246f2d33f7 Se le agrego multiselect a las partes 2026-05-07 16:49:41 -05:00
a3917544f3 Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into fix/facturas-ame-mex-2 2026-05-07 13:57:18 -05:00
52fec4038e feat: implement lazy-link for pending invites and add hub_invite_token to InviteToken model
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 12:41:12 -05:00
04a3c5a8af Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into feature/manuales 2026-05-07 11:56:36 -05:00
69833a530d Traducciones corregidas 2026-05-07 11:54:51 -05:00
beaf9b2f8e Correcion con vite, borrar los print y mejorar la barra de manuales 2026-05-07 11:41:44 -05:00
fdc145b2c6 Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into fix/facturas-ame-mex-2 2026-05-07 10:45:27 -05:00
2456c0086b Solucion a tipos de datos, blindaje y resoluciones con el token expirado 2026-05-07 10:45:00 -05:00
4b7cc13d11 fix/filtros-leyendas 2026-05-07 08:07:30 -06:00
9152750a9f feature/bitacora-correccion-por-tenant 2026-05-07 07:52:31 -06:00
d325218d27 merge: integrar development y resolver conflictos en traducciones 2026-05-06 17:02:27 -05:00
1f2f8d1f83 feat: implement user invitation system
- Add InviteToken model and Alembic migration (core.invite_tokens)
- Add invites module: DTOs, service (create/validate/consume), routes
- Register invites router in core router
- Extend auth register endpoint to support invite_token flow:
  - Validate local token, create user via Hub admin API (service account),
    handle existing user (link instead of duplicate), create UserTenant, consume token
- Add GET /auth/register/check endpoint to validate token without consuming
- Add HUB_ADMIN_EMAIL, HUB_ADMIN_PASSWORD, APP_PUBLIC_URL to config
- Frontend: add invite() method and types to users.ts API client
- Frontend: add invite dialog with real roles dropdown to users page
- Frontend: update register page to handle invite flow and user-exists case
2026-05-06 16:57:29 -05:00
85ecdc88fa fix: estabilizar auth, proxy y traducciones del dashboard 2026-05-06 16:57:28 -05:00
daa3a252b9 fix/carga-csv-ergonomia 2026-05-06 14:24:41 -06:00
b212cf63c1 Merge development into feature/manuales and resolve conflicts in HelpDrawer 2026-05-06 14:29:56 -05:00
86a3d703ba feature/mejora-filtros-permisos 2026-05-06 11:46:33 -06:00
9260b5f2ce Merge branch 'development' into feature/catalogos-generales-permisos 2026-05-06 11:13:40 -06:00
e3ad7e7a7e feature/catalogos-generales-permisos 2026-05-06 11:13:09 -06:00
d977b08bf9 Merge pull request 'feat: add first_name and last_name fields to UserTenant model and sync with Keycloak' (#366) from fix/user-profile-edit-keycloak-sync into development
Reviewed-on: ADUANASOFT/anexo76#366
2026-05-06 17:11:07 +00:00
5dd65df3e8 feat: add first_name and last_name fields to UserTenant model and sync with Keycloak
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 12:09:04 -05:00
12dd328eb5 Merge branch 'development' into feature/permisos-reference-data 2026-05-06 08:14:25 -06:00