Skip to content

Add composable sanitizer pipeline and built-in sanitizers - #62

Merged
kettasoft merged 2 commits into
masterfrom
feat/sanitizer-pipeline
Sep 7, 2026
Merged

Add composable sanitizer pipeline and built-in sanitizers#62
kettasoft merged 2 commits into
masterfrom
feat/sanitizer-pipeline

Conversation

@kettasoft

Copy link
Copy Markdown
Owner

Summary

Overhaul the sanitization system with composable pipelines, built-in sanitizers, and runtime aliases.

Changes

  • Add 12 built-in sanitizers with short aliases
  • Support pipe syntax such as trim|lowercase
  • Apply global sanitizers before field-specific sanitizers
  • Support closures, callable arrays, invokable objects, and Sanitizable implementations
  • Add runtime alias registration through Sanitizer::extend()
  • Preserve zero values when using null_if_empty
  • Preserve access to the original raw Payload value
  • Add output escaping and sanitization security guidance
  • Add comprehensive unit and integration tests
  • Fix an infinite loop in the raw Payload value test

kettasoft and others added 2 commits September 7, 2026 06:54
…s, aliases & pipe-chaining (#50)

* refactor(sanitization): remove HandlerFactory and streamline sanitizer handling in ArrayHandler and Sanitizer

 No behaviour change; all existing tests pass

* feat: add default sanitizers for various data types including Boolean, Clamp, EscapeHtml, Float, Integer, Lowercase, NullIfEmpty, Slug, StripSpecialChars, StripTags, Trim, and Uppercase

* feat(sanitization): enhance sanitizer alias management and add new sanitizers

* refactor(tests): replace HandlerFactory with Sanitizer in SanitizeUnitTest

* test(sanitization): add comprehensive tests for various sanitizers including Trim, Lowercase, Uppercase, StripTags, EscapeHtml, Integer, Float, Boolean, Slug, NullIfEmpty, Clamp, and StripSpecialChars

* refactor(tests): remove TrimSanitizer class and update usage in SanitizeUnitTest

* feat(sanitization): enhance handle method to support global and field-specific sanitizers

* test(sanitization): add tests for global sanitizers and their application order

* docs(sanitization): update sanitization documentation with new structure, examples, and additional sanitizers
@kettasoft kettasoft added the enhancement New feature or request label Sep 7, 2026
@kettasoft kettasoft self-assigned this Sep 7, 2026
@kettasoft
kettasoft merged commit 57ed21f into master Sep 7, 2026
1 check passed
@kettasoft
kettasoft deleted the feat/sanitizer-pipeline branch September 7, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant