PhoenixKit 1.7.190: Encrypted integration keys and new-login alerts
PhoenixKit 1.7.190 fixes integration credentials that were stored as plain text on most sites, adds an optional email when an account signs in from a new device, and lets mail go out through an integration.
Credentials are now encrypted
Encryption of integration secrets, such as AWS SES or Brevo keys, depended on a setting the installer never wrote, so on most sites it was off. It now falls back to the app’s own endpoint secret_key_base. Old plain values still work and are encrypted the next time they are saved. SMTP passwords are encrypted too.
New-login alerts and mail
With Login Notifications on in the authorization settings, a sign-in from an unknown device emails the user. It is off by default. Mail can now be sent through an Amazon SES, SMTP or Brevo API integration, and addresses blocked by the Emails module are refused on every outgoing path. Migrations V143 to V145 add known devices, move the machine and warehouse tables into core, and add newsletter send profiles.
Upgrading
Run mix phoenix_kit.update. Save each integration once to encrypt it. After that, changing secret_key_base makes the stored credentials unreadable.
Full release notes: PhoenixKit 1.7.190
1.7.190 · 13 July 2026
Security
- Integration credentials (AWS SES, SMTP, Brevo API keys, etc.) were
silently stored in plaintext on real host apps.
encryption_key/0only read the flatconfig :phoenix_kit, secret_key_base:— a key the installer never sets — so encryption was effectively always disabled outside of manual, undocumented setup. Now falls back to the host app’s own Phoenix Endpointsecret_key_base(which every Phoenix app has), keeping the flat key’s precedence so any install that did set it derives an identical key. Pre-existing plaintext values still read back correctly and are transparently re-encrypted on next save.passwordfields (SMTP) now encrypt too. The KDF is also correctly documented now (a single SHA-256, not PBKDF2 as previously claimed).
Added
- Integrations-backed email sending foundation (“Phase 1” of a
multi-repo newsletters effort —
phoenix_kit_emailsandphoenix_kit_newslettersboth depend on this release). AddsPhoenixKit.Mailer.deliver_via_integration/3, which sends through any configuredPhoenixKit.Integrationsconnection instead of only the host’s static mailer adapter:aws_ses(key/secret), a new universalsmtpprovider (one named connection per vendor — Brevo, Mailgun, SendGrid, a self-hosted relay, etc.), andbrevo_api(with a real Test Connection check against Brevo’s account endpoint). SMTP transport correctly selects implicit TLS (ssl: true) on port 465 vs. mandatory STARTTLS elsewhere when credentials are present, failing closed rather than risking a plaintext credential leak. Recipients blocklisted by the optionalphoenix_kit_emailspackage (hard bounces, complaints, manual blocks) are now refused before delivery on every outbound path, not just newsletters — auth mail included. New migration V145 addsphoenix_kit_newsletters_send_profiles(named send configurations, at most one default, partial-unique-indexed) andphoenix_kit_newsletters_broadcasts.send_profile_uuid. - New-login security alerts (“We noticed a new login to your
account”, the same pattern GitHub/xAI/etc. use). Every login path
(password, magic link, OAuth, QR) now checks the login’s device
(IP + hashed user-agent) against history for that user; an unrecognized
device is emailed and logged as
user.new_login_detected, a recognized one is silent. Off by default — enable at Admin → Settings → Authorization → “Login Notifications”. New migration V143 addsphoenix_kit_user_known_devices. - Manufacturing/warehouse module tables consolidated into core. Moves
phoenix_kit_machines,phoenix_kit_machine_type_assignments,phoenix_kit_machine_operations,phoenix_kit_warehouse_transfers, andphoenix_kit_warehouse_min_stockout of thephoenix_kit_manufacturing/phoenix_kit_warehousepackages’ own migrations and into core’s single numbered chain (V144), matching the precedent already set for locations and other warehouse tables. Upgrade-safe for hosts on publishedphoenix_kit_manufacturing0.2.0.
Changed
- Dropped
Jasonin favor of Elixir’s built-inJSONmodule (1.18+) everywhere in phoenix_kit’s own code — no behavior change;jasonitself stays in the dependency tree (ecto,phoenix,ex_aws, and others still require it transitively). ex_aws_sqsreplaced with the maintainedbeamlab_ex_aws_sqsfork. Unblocks Hex publishing itself: upstreamex_aws_sqs(archived, last released January 2023) pinshackney ~> 1.9, which cannot coexist with thehackney ~> 4.0upgrade below without anoverride: true— and Hex refuses to publish any package depending on one. The fork declares no hackney dependency at all. SQS now speaks AWS’s JSON protocol instead of the legacy XML protocol (response shapes changed accordingly inPhoenixKit.AWS.InfrastructureSetup); fixed a related latent bug surfaced by the switch — the “queue already exists” fallback checked for AWS error codeQueueAlreadyExists, but the real SQS API error isQueueNameExists.- Ported the multi-session “Accounts” switcher (add/switch/remove
account, “log out from all accounts”) into
UserDashboardNav.user_dropdown/1— previously only the admin top-bar dropdown had it, so host apps rendering their own layout viauser_dropdown/1had no multi-session UI at all.
PhoenixKit 1.7.190. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.