new: add optional HELP line support#130
new: add optional HELP line support#130ktoso merged 2 commits intoswift-server:mainfrom incertum:new/help-line
Conversation
|
Finalizes #127 |
Signed-off-by: Melissa Kilby <mkilby@apple.com>
| return true | ||
| } | ||
|
|
||
| fileprivate func isValidHelpText() -> Bool { |
There was a problem hiding this comment.
As a security person string sanitization always scares me as you usually get it wrong. Would you have better ideas here?
There was a problem hiding this comment.
I guess we could "....".allSatisfy { character in character.isLetter || character.isNumber || punctuation?? } but also allow punctuation etc, or lean into CharacterSet from Foundation...
There was a problem hiding this comment.
ACK, I'll check tmrw and possibly re-push the last commit and add that in.
There was a problem hiding this comment.
@ktoso besides adding all overloads, I refactored the HelpText sanitization a bit, however still without Foundation in order to limit some side-effects (such as increasing the binary size for adopters).
Would you be able to review these changes? Much appreciated ❤️
ktoso
left a comment
There was a problem hiding this comment.
looks good, minor nitpick
Notably, add consistent overloads to maintain ABI stability Plus adjust `ValidHelpText` approach for broader robustness Signed-off-by: Melissa Kilby <mkilby@apple.com> Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
Add optional HELP line support (includes help text validation and sanitization).
Follow for #126
CC @ktoso @FranzBusch thanks in advance for your review!