-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #720 from SUNET/lundberg_remove_request_sanitation
Remove request sanitation for every request
- Loading branch information
Showing
7 changed files
with
135 additions
and
325 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from collections.abc import Mapping | ||
from typing import Any, AnyStr | ||
|
||
from marshmallow.fields import String | ||
|
||
from eduid.webapp.common.api.sanitation import Sanitizer | ||
|
||
__author__ = "lundberg" | ||
|
||
|
||
class SanitizedString(String): | ||
sanitizer = Sanitizer() | ||
|
||
def _deserialize(self, value: AnyStr, attr: str | None, data: Mapping[str, Any] | None, **kwargs: Any) -> str: | ||
_value = self.sanitizer.sanitize_input(untrusted_text=value) | ||
return super()._deserialize(_value, attr, data, **kwargs) |
Oops, something went wrong.