Skip to content
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

API Setting : "Default Prefix" Field Should Not Allow Only Whitespace Values #2297

Open
3 tasks done
Vardhaman619 opened this issue Oct 10, 2024 · 15 comments · May be fixed by #2318
Open
3 tasks done

API Setting : "Default Prefix" Field Should Not Allow Only Whitespace Values #2297

Vardhaman619 opened this issue Oct 10, 2024 · 15 comments · May be fixed by #2318
Assignees
Labels

Comments

@Vardhaman619
Copy link
Contributor

Preliminary Checks

Reproduction / Replay Link (Optional)

No response

Issue Summary

The Default Prefix field for API currently allows input consisting solely of whitespace (e.g., spaces, tabs). This can lead to confusion or hidden issues since whitespace is not easily visible, and the system saves it as a valid prefix. There should be validation to ensure that a valid prefix contains at least one non-whitespace character.

Steps to Reproduce

  1. Navigate to Dashbaord -> APIs -> Select anyone API -> API Settings
  2. Enter only whitespace (e.g., several spaces) in the "Default Prefix" field.
  3. Attempt to save the changes.
  4. Observe that the system saves the field without validation.

Expected behavior

The Default Prefix field should not accept input with only whitespace. A validation error should be shown if the user tries to save the field with just spaces or tabs. The field should require at least one visible character before allowing the user to save.

Other information

Actual Result:

The system allows saving the field even when it contains only whitespace.

Expected Result:

A validation error should appear, prompting the user to enter a valid prefix with at least one non-whitespace character.

Screenshots

video.webm

Version info

.
@Vardhaman619 Vardhaman619 added Bug Something isn't working Needs Approval Needs approval from Unkey labels Oct 10, 2024
Copy link

linear bot commented Oct 10, 2024

@bikaxh01
Copy link

/assign

@Vardhaman619
Copy link
Contributor Author

@bikaxh01 , I’m already working on this issue. I’m just waiting for the label to be assigned so I can officially start.

@harshsbhat
Copy link
Contributor

@Vardhaman619 it's also a problem in the create key trpc route. But wait for approval.

So you will need to validate it for both default prefix and create key.

@perkinsjr perkinsjr added 🕹️ oss.gg 🕹️ 150 points and removed Needs Approval Needs approval from Unkey labels Oct 10, 2024
@perkinsjr
Copy link
Collaborator

/award 150

Copy link

oss-gg bot commented Oct 10, 2024

Awarding Vardhaman619: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/Vardhaman619

@Vinod-Mane3021
Copy link

/assign

Copy link

oss-gg bot commented Oct 10, 2024

Assigned to @Vinod-Mane3021! Please open a draft PR linking this issue within 48h ⚠️ If we can't detect a PR from you linking this issue in 48h, you'll be unassigned automatically 🕹️ Excited to have you ship this 🚀

@YASH-YADAV-dynamo
Copy link

/assign

Copy link

oss-gg bot commented Oct 10, 2024

This issue is already assigned to another person. Please find more issues here.

@Haritscode
Copy link

/assign

Copy link

oss-gg bot commented Oct 11, 2024

This issue is already assigned to another person. Please find more issues here.

Vinod-Mane3021 pushed a commit to Vinod-Mane3021/unkey that referenced this issue Oct 11, 2024
@Usmanxs
Copy link

Usmanxs commented Oct 11, 2024

/assign

Copy link

oss-gg bot commented Oct 11, 2024

This issue is already assigned to another person. Please find more issues here.

@chronark
Copy link
Collaborator

It should actually not allow any whitespace at all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants