-
Notifications
You must be signed in to change notification settings - Fork 713
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
[🔨 Enhancement]: better input validation for providers / add types for inputs #1327
Comments
/bounty 20 |
💎 $20 bounty • Keep (YC W23)Steps to solve:
Thank you for contributing to keephq/keep! Add a bounty • Share on socials
|
/attempt #1327 Options |
I have some questions:
is "/" at the end mandatory?
is http or https mandatory?
waht does it mean?
what enforcements means here? |
part of the task is to figure that out, we don't have all the answers for that. |
/bounty 0 |
/attempt #1327 Options |
Here are some steps and pointers to help you get started on resolving this issue: Steps to Implement Input Validation
Relevant Files
Potential Implications
Reference Similar Code
Example Validation SchemaHere's an example of how you might define a validation schema using import * as Yup from 'yup';
const providerInputSchema = Yup.object().shape({
provider_name: Yup.string().required('Provider name is required'),
url: Yup.string().url('Invalid URL format').required('URL is required'),
host: Yup.string().matches(/^[a-zA-Z0-9.-]+$/, 'Invalid host format').required('Host is required'),
port: Yup.number().min(1).max(65535, 'Invalid port number'),
// Add other fields as necessary
}); Integrating Validation in
|
/attempt #1327
|
/attempt #1327 Options |
/attempt #1327
|
Payout for this bounty will be executed via GitHub Sponsors, not via Algora. Please activate https://github.com/sponsors/accounts for your account to receive the payout, sorry for the inconvenience |
/attempt #1327 |
/attempt #1327 |
Keep need cross-all-providers accepted schemas for provider inputs.
this should be enforced both on frontend (for quickly tell the user what's wrong) and backend (enforcements)
The text was updated successfully, but these errors were encountered: