ROX-33306: Add helper text and validation to File Path criterion#19257
Open
ROX-33306: Add helper text and validation to File Path criterion#19257
Conversation
The File Path criterion was changed from a dropdown to a text input by backend PRs 19057/19063, but lacked guidance for users on glob syntax support and had no client-side input validation. Add helper text explaining glob pattern support, a placeholder showing a realistic sensitive file path pattern, and lightweight client-side validation that checks for absolute paths and rejects directory traversal. Glob syntax validation is intentionally left to the backend (Go's doublestar library) to avoid client/server mismatch. Also extend TextDescriptor type with helperText and validate fields so other text criteria can reuse this pattern. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
|
Skipping CI for Draft Pull Request. |
Use segment-based directory traversal check to match backend behavior, avoiding false positives on filenames containing consecutive dots (e.g. file..bak). Simplify showError logic since the validator already handles empty strings. Add unit tests covering edge cases. Partially generated by AI. Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
Contributor
|
Images are ready for the commit at 9307234. To use with deploy scripts, first |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19257 +/- ##
==========================================
- Coverage 49.64% 49.63% -0.01%
==========================================
Files 2679 2679
Lines 202130 202130
==========================================
- Hits 100339 100326 -13
- Misses 94315 94326 +11
- Partials 7476 7478 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sachaudh
commented
Mar 3, 2026
|
|
||
| #policy-sections .pf-v5-c-form__helper-text { | ||
| white-space: normal; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
The helper text was not properly wrapping so added this to fix that
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Jira: ROX-33306
Adds inline helper text and client-side validation to the File Path policy criterion text input:
/home/**/.ssh/id_*)/) and rejects directory traversal (..)FormHelperTextChanges apply to both container and node-level File Path descriptors.
User-facing documentation
Testing and quality
Automated testing
How I validated my change
..Screenshots
file-path-helper-and-validation.mov