Skip to content

feat(ui-react): allow Domain on web endpoint without enabling TLS#6323

Merged
gustavosbarreto merged 1 commit into
masterfrom
feat/web-endpoint-ui-domain-without-tls
May 13, 2026
Merged

feat(ui-react): allow Domain on web endpoint without enabling TLS#6323
gustavosbarreto merged 1 commit into
masterfrom
feat/web-endpoint-ui-domain-without-tls

Conversation

@gustavosbarreto
Copy link
Copy Markdown
Member

@gustavosbarreto gustavosbarreto commented May 13, 2026

Refs #6322.

What

Decouples the hostname field in the React Web Endpoint create drawer from the TLS toggle, renames it to Service hostname to drop the ambiguous Domain label that suggested a public URL, and aligns the surrounding microcopy. The create payload now sends the tls object whenever either the toggle is on or a hostname is set.

Why

The backend now treats tls.domain as a Host override even when tls.enabled is false (see #6321). This is the configuration users need to reach plain-HTTP services on a device that validate Host or auto-redirect to a canonical hostname. The previous UI gated the field on the TLS toggle and stripped it from the payload, so that combination was unreachable from the console.

The original Domain label also led to a recurring misunderstanding where the field was filled with the user's internal hostname under the assumption that it controlled the public endpoint URL.

Changes

  • The hostname input is rendered outside the TLS-gated block. FQDN validation runs whenever the field is filled.
  • An asterisk appears next to the field label when TLS is enabled, mirroring the backend rule that tls.domain is required in that case.
  • Create payload includes tls when tlsEnabled || hostname != "". tls.enabled carries the actual toggle value.
  • New section header TLS matches the badge shown on existing endpoints (TLS) and the empty-state card (Device-side TLS).
  • Toggle text reads Service on the device uses HTTPS, with a hint clarifying the toggle controls only the proxy-to-service leg, not the public URL scheme.
  • Field is now labeled Service hostname with a hint describing both roles (Host header override; SNI when the service uses HTTPS).
  • Error message says Enter a valid hostname (e.g. app.example.com).

Out of scope

The legacy Vue UI under ui/ has the same gating issue but is being phased out and is not addressed here.

Related

@gustavosbarreto gustavosbarreto requested a review from a team as a code owner May 13, 2026 13:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

Claude finished @gustavosbarreto's task in 6m 38s —— View job


Code Review Complete

Reviewed 1 file across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo impact against the cloud backend) — no issues found. The code looks good as-is.

Key observations from the review:

  • The new payload shape { tls: { enabled: false, verify: false, domain: "..." } } is fully compatible with the backend stack — the cloud service, SSH proxy handler, OpenAPI spec, and data model all handle this combination correctly.
  • Validation logic correctly requires a valid FQDN whenever tlsDomain is non-empty (regardless of TLS toggle) and requires tlsDomain when TLS is enabled.
  • No security concerns — the domain field is FQDN-validated both client-side and server-side, and is only used for a Host header override on an internal proxy-to-device connection.
  • No existing tests for WebEndpoints.tsx exist in the repo, so no tests need updating.

To request another review round, comment /review.

@gustavosbarreto gustavosbarreto force-pushed the feat/web-endpoint-ui-domain-without-tls branch from 354c332 to 745a842 Compare May 13, 2026 14:17
@gustavosbarreto
Copy link
Copy Markdown
Member Author

/review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

Claude finished @gustavosbarreto's task in 5m 56s —— View job


Code Review Complete

Reviewed 1 file across code quality, security, testing, TypeScript/React patterns, and architecture (including cross-repo impact against the cloud backend) — no issues found. The code looks good as-is.

Key observations from the review:

  • The new payload shape { tls: { enabled: false, verify: false, domain: "..." } } is fully compatible with the backend stack — the cloud service validation, SSH proxy handler, OpenAPI spec, and data model all handle this combination correctly. The verify field is only consumed when enabled is true, so sending it when TLS is off is harmless.
  • Validation logic correctly requires a valid FQDN whenever tlsDomain is non-empty (regardless of TLS toggle) and correctly blocks submission when TLS is enabled but domain is empty. Both client-side (isValidFQDN regex) and server-side (validate:"omitempty,fqdn" tag) enforce consistent FQDN format.
  • No security concerns — the domain field is FQDN-validated on both sides, restricting the character set to [a-zA-Z0-9.-], which prevents Host header injection and CRLF attacks. The field only affects the Host header on an internal proxy-to-device connection, not the connection target itself.
  • No existing tests for WebEndpoints.tsx exist in the repo (predates this PR), so no tests need updating.

To request another review round, comment /review.

The Domain input was hidden unless the TLS toggle was on, and the
create payload only included the tls object when tls.enabled was
true. After #6321 the backend uses tls.domain
as a Host override even when TLS-to-backend is disabled, which is
what users need to reach apps that validate Host or auto-redirect
to a canonical hostname over plain HTTP.

Changes:

- Domain field is always visible. Required only when TLS is on.
- FQDN validation runs whenever Domain is filled, regardless of
  TLS state.
- Payload always includes the tls object when either TLS is on
  or Domain is non-empty, so the backend receives the host hint.
- Labels and hints clarify the dual role:
  * "Use TLS to backend" toggle controls only the proxy-to-backend
    leg; the public URL is always HTTPS.
  * Domain is described as the Host override, becoming SNI when
    TLS is enabled.

Refs #6322
@gustavosbarreto gustavosbarreto force-pushed the feat/web-endpoint-ui-domain-without-tls branch from 745a842 to c8e791b Compare May 13, 2026 14:24
@gustavosbarreto gustavosbarreto enabled auto-merge (rebase) May 13, 2026 14:24
@gustavosbarreto gustavosbarreto merged commit 7807894 into master May 13, 2026
11 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/web-endpoint-ui-domain-without-tls branch May 13, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant