Sync upstream updates: Larastan 4.x, passkey handles and icons, Socialite redirects and Reverb pruning
Merged
BI
18h ago+1769+1769+0123456789012345678901234567890123456789-876-876-012345678901234567890123456789
Upstream Updates
- Port the migration cache tests for a cache directory that can't be used and for a disabled cache. Hypervel never removed the enableMigrationCache flag, so the source is unchanged.
- Check dispatch() arguments by giving PHPStan a virtual new of the job class through NodeCallbackInvoker, instead of calling PHPStan's internal parameter check. The arguments now get the same checks and messages as a written new, including deprecated classes and classes without a constructor.
- Merge the version-specific type fixtures into their base files, as Larastan did when it dropped older Laravel versions, and port the Arrayable and translator cases. Hypervel supports one framework version and its trans() already declares the concrete translator, so the source already matched.
- Return passkey user handles as 64 hex characters instead of binary. Some platforms, including iOS Safari, read binary handles as UTF-8 text and send back a corrupted handle, so sign-in failed. Handles stored earlier still verify, and a handle that no longer matches its credential asks the user to register the passkey again instead of causing a server error.
- Add light and dark authenticator icons through Aaguids::iconFor() and two Passkey accessors. The icons ship in a generated resource file that loads the first time an icon is requested. The sync script also rejects icons that aren't SVG data URIs.
- Pass every passkey validation message through __() so it can be translated.
- Resolve relative OAuth redirect URLs against app.url instead of the request's host, so a forged Host header can't change the redirect_uri sent to the provider. Network-path redirects such as //evil.test are resolved the same way, and app.url must be an absolute HTTP or HTTPS URL.
- Port the Redis message handler failure test. Hypervel already rejected payloads it couldn't encode before publishing, and kept reading after a handler failed.
- Dispatch ConnectionPruned with the pruned connection's subscription, preferring one with presence data, so listeners can see which user was pruned. The connection registry isn't needed: Hypervel's ping and prune jobs already check every open connection, including ones without subscriptions. The integration test server now runs the real ping and prune jobs, and the tests for unsubscribed connections, the connection quota and closing rejected connections are ported.
Additional Hypervel changes
- Check dispatchAfterResponse() arguments as the dispatch() call it makes from inside the class. A job class that defines its own dispatch() now decides those arguments, and a job that only changes the trait's dispatch() visibility is still checked against its constructor. The rule used to report valid calls on such classes and miss invalid ones.
- Infer the same type for trans() and __() whether the key is passed directly, in a non-empty unpacked list, or by name in an unpacked array that always has it. Unpacked keys used to get a stricter type than a direct key, and an always-empty unpack before the key made it look missing.
- Ignore a user_id in the subscription data a client sends for a public Reverb channel. That data isn't signed, and pruning and user termination identify connections by user_id, so a client could name another user in ConnectionPruned events or keep its own user's connections from being terminated. Private and presence channels are unchanged, and other metadata is kept.
- Translate the two passkey verification messages that were left untranslated.
- Make every member of Passport's cache configuration optional, as Sanctum's already are. A partial record such as ['enabled' => true] used to fail at startup. Omitting enabled now disables caching, and an omitted store, TTL or prefix uses the default cache store, 300 seconds or passport. Invalid values still fail. Passport::cacheEnabled() and Sanctum::cacheEnabled() now own each package's enabled check.
Summary by cubic
Syncs upstream updates from Laravel packages, including passkey sign-in fixes, a Socialite redirect security fix, two Reverb security fixes, relaxed Passport cache configuration, PHPStan rule rewrites, and improved Reverb pruning.
Bug fixes and security
- Passkey user handles are now hex-encoded instead of binary, fixing sign-in failures on platforms like iOS Safari that corrupt binary handles; previously stored binary handles still verify.
- Relative Socialite redirects now resolve against
app.urlinstead of the request host, so a forged Host header can no longer change theredirect_urisent to the provider. ConnectionPrunednow carries the pruned connection's subscription, so listeners see which user was pruned.- Wire subscriptions to unsigned channels no longer name a user:
user_idis dropped from public channel data so forgedchannel_datacan't spoofConnectionPrunedor block user termination. Private and presence channels keep their signed bytes. - Public subscription data that can't be re-encoded (for example, an out-of-range number decoded as
INF) now throwsInvalidMessageFormatand removes the newly created channel, so a client can't leave empty channels in the worker's channel map.
Configuration and tooling
- Every Passport cache setting is now optional with package defaults; a partial config like
['enabled' => true]no longer fails at startup. Passport::cacheEnabled()andSanctum::cacheEnabled()each own their package's enabled check.- The dispatch argument rule now uses PHPStan's
NodeCallbackInvokerand checksdispatchAfterResponse()from inside the job class, so a protected or by-referencedispatch()reports correctly. trans()and__()return the same type whether the key is passed directly or unpacked, including through always-empty unpacks.- Larastan 4.x version-specific test fixtures and the Arrayable cases are consolidated; migration cache tests cover an unavailable cache directory and a disabled cache.
- Reverb's integration test server now runs the real ping and prune jobs; tests for unsubscribed connections, connection quotas, and rejected connections are ported.
[!NOTE]
Sync upstream: passkey icons and translated errors, Socialite redirect origin, Reverb pruning, Larastan 4.x
- Passkeys add authenticator light/dark icon accessors on
Passkey backed by a lazy-loaded Aaguids icon map, plus a sync script for AAGUID names and icons. Passkey failure messages now go through the translation helper, and InvalidUserHandleException in VerifyPasskey.php becomes an InvalidPasskeyException.
- User handles are now hex-encoded (64 chars) instead of raw binary, since some platforms treat them as UTF-8 text and corrupt binary bytes.
- Socialite slash-prefixed redirects resolve against
app.url, which must be an absolute HTTP(S) URL; otherwise SocialiteManager throws InvalidArgumentException.
PruneStaleConnections now takes a ChannelManager and dispatches ConnectionPruned with the connection's matching subscription data, preferring one with a user_id.
- Passport and Sanctum cache settings centralize enablement checks (
Passport::cacheEnabled(), Sanctum::cacheEnabled()) with defaults of disabled, 300s TTL, and passport prefix.
- The PHPStan Larastan fork upgrades to 4.x-style fixtures and improves dispatch-rule and translation-helper (
__(), trans()) type inference, including named arguments and unpacking.
- Behavioral Change: passkey serialization omits icon fields by default;
InvalidPasskeyException::make no longer translates supplied message strings; Socialite relative callbacks no longer derive their origin from the request host; Passport/Sanctum caches stay off unless explicitly enabled.
Macroscope summarized 4b31281.
Summary by CodeRabbit
- New Features
- Passkeys now support light- and dark-mode authenticator icons, which can be accessed directly and included in serialized data when explicitly requested.
- Bug Fixes
- Passkey user handles use a format more resilient to platform encoding issues, and mismatched handles or stale challenges are rejected with clearer, localized errors.
- Social login redirects now resolve relative paths using the configured application URL and reject them when that URL is missing or invalid.
- Pruning stale connections now preserves matching channel subscription details in notifications.
- Documentation
- Clarified passkey handle requirements, cache defaults, authenticator icon behavior, and social login redirect configuration.