chore: Minimum byte length should be consistent#2880
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@harshsbhat is attempting to deploy a commit to the Unkey Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis pull request updates numeric validation for byte length fields across both the web app and API backend. The minimum allowed value for the key’s byte length in the key creation form and default bytes setting has been increased to 16. The changes adjust the validation rules in multiple files by updating the minimum constraints in the form schemas and TRPC procedures. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant "Key Creation Service"
participant "Validation Module"
User->>Key Creation Service: Submit key creation form (bytes field)
Key Creation Service->>Validation Module: Validate bytes (value must be ≥ 16)
Validation Module-->>Key Creation Service: Return validation result
Key Creation Service-->>User: Respond with success or error
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx (1)
73-73: Update UI description to reflect new minimum byte length.The description still mentions "8 to 255" but should be updated to "16 to 255" to match the new validation.
- <span className="font-bold">8 to 255</span> + <span className="font-bold">16 to 255</span>
🧹 Nitpick comments (1)
apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/new/validation.ts (1)
13-14: Consider improving error message for better clarity.While the validation change is correct, the error message could be more specific about the minimum value requirement.
message: issue.code === "invalid_type" - ? "Amount must be a number and greater than 0" + ? "Amount must be a number and at least 16" : defaultError,
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/new/validation.ts(1 hunks)apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx(1 hunks)apps/dashboard/lib/trpc/routers/api/setDefaultBytes.ts(1 hunks)apps/dashboard/lib/trpc/routers/key/create.ts(1 hunks)
🔇 Additional comments (3)
apps/dashboard/lib/trpc/routers/api/setDefaultBytes.ts (1)
14-14: LGTM! Minimum byte length updated to 16.The change aligns with the PR objective to standardize minimum byte length across the dashboard and API.
apps/dashboard/app/(app)/apis/[apiId]/settings/default-bytes.tsx (1)
24-24: LGTM! Minimum byte length updated to 16.The validation change aligns with the PR objective.
apps/dashboard/lib/trpc/routers/key/create.ts (1)
14-14: LGTM! Minimum byte length updated to 16.The change aligns with the PR objective and maintains consistency with other files.
What does this PR do?
The minimum byte length for keys is 8 on the dashboard and 16 on the API. This PR makes sure that it is consistent on both API and Dashboard by making it 16 on the dashboard.
Fixes #2564
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit