-
Notifications
You must be signed in to change notification settings - Fork 505
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
Inconsistent minimum Byte Length validation between web app and createKey
API endpoint
#2564
Comments
/award 150 |
Awarding unrenamed: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/unrenamed |
You already have an open issue assigned to you here. Once that's closed or unassigned, only then we recommend you to take up more. |
/assign |
Assigned to @bitbrief! Please open a draft PR linking this issue within 48h |
@bitbrief, please open a draft PR linking this issue within 12 hours. If we can't detect a PR in 12 hours, you will be unassigned automatically. |
Hi @chronark! I am receiving a 404 error during running the api locally. |
I need more context to help, what are you doing and what have you tried to fix it? |
Preliminary Checks
I have reviewed the documentation: https://unkey.com/docs
I have searched for existing issues: https://github.com/unkeyed/unkey/issues
This issue is not a question, general help request, or anything other than a bug report directly related to Unkey. Please ask questions in our Discord community: https://unkey.com/discord.
Reproduction / Replay Link (Optional)
No response
Issue Summary
When setting a default minimum byte length for keys (minimum 8 bytes) in the web app, this setting applies when creating keys via the key creation form. However, when attempting to create a key with the same byte length through the
https://api.unkey.dev/v1/keys.createKey
API endpoint, an error occurs. This inconsistency causes confusion, as it seems the default byte length setting should allow the request to be accepted. Clarifying or aligning these behaviors would improve user experience.The response body:
Steps to Reproduce
https://api.unkey.dev/v1/keys.createKey
endpoint with an 8-byte key in the request body (this should fail with the error body above).Expected behavior
keys.createKey
should use the configured default byte length for the API if thebyteLength
field is not provided (body.byteLength ?? api.defaultByteLength ?? 16
)Other information
No response
Screenshots
No response
Version info
The text was updated successfully, but these errors were encountered: