PhoenixKit 2.23.1: Real Google credential check, encrypted payment secrets
PhoenixKit 2.23.1 makes Test Credentials for Google sign-in ask Google itself, encrypts payment and Apple sign-in secrets, and fixes settings that read as empty from a cold cache.
For Google, Test Credentials used to check only that the fields were not empty, so a wrong secret passed. It now asks Google and reports one of three results: Google accepted the credentials, Google rejected them (invalid_client), or the answer was inconclusive, shown as a warning. A secret that is blank or under 16 characters is now refused on save, and stray spaces are trimmed.
The Apple private key and the Stripe, PayPal, Razorpay and EveryPay secrets are now stored encrypted. Saved values keep working and are encrypted on the next save.
Also fixed: batched settings reads returned nil for every key when the cache was cold, which affected modules such as web analytics and publishing. Activity lists keep a stable order, and mix phoenix_kit.status, doctor and update report a module whose database is newer than its code as “ahead of code”.
Upgrading
mix phoenix_kit.status --exit-code now fails for a module that is ahead of code, so a deploy gated on it stops after rolling code back past a module migration.
Full release notes: PhoenixKit 2.23.1
2.23.1 · 13 September 2026
Changed
- A module whose database schema is newer than its code is now reported
as “ahead of code”, not “up to date” (#806).
PhoenixKit.Migrations.Modules.classify/2returns a new:ahead_of_codestatus forinstalled > target(a rollback, or a dependency pinned backwards), with a matchingModules.ahead_of_code/1filter.mix phoenix_kit.statusshows it in red with a new{:modules_ahead_of_code, names}next action;mix phoenix_kit.doctorwarns;mix phoenix_kit.updatenames it instead of printing “up to date”. When another module is genuinely behind,updateis still the next action and the ahead module is listed as an extra reason. Note:mix phoenix_kit.status --exit-codeexits non-zero for this state, as it does for every non-Ready action, so a deploy gated on it fails after a code rollback past a module migration. - Apple Sign-In and billing-provider secrets are encrypted at rest
(#807).
oauth_apple_private_key,billing_stripe_secret_key,billing_stripe_webhook_secret,billing_stripe_api_key,billing_paypal_client_secret,billing_paypal_webhook_secret,billing_razorpay_key_secret,billing_razorpay_webhook_secretandbilling_everypay_api_secretjoinrestricted_setting_keys/0, so writes throughSettings.update_setting/2storeenc:v1:ciphertext andSettings.get_setting/2decrypts. phoenix_kit_billing reads every one of them throughget_setting/2and needs no change. Existing plaintext values keep reading correctly and are encrypted on the next save ormix phoenix_kit.integrations.rotate_key. The public identifiers (Stripe publishable key, PayPal client/webhook ID, Razorpay key ID, EveryPay username/account) stay unencrypted. A new test-support perimeter scan asserts that every secret-shaped setting key core references or seeds is restricted.
Fixed
- Settings batch reads now actually fill cache misses from the database
(#810).
Settings.get_settings_cached/2andget_json_settings_cached/2looked for a missing key inCache.get_multiple/3’s result, but that function returns every requested key and substitutes the default on a miss, so a miss was never detected. A cold or expired cache read asnilfor every key without querying the database. This affected everyget_settings_cached/2caller, including phoenix_kit_web_analytics and phoenix_kit_publishing. Misses are now detected with a sentinel. A restricted key that fails to decrypt is answered but not cached, so the next read retries, matching the boot warmer. A JSON read of a row with no JSON value now cachesnilinstead of “not found”. - Activity feed order is stable when timestamps tie (#809).
Activity.list/1andActivity.recent/1sorted byinserted_atalone, so rows with the same timestamp (every pre-V185 whole-second row) could come back in any order. They now adduuidas a tiebreak. - A blocked role-permissions click shows a translated reason (#805). The
Roles page flashed the raw error atom (
owner_immutable). The message mapping moved fromPermissionsMatrixtoPermissions.edit_role_permissions_error_message/1, and both pages use it. - The OAuth “Test Credentials” button now actually tests the credentials.
It compared each field to
""and nothing else, so a 9-character Google client secret — or a field containing only a space — read as “properly formatted” while Google itself answered the same values with 401invalid_client. For Google, the button now POSTs the current client ID/secret tooauth2.googleapis.com/tokenwith a deliberately invalid authorization code and reads Google’s own verdict:invalid_clientmeans the credentials are wrong;invalid_grantmeans they are right (only the fake code was rejected, as expected) — this “right credentials” leg follows from Google’s documented error definitions and was not itself exercised against a real registered app, and falls back to inconclusive if Google ever answers a correct pair with anything else. Noredirect_uriis sent — this used to send an RFC 2606.invalidplaceholder, which fails Google’s “Host TLDs must belong to the public suffix list” redirect-URI rule and came backinvalid_requestregardless of the credentials, making the check permanently inconclusive; a placeholder on a real public-suffix host was not affected (verified live with fabricated credentials:example.com/localhostand noredirect_uriall answered the sameinvalid_client). A third outcome — could not reach Google, or a response that isn’t cleanly one of the two verdicts above — is reported as inconclusive (a distinct:inconclusiveresult, shown as a warning rather than an error flash), never folded into either a pass or a fail. GitHub and Facebook keep the previous format-only check (now actually enforcing it — see below) rather than an unverified live check against their token endpoints. - A short or blank-looking OAuth secret is now rejected on save, not just
by the button.
PhoenixKit.Users.OAuthConfig.validate_secret_format/2rejects a value that is only whitespace or implausibly short (under 16 characters — real secrets from all three providers are at least 24) beforePhoenixKitWeb.Live.Settings.Authorizationpersists it; the generic settings schema (PhoenixKit.Settings.Setting) is deliberately left alone, since a Google-secret-shaped format check does not belong in a schema shared by every setting in the app. A secret already saved before this fix does not retroactively block saving an unrelated field. A secret with leading/trailing whitespace (a copy-paste artifact) is now trimmed before it is persisted or tested, instead of being saved and sent to the provider padded. - OAuth test-result messages are now translated. The success message was
never wrapped in
gettext— a translated button produced an English response, and the wording (“…properly formatted. Initiate OAuth flow to test actual connection.”) was easy to mistake for “this works” at a glance. All three providers’ messages, on all three (now honest) outcomes, are gettext-wrapped, along with the adjacent “Reload Config” flash and the “Test Credentials” button name repeated in the on-page setup instructions. - Post-merge review fixes (#808, #807). The nine new OAuth msgids had
never been extracted, so every locale still rendered them in English. They
are now extracted and translated into de/es/et/fr/it/pl/ru. The Google
credential check no longer logs an exit/throw reason verbatim (a
GenServer.callexit reason embeds the call’s arguments), matching therescuebranch’s rule. The secret-key perimeter test no longer runs underDataCase, which had silently excluded it on database-less runs.
PhoenixKit 2.23.1. Install or update: {:phoenix_kit, "~> 2.23"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.