Merged
Conversation
…mpilation should be at the module level. #28
Remove unused logger of UniversalJSONEncoder
bpietropaoli
approved these changes
Jul 15, 2025
bpietropaoli
left a comment
There was a problem hiding this comment.
I haven't looked at the .github modifications since it's your repo and you manage it however you want.
As for the issues mentioned, there are solved. Good work. :)
Comment on lines
+187
to
+197
| ## ⚠️ Security Considerations | ||
|
|
||
| **Warning**: Instantiating classes using `__class__` and `__module__` attributes poses a security threat when deserializing untrusted JSON data. Malicious JSON could potentially instantiate arbitrary classes and execute code. | ||
|
|
||
| Only use Kajson to deserialize JSON from trusted sources. For untrusted data, consider: | ||
| - Validating JSON structure before deserialization | ||
| - Using a whitelist of allowed classes | ||
| - Sanitizing input data | ||
|
|
||
| For more discussion on this topic, see [this discussion thread](https://github.com/Pipelex/kajson/discussions/44). | ||
|
|
There was a problem hiding this comment.
A necessary addition for sure, informing potentially careless users is always a good idea. :)
There was a problem hiding this comment.
Good, cleaning unused code is just good practice for maintainability.
Comment on lines
+216
to
+220
| # Expressions used to find module names (compiled once at import time): | ||
| __class_expression = re.compile(r"^<class '([a-zA-Z0-9._]*)'>") | ||
| __type_expression = re.compile(r"^<type '([a-zA-Z0-9._]*)'>") | ||
|
|
||
|
|
There was a problem hiding this comment.
Definitely in its right place now. ;)
There was a problem hiding this comment.
I would have added docstrings in the code itself so tools like Intellisense in VSCode can give you the doc on the fly too but at least it's documented. :)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
🚀 New Features
📝 Changes
🔒 Security