Skip to content

fix(GH-1782): harden parseJwt validation and error handling#2373

Open
ThomasAFink wants to merge 2 commits into
mainfrom
clean-gh-1782-parsejwt-validation
Open

fix(GH-1782): harden parseJwt validation and error handling#2373
ThomasAFink wants to merge 2 commits into
mainfrom
clean-gh-1782-parsejwt-validation

Conversation

@ThomasAFink
Copy link
Copy Markdown
Member

@ThomasAFink ThomasAFink commented May 19, 2026

Validate JWT structure, apply base64url padding before atob, and throw JwtParseError with clear messages when decoding or JSON parsing fails.

Pull Request Checklist (Feature Branch to next):

  • Ich habe die neuesten Änderungen aus dem next Branch in meinen Feature-Branch gemergt.
  • Relevante Tests wurden mit zmsautomation ausgeführt.
  • Das Code-Review wurde abgeschlossen.
  • Fachliche Tests wurden durchgeführt und sind abgeschlossen.
  • Ich habe erforderliche Dokumentation im Ordner docs hinzugefügt.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Warning

Rate limit exceeded

@ThomasAFink has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 58 minutes and 49 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, 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 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5d0c2a3b-19f1-4b52-a0bd-e2d4ac5d480c

📥 Commits

Reviewing files that changed from the base of the PR and between df32531 and 9d8ffbd.

📒 Files selected for processing (2)
  • zmscitizenview/src/utils/auth.ts
  • zmscitizenview/tests/unit/utils/auth.spec.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch clean-gh-1782-parsejwt-validation

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.

Validate JWT structure, apply base64url padding before atob, and throw
JwtParseError with clear messages when decoding or JSON parsing fails.
@ThomasAFink ThomasAFink force-pushed the clean-gh-1782-parsejwt-validation branch from 2136234 to 4e0fdb9 Compare May 19, 2026 13:55
@ThomasAFink
Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add validation and error handling to parseJwt function in auth.ts

1 participant