fix(validation): symmetric URL error message + close credential URL gap (PMS-351) #273
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pms-351-url-field-validation-sweep"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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