fix: always regenerate encrypted OAuth secrets in release build#890
fix: always regenerate encrypted OAuth secrets in release build#890superdav42 merged 2 commits intomainfrom
Conversation
The AES key for inc/stuff.php is derived from sha256(inc/class-addon-repository.php).
Any change to that file — even whitespace — changes the key and makes the
committed ciphertext undecryptable, so the OAuth flow to ultimatemultisite.com
sends empty client_id/client_secret and the server replies with:
{"error":"invalid_client","error_description":"No client id supplied"}.
encrypt-secrets.php (run via 'npm run prearchive' in the release workflow)
had an mtime-based shortcut that skipped regeneration when
filemtime(class-addon-repository.php) <= filemtime(stuff.php). In CI,
actions/checkout normalises every file's mtime to the checkout time, so
the shortcut always fired and the stale ciphertext shipped unchanged.
Remove the mtime guard: regenerate the ciphertext unconditionally whenever
MU_CLIENT_ID/MU_CLIENT_SECRET are supplied.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 18 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
|
Performance Test Results Performance test results for f5e463f are in 🛎️! Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown. URL:
|
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
Summary
{\"error\":\"invalid_client\",\"error_description\":\"No client id supplied\"}that every customer on the current release hits when clicking Connect to UltimateMultisite.com on the Addons page.inc/stuff.phpwas shipped encrypted with an AES key derived from an older snapshot ofinc/class-addon-repository.php. Any change to that file changes the sha256 used as the key, soopenssl_decrypt()returnsfalseand the OAuth request is sent with emptyclient_id/client_secret.inc/stuff.phpon every build (vianpm run prearchive→php encrypt-secrets.php), but an mtime shortcut (filemtime(class-addon-repository.php) > filemtime(stuff.php)) always evaluated false in CI —actions/checkoutgives every file the same mtime — so the stale ciphertext was shipped unchanged.Change
encrypt-secrets.php: remove the mtime guard. Regenerateinc/stuff.phpunconditionally wheneverMU_CLIENT_IDandMU_CLIENT_SECRETare supplied. Added an explanatory comment so the optimisation doesn't get reintroduced.Reproduction (before)
Verification
Release plan
After merge, run the release workflow. With the env secrets
MU_CLIENT_ID/MU_CLIENT_SECRETpresent,npm run prearchivewill now regenerateinc/stuff.phpwith the current class file's hash, and the shipped zip will authenticate correctly against ultimatemultisite.com.