-
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix log sanitisation and switch to script.module.bossanova808 logging #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
07fe2ec
Prep for Kodi Piers
bossanova808 b0443c0
Update addon-checker.yml
bossanova808 eb1a63e
Update docstrings per Code Rabbit review
bossanova808 783389f
Merge pull request #3 from bossanova808/update-addon-checker
bossanova808 d310d49
Update addon-checker.yml
bossanova808 6ca8b3a
Updates per CR review
bossanova808 ae16c43
Further updates suggested by CR review
bossanova808 103b515
More CR changes
bossanova808 bcfbeab
Prep for Kodi Piers
bossanova808 9bdf478
Update docstrings per Code Rabbit review
bossanova808 d2c6e50
Updates per CR review
bossanova808 14b636f
Further updates suggested by CR review
bossanova808 ba434fc
More CR changes
bossanova808 7185d8a
And more CR
bossanova808 b45a77c
Merge branch 'prep-for-piers' of https://github.com/bossanova808/scri…
bossanova808 9ec822d
CR changes, add donfigurable crash log days
bossanova808 db3c792
Fix new settings
bossanova808 ee7ce34
CR
bossanova808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,23 @@ | ||
| import re | ||
|
|
||
|
|
||
| def clean_log(content): | ||
| def clean_log(content: str) -> str: | ||
| """ | ||
| Remove username/password details from log file content | ||
|
|
||
| @param content: | ||
| @return: | ||
| """ | ||
| replaces = (('//.+?:.+?@', '//USER:PASSWORD@'), ('<user>.+?</user>', '<user>USER</user>'), ('<pass>.+?</pass>', '<pass>PASSWORD</pass>'),) | ||
| replaces = ( | ||
| # Replace only the credentials part between '//' and '@' | ||
| (r'(?<=//)([^/@:\s]+):([^/@\s]+)@', r'USER:PASSWORD@'), | ||
| # Also scrub username only (no password) | ||
| (r'(?<=//)([^/@:\s]+)@', r'USER@'), | ||
| # Replace XML username/password; keep it local to the tag | ||
| (r'(?is)<user>[^<]*</user>', r'<user>USER</user>'), | ||
| (r'(?is)<pass>[^<]*</pass>', r'<pass>PASSWORD</pass>'), | ||
| ) | ||
|
|
||
| for pattern, repl in replaces: | ||
| sanitised = re.sub(pattern, repl, content) | ||
| return sanitised | ||
| content = re.sub(pattern, repl, content) | ||
| return content |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.