Skip to content

Accept phpredis ACL credentials in Redis::auth and RedisCluster::__construct - #14800

Merged
orklah merged 2 commits into
vimeo:masterfrom
orklah:redis-auth-acl
Nov 24, 2026
Merged

orklah merged 2 commits into
vimeo:masterfrom
orklah:redis-auth-acl

Conversation

@orklah

@orklah orklah commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Redis::auth() rejects phpredis ACL credentials: the PHP 7.0–8.4 callmaps type them as string (used when the redis stub isn't loaded), and the stub misses the user/pass keyed forms.

Before

<?php
function f(Redis $redis): bool {
    return $redis->auth('password')
        && $redis->auth(['password'])
        && $redis->auth(['user', 'password'])
        && $redis->auth(['pass' => 'password']) // ArgumentTypeCoercion
        && $redis->auth(['user' => 'user', 'pass' => 'password']);
}

After

        && $redis->auth(['pass' => 'password']) // no issue

Fixes #14796

🤖 Generated with Claude Code

…nstruct

The PHP 7.0-8.4 callmaps typed the credentials as string (null|string for the
cluster), so code analysed without the redis stub got PossiblyInvalidArgument
for the array forms. Use the forms phpredis accepts (a password, a list of one
or two strings, or user/pass keys) in the overrides and in the stub.

Fixes vimeo#14796

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T08:52:35.542837Z 17b7855 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Performance: unchanged · Types: decreased

Project Memory (MB) Wall (s) Issues Weighted (types) Taint Dead code
✅ laravel 1 747 101.5 $\color{gray}{\textsf{-0.4\%}}$ 25 789 $\color{red}{\textsf{+3}}$ $\color{green}{\textsf{-4}}$ 53 062 $\color{green}{\textsf{-8}}$ 743 0
✅ symfony 3 619 286.8 51 738 $\color{gray}{\textsf{+0}}$ $\color{green}{\textsf{-1}}$ 100 452 $\color{green}{\textsf{-3}}$ 1 582 0
✅ doctrine-orm 381 18.9 $\color{gray}{\textsf{-0.1\%}}$ 3 453 6 194 0 0
✅ psl 618 22.3 $\color{gray}{\textsf{+3.3\%}}$ 1 387 5 600 1 0
✅ phpunit 427 19.7 $\color{gray}{\textsf{+1.3\%}}$ 1 735 3 418 18 0
✅ php-parser 226 12.5 $\color{gray}{\textsf{+0.6\%}}$ 17 113 21 177 0 0
✅ tempest 887 35.1 $\color{gray}{\textsf{+0.1\%}}$ 5 092 10 537 275 0
✅ amphp-amp 48 1.0 $\color{gray}{\textsf{-1.0\%}}$ 29 49 0 0
✅ webmozarts-assert 274 3.1 575 2 714 0 0
✅ guzzle-promises 46 1.1 155 433 2 0
✅ monolog 134 4.2 $\color{gray}{\textsf{+5.0\%}}$ 918 2 491 11 0
✅ drupal 4 767 192.2 $\color{gray}{\textsf{-5.2\%}}$ 97 838 169 303 575 0
✅ wordpress 2 012 196.0 $\color{gray}{\textsf{+1.5\%}}$ 143 499 $\color{red}{\textsf{+1}}$ $\color{green}{\textsf{-1}}$ 678 345 505 1
Total 15 186 894.5 $\color{gray}{\textsf{-0.8\%}}$ 349 321 $\color{red}{\textsf{+4}}$ $\color{green}{\textsf{-6}}$ 1 053 775 $\color{green}{\textsf{-11}}$ 3 712 1
How to read this table
  • Memory: Psalm's own peak figure, threads=1. More than +5 % fails, unless the PR changes composer.json.
  • Wall: base and head run on the same runner; ±10 % is noise. Above +10 % warns, never fails. re-run: a reversed second run was taken and the faster kept.
  • Issues: head count over all categories, then $\color{red}{\textsf{+added}}$ $\color{green}{\textsf{-removed}}$ against base.
  • Weighted (types): type issues weighted by error level (levels 1–8 as is, always-errors 10, strictness checks 1). Taint and dead-code issues are not weighed. The projects' own code is pinned and their dependencies resolve identically for base and head, so a change means Psalm reports more, fewer or differently serious issues. A rise is not necessarily a regression.
  • Taint: head count of Tainted* issues, then $\color{orange}{\textsf{+added}}$ $\color{orange}{\textsf{-removed}}$ against base. Both are orange as either direction needs review: more can be new detection or false positives, fewer can be fixed false positives or lost detection.
  • Dead code: head count of unused-code issues, shown only when a run reported some (findUnusedCode). More is red, fewer is green.
  • Total: sum over the projects compared on both sides. Its wall time warns above +5 % (±5 % is noise); the other thresholds apply per project.
  • Colors: $\color{red}{\textsf{red}}$ past a fail or warn threshold (or more issues), $\color{green}{\textsf{green}}$ an improvement past noise (or fewer issues), $\color{orange}{\textsf{orange}}$ needs review, $\color{gray}{\textsf{gray}}$ noise.
  • Performance: regressed if a head run crashed or timed out or a memory or wall delta is red, else improved if one is green, else unchanged. Its icon is the check result: ❌ fail · ⚠️ warn · ✅ pass; the icon next to each project is that project's result, 💥 = not comparable: base crashed or timed out (counts as ⚠️).
  • Types (heading): direction of the total weighted change, increased · decreased · unchanged. Taint and Dead code (heading): added and removed counts, present only when non-zero. Informational, never fails the check.
✅ laravel: issues +3 −4

Memory 1 747 → 1 747 MB (<0.1 %) · Wall 101.9 → 101.5 s (−0.4 %)

Weighted 53 070 → 53 062 (−8, −0.02 %): L1 +1 · L3 −1 · L6 −1

Issue type added removed
InvalidArgument 0 1
MixedArgument 2 2
MixedArgumentTypeCoercion 1 0
PossiblyInvalidArgument 0 1

Changed in place (3)

@​@​ src/Illuminate/Redis/Connectors/PhpRedisConnector.php:113 @​@​
- InvalidArgument:           Argument 1 of Redis::auth expects string, but list{mixed, non-falsy-string} provided
+ MixedArgumentTypeCoercion: Argument 1 of Redis::auth expects array{0?: string, 1?: string, pass?: string, user?: string}|string, but parent type list{mixed, non-falsy-string} provided

@​@​ src/Illuminate/Redis/Connectors/PhpRedisConnector.php:115 MixedArgument @​@​
- …auth cannot be non-empty-mixed, expecting string
+ …auth cannot be non-empty-mixed, expecting array{0?: string, 1?: string, pass?: string, user?: string}|string

@​@​ src/Illuminate/Redis/Connectors/PhpRedisConnector.php:219 @​@​
- MixedArgument:           Argument 6 of RedisCluster::__construct cannot be array<array-key, mixed>|mixed|null|string, expecting null|string
- PossiblyInvalidArgument: Argument 6 of RedisCluster::__construct expects null|string, but possibly different type possibly undefined array<array-key, mixed>|mixed|null|string provided
+ MixedArgument:           Argument 6 of RedisCluster::__construct cannot be array<array-key, mixed>|mixed|null|string, expecting array{0?: string, 1?: string, pass?: string, user?: string}|null|string
✅ symfony: issues +0 −1

Memory 3 619 → 3 619 MB (<0.1 %) · Wall 286.7 → 286.8 s (<0.1 %)

Weighted 100 455 → 100 452 (−3, <0.01 %): L3 −1

Issue type added removed
PossiblyInvalidArgument 0 1

Removed (1)

  • src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php:244 PossiblyInvalidArgument (error): Argument 6 of RedisCluster::__construct expects null|string, but possibly different type array<array-key, string>|null|string provided
✅ wordpress: issues +1 −1

Memory 2 012 → 2 012 MB (<0.1 %) · Wall 193.1 → 196.0 s (+1.5 %)

Issue type added removed
MixedArgument 1 1

Changed in place (1)

@​@​ src/wp-includes/SimplePie/src/Cache/Redis.php:100 MixedArgument @​@​
- … Redis::auth cannot be mixed, expecting string
+ … Redis::auth cannot be mixed, expecting array{0?: string, 1?: string, pass?: string, user?: string}|string

head 3cf4ca8 · base e3b3676 (merge-base) · workflow run

@orklah
orklah merged commit ddbb02b into vimeo:master Nov 24, 2026
72 checks passed
@orklah
orklah deleted the redis-auth-acl branch November 24, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redis::auth ACL credentials rejected by generated call map despite correct extension stub

1 participant