Skip to content

fix: redact invalid JWT cookie log - #25

Merged
tnware merged 1 commit into
mainfrom
fix/redact-invalid-jwt-cookie-log
May 26, 2026
Merged

tnware merged 1 commit into
mainfrom
fix/redact-invalid-jwt-cookie-log

Conversation

@tnware

@tnware tnware commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Redacts the raw UniFi OS TOKEN cookie value from the invalid-JWT warning path
  • Keeps the warning signal so malformed cookies remain diagnosable without leaking token material
  • Adds a regression test that captures logs and asserts the invalid token value is absent

Test Plan

  • python -m pytest tests/test_csrf_token.py::test_invalid_jwt_structure_warning_does_not_log_token_value -q — failed before implementation because the token value appeared in logs
  • ruff check . — pass
  • python -m pytest -q — pass
  • python -m build — pass
  • twine check dist/* — pass
  • sphinx-build -E -W -b html docs docs/_build/html — pass
  • git diff --check — pass

@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tnware, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 45 minutes and 46 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e001bce5-9062-4f8a-8485-94b87fde1a67

📥 Commits

Reviewing files that changed from the base of the PR and between 0446e67 and 1d17608.

📒 Files selected for processing (2)
  • tests/test_csrf_token.py
  • unifi_controller_api/api_client.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/redact-invalid-jwt-cookie-log

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tnware
tnware merged commit b7d6021 into main May 26, 2026
7 checks passed
@tnware
tnware deleted the fix/redact-invalid-jwt-cookie-log branch May 26, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant