Skip to content

Add URL validation to all commands that accept URL input #606

@Sypher845

Description

@Sypher845

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions