What’s New

This page summarizes the new features and improvements introduced in the 1.8.x series of django-suap-auth.

Note

This page must be updated with every new release published.

Version 1.8.16

  • Paginated SUAP Responses Read in Full: SUAP list endpoints are paginated (100 items per page). When fetching user_info_endpoints, the new fetchers.get_all_pages function follows next and joins the results of every page into an envelope with a null next. Limited to 50 pages (MAX_PAGINAS); next is only followed on the configured SUAP host.

Version 1.8.15

  • Fix: Paginated SUAP Links Were Not Saved: /api/rh/meus-vinculos/ returns {"count", "next", "previous", "results": [...]}, but sync_suap_profile only accepted a list and discarded the response. Vinculo rows were never refreshed on login and kept stale values (e.g. modality Técnico Integrado instead of Técnico integrado ao ensino médio). The new lista_de_vinculos function accepts the list or the paginated response (uses the first page and logs a warning if there are more), also when extracting institutional phones. Each user’s links are fixed on their next login.

Version 1.8.14

  • Export and Import Users with Profile, Links and Raw Data: New django_suap_auth.profile.transfer module, “Exportar (JSON)” action and “Importar usuários” page (with preview and confirmation) in CustomUserAdmin, superusers only, and export_suap_user / import_suap_user [--dry-run] commands. The import is transactional, upserts by username, replaces links and raw data and never carries the password, is_staff, is_superuser, groups or permissions. The file contains personal data. See Exporting and Importing Users.

Version 1.8.13

  • Fix: Missing Migration for Vinculo identificador and tipo Fields: The model declared these fields with max_length=256 and null=True, but the database still had varchar(50) NOT NULL; saving a link without these values or with more than 50 characters failed. Added migration 0010 and a test that fails whenever a model change has no migration.

Version 1.8.12

  • Fix: “Raw Data” Inline JSON Editor When Adding a Record: In Django Admin, clicking “Add another Raw Data” for a user without DadosBrutos showed the JSON editor but it did not accept input (the admin clones the empty form template and the JSONEditorWidget init <script> does not run in the copy), so the record was saved as {}. DadosBrutosInline now uses InlineJSONEditorWidget (django_suap_auth.profile.widgets), which initializes the editor from a static JS file, skips the empty form template (__prefix__) and handles the formset:added event.

  • Fix: Absolute Endpoints Restricted to the base_url Host (SSRF): Absolute endpoint URLs are only accepted with the same scheme and host as base_url and are always rebuilt on top of it; other hosts are rejected, so the Bearer token is never sent to arbitrary hosts.

  • Fix: Fixed Messages in JWT Endpoint Error Responses: 400/500/503/504 responses no longer expose exception text; the exception is still logged.

Version 1.8.9

  • Access-Denied Page for Authenticated User Without Permission: SuapLoginView now detects when it is hit by an already-authenticated user (a sign that a permission check elsewhere failed, such as Django Admin’s has_permission) and, instead of restarting the OAuth2 flow — creating a confusing login loop —, renders a page explaining that the user is logged in but lacks permission for the requested resource. Customizable via the access_denied_template attribute.

  • Fix: Missing Translation Catalogs in the Published Package: The test and publish workflows now run django-admin compilemessages before running tests/building the package. Previous releases (including 1.8.8) never shipped compiled .mo files, so no translation (English, Dutch) actually worked on PyPI installs — Django always fell back to the default Portuguese text.

Version 1.8.8

  • Sentry Notification Level Set to ``info`` for Secondary Sync Failures: Notifications sent to Sentry when fetching secondary SUAP user info endpoints now use severity level info instead of error, avoiding error/bug alerts for non-critical failures that do not block user login.

Version 1.8.7

  • Prioritized Persistence of DadosBrutos: Updated the profile sync workflow (sync_suap_profile) to save the DadosBrutos raw data model before attempting to build or save Perfil and Vinculo models, guaranteeing raw SUAP data is persisted even if profile save fails.

Version 1.8.6

  • Profile and Audit Model Field Length Expansion: Increased max_length of profile, audit, and error model fields (from 10/50/100 to 256) to prevent DataError failures when receiving longer text values from SUAP API endpoints (e.g. gender “PREFERE NÃO INFORMAR”, blood type “NÃO INFORMADO”).

  • Sentry Error Filtering for HTTP 404 and 403: Updated report_sync_error_to_sentry service to ignore HTTP 404 (Not Found) and 403 (Forbidden) statuses during secondary fetcher requests, avoiding false error alerts in Sentry when optional endpoints have no data for specific users.

Version 1.8.5

  • Error Handling in Secondary Fetchers: Fixed fault tolerance when retrieving user profile data via fetchers and SUAP API endpoints. Errors on secondary endpoints now record sync errors in _sync_errors and allow login to complete, interrupting authentication only if the failure occurs on the primary identification endpoint (/api/rh/eu/).

Version 1.8.4

  • Dutch Internationalization (``nl``): Added code internationalization support for Dutch (translation catalogs .po/.mo for nl).

Version 1.8.3

  • Audit Alert Settings: Externalized security alert thresholds to settings.py via SUAP_AUTH_AUDIT_* configuration settings.

Version 1.8.2

  • Django Admin Shortcut: Added a direct shortcut button to the Audit Dashboard from the Django Admin Audit Events change list.

Version 1.8.1

  • Resilience & Migration: Added fault-tolerant error handling to audit logging and updated sandbox migrations.

Version 1.8.0

  • New Audit Module (``django_suap_auth.audit``): - Audit logging trail capturing authentication events, token exchanges, and user accesses. - Interactive dashboard integrated into Django Admin. - Security signals and monitoring support.