-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs: add jwt string validator #4069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe documentation has been updated to include a new section on JSON Web Tokens (JWTs) in the README file. A new method, Changes
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for guileless-rolypoly-866f8a ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
README.md (1)
1012-1019: Documentation Update: JWT String ValidatorThe new JWT section clearly explains the addition of the
z.string().jwt()method introduced in Zod 3.24. It effectively details that this method validates the format of a 3-part JWT and notes that it does not perform cryptographic verification. The provided example showing how to constrain the JWT to a specific algorithm (e.g., RS256) is clear and valuable.A couple of minor suggestions:
Clarify the required claim: Consider specifying that the JWT’s protected header is expected to include a “typ” (type) claim. For example, update the sentence to:
"Thez.string().jwt()method validates that the string is a valid 3-part JWT. The JWT must contain atypclaim in its protected header."
This change may reduce ambiguity for readers.Grammar nitpick: On line 1015, the phrase
"It merely ensures its in the proper format."
should be corrected to
"It merely ensures it's in the proper format."
to improve clarity.
Here’s a suggested diff:- This does not verify your JWT cryptographically! It merely ensures its in the proper format. + This does not verify your JWT cryptographically! It merely ensures it's in the proper format.🧰 Tools
🪛 LanguageTool
[uncategorized] ~1018-~1018: “its” (belonging to it) seems less likely than “it’s” (it is)
Context: ...WT cryptographically! It merely ensures its in the proper format. Use a library lik...(AI_HYDRA_LEO_CPT_ITS_ITIS)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(10 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~1018-~1018: “its” (belonging to it) seems less likely than “it’s” (it is)
Context: ...WT cryptographically! It merely ensures its in the proper format. Use a library lik...
(AI_HYDRA_LEO_CPT_ITS_ITIS)
|
Deployment failed with the following error: |
A JWT validator was introduced in Zod 3.24, but this change has not yet been reflected in the documentation. This pull request aims to rectify that by incorporating the release notes and adding a note that the JWT must include a type claim in the protected header for it to be successfully validated.
Summary by CodeRabbit