Repository navigation
test: 32-byte JWT secrets; cache fixtures stop depending on a live Redis - #55
Merged
Merged
Conversation
…n a live Redis The release PR's CI run installs the package with pip, unpinned, on a runner with no Redis, and 48 tests failed plus 10 fixtures errored. Both causes sat in the tests and examples: PyJWT 2.15 warns at every encode and decode when the HMAC key is shorter than 32 bytes (RFC 7518, 3.2), and the suite runs with warnings as errors. Every test, example and doc snippet used a short secret; all of them now use values of 32 bytes or more, and the authentication guide says why. The Meta.cache tests built their app against whatever Redis answered on localhost:6379. A local one always did, so the startup ping passed; on the runner the warning fired inside the fixture. The fixtures now patch the backend's ping while building the app, as the tests already patch its get, set and delete. Verified under the runner's conditions (LIGHTAPI_REDIS_URL at a closed port, pip's versions layered over the lock): 633 passed. Locked: 633.
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 38113857 | Triggered | Bearer Token | b5b2299 | docs/superpowers/plans/2026-10-11-e2e-curl-suite.md | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The release PR #53 runs
test-dev.yml, which installs the package with pip and no lock, on a runner with no Redis. That run was the first time this suite met those two conditions, and 48 tests failed plus 10 fixtures errored. Both causes were in the tests and examples, not in the library:test-secret-key,secret,my-secret). They now use values of 32 bytes or more;docs/advanced/authentication.mdsays why.Meta.cachetests built their app against whatever Redis was onlocalhost:6379. On my machine one is always up, so the startup ping passed and the warning never fired; on the runner it did, and the warning became an error inside the fixture. The fixtures now patch the backend'spingwhile building the app, like the tests already patch itsget,setanddelete.Reproduced and verified locally under the runner's conditions,
LIGHTAPI_REDIS_URLpointing at a closed port and the versions pip resolved there layered over the lock (uv run --with anyio==4.15.1 --with starlette==0.52.1 --with pyjwt==2.15.1 --with sqlalchemy==2.0.54 --with pydantic==2.14.1): 632 passed, 0 failed. Under the locked versions: 633 passed.ruff,mypyandmkdocs build --strictclean.