Summary
Several CLI commands accept URL inputs but lack proper validation, leading to confusing API errors when invalid URLs are provided.
Problem
Commands like instance create, registry create/update, scanner create/update, ldap ping, and webhook edit accept URLs via flags but don't validate them before making API calls. Users see cryptic server errors instead of clear validation messages.
Solution
Add utils.ValidateURL() validation to all commands that accept URL inputs:
instance create - validate --url flag
registry create - validate --url flag
registry update - validate --url flag
scanner create - validate --url flag
scanner update - validate --url flag
webhook edit - validate --endpoint-url flag
Also update corresponding view files to use consistent URL validation in interactive forms.
Summary
Several CLI commands accept URL inputs but lack proper validation, leading to confusing API errors when invalid URLs are provided.
Problem
Commands like
instance create,registry create/update,scanner create/update,ldap ping, andwebhook editaccept URLs via flags but don't validate them before making API calls. Users see cryptic server errors instead of clear validation messages.Solution
Add
utils.ValidateURL()validation to all commands that accept URL inputs:instance create- validate--urlflagregistry create- validate--urlflagregistry update- validate--urlflagscanner create- validate--urlflagscanner update- validate--urlflagwebhook edit- validate--endpoint-urlflagAlso update corresponding view files to use consistent URL validation in interactive forms.