Skip to content

feat(cloud-registry): validate the create form like the API #453

Closed as not planned

Description

@uniqueg

Why?

cloud-registry 0.4.0 validates registrations more strictly (elixir-cloud-aai/cloud-registry#118, elixir-cloud-aai/cloud-registry#119, elixir-cloud-aai/cloud-registry#121, elixir-cloud-aai/cloud-registry#152, elixir-cloud-aai/cloud-registry#169). ecc-client-elixir-cloud-registry-service-create only checks that required fields aren't empty. So many inputs pass the form and then fail with 400:

  • [email protected] as contact (the API wants mailto:);
  • http:// service URLs where the deployment allows only https;
  • malformed URLs;
  • text longer than the maximum lengths;
  • free-text createdAt/updatedAt that isn't RFC 3339.

Apps can't add checks from outside the component. The Cloud Registry UI checks these in its own edit form (elixir-cloud-aai/cloud-registry-ui#13), but for the create form it can only show the backend's message.

What?

  • URLs (url, organization.url, contactUrl, documentationUrl): HTTP(S) with a host, and no user info, whitespace, control characters or malformed percent-encodings. contactUrl may also be a mailto: URL.
  • A property for the allowed service URL schemes, e.g., url-schemes (default https), matching the registry's custom.endpoints.services.url_schemes.
  • Max lengths: 1024 for name and organization.name; 4096 for description; 256 for version, environment and type.*; 2048 for URLs.
  • createdAt/updatedAt: RFC 3339 date-times.
  • Show errors at the field, and fire ecc-service-create-validation-failed instead of sending the request.

Acceptance criteria

  • Inputs that the API rejects with 400 are flagged in the form, naming the field.

Activity

  1. added
    priority: medium
    type: feature
    workload: hours
    on Oct 25, 2026
  2. uniqueg commented on Oct 26, 2026

    @uniqueg
    MemberAuthor

    Once elixir-cloud-aai/cloud-registry#256 is done, the registry publishes its registration rules (allowed environments, URL schemes, service type mode and limit). The create form can then read them from the API instead of taking them as properties, with the properties as fallbacks for older registries.

  3. added
    status: in progress
    and removed on Oct 28, 2026
  4. uniqueg commented on Nov 1, 2026

    @uniqueg
    MemberAuthor

    Superseded by #536 (and its blockers #535 and elixir-cloud-aai/cloud-registry#317, which builds on elixir-cloud-aai/foca#586): instead of copying the registry's rules into the component, the registry reports invalid fields and the component shows them (see the discussion in #510).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumstatus: in progresstype: featureworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions