fix(validation): symmetric URL error message + close credential URL gap (PMS-351) #273

Merged
nrupard merged 1 commit from fix/pms-351-url-field-validation-sweep into main 2026-06-16 21:52:24 +02:00
Owner

The New Company website field was already validated server-side (PMS-297's validate_website, http(s)-only) but returned a bare invalid_url error code while the phone field carried a human message, so the website error did not surface inline the way phone did. Add the matching message ("must be a valid URL (e.g. https://example.com)") so the two are symmetric.

Sweep the rest of the request-layer URL fields: the credential-vault url on CreateCredentialRequest was free-text the user types yet unvalidated. Add #[validate(url)] (any-scheme, like the RMM api_url field) so it rejects not-a-valid-url / example.com while still allowing rdp://, ssh://, etc. for non-web credentials. RMM api_url was already validated; tenant branding URLs and the feedback honeypot are intentionally left alone (documented).

Add the PMS-351 acceptance cases as unit tests (company website rejects not-a-valid-url, example.com, ftp://example.com and accepts https://example.com; credential url rejects junk, accepts any real scheme) and an audit doc listing every URL field touched and every one left alone with its reason.

#PMS-351

The New Company website field was already validated server-side (PMS-297's validate_website, http(s)-only) but returned a bare invalid_url error code while the phone field carried a human message, so the website error did not surface inline the way phone did. Add the matching message ("must be a valid URL (e.g. https://example.com)") so the two are symmetric. Sweep the rest of the request-layer URL fields: the credential-vault url on CreateCredentialRequest was free-text the user types yet unvalidated. Add #[validate(url)] (any-scheme, like the RMM api_url field) so it rejects not-a-valid-url / example.com while still allowing rdp://, ssh://, etc. for non-web credentials. RMM api_url was already validated; tenant branding URLs and the feedback honeypot are intentionally left alone (documented). Add the PMS-351 acceptance cases as unit tests (company website rejects not-a-valid-url, example.com, ftp://example.com and accepts https://example.com; credential url rejects junk, accepts any real scheme) and an audit doc listing every URL field touched and every one left alone with its reason. #PMS-351
fix(validation): symmetric URL error message + close credential URL gap (PMS-351)
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 1m6s
Check / fmt + clippy + compile + unit/doc tests (pull_request) Successful in 2m12s
Integration / integration tests (pull_request) Successful in 5m46s
Create release / Create release from merged PR (pull_request) Has been skipped
8689abb4e8
The New Company website field was already validated server-side (PMS-297's validate_website, http(s)-only) but returned a bare invalid_url error code while the phone field carried a human message, so the website error did not surface inline the way phone did. Add the matching message ("must be a valid URL (e.g. https://example.com)") so the two are symmetric.

Sweep the rest of the request-layer URL fields: the credential-vault url on CreateCredentialRequest was free-text the user types yet unvalidated. Add #[validate(url)] (any-scheme, like the RMM api_url field) so it rejects not-a-valid-url / example.com while still allowing rdp://, ssh://, etc. for non-web credentials. RMM api_url was already validated; tenant branding URLs and the feedback honeypot are intentionally left alone (documented).

Add the PMS-351 acceptance cases as unit tests (company website rejects not-a-valid-url, example.com, ftp://example.com and accepts https://example.com; credential url rejects junk, accepts any real scheme) and an audit doc listing every URL field touched and every one left alone with its reason.

#PMS-351
nrupard deleted branch fix/pms-351-url-field-validation-sweep 2026-06-16 21:52:25 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-server!273
No description provided.