Skip to content
Merged

Dev #59

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Installing Python Poetry
run: pip install poetry

- name: Install and Build pwncat-cs Package
- name: Install and Build pyredactkit Package
run: |
poetry install
poetry build
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pyredactkit"
version = "0.3.4"
version = "0.3.5"
description = "Python cli tool to redact sensitive data"
authors = ["brootware <brootware@outlook.com>"]
license = "GPL-3.0-or-later"
Expand Down
4 changes: 2 additions & 2 deletions pyredactkit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__version__ = "0.1.0"

from pyredactkit import pyredactkit
from pyredactkit import runner

if __name__ == "__main__":
pyredactkit.main()
runner.main()
4 changes: 2 additions & 2 deletions pyredactkit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
)
sys.exit(1)

from pyredactkit import pyredactkit
from pyredactkit import runner

pyredactkit.main()
runner.main()
10 changes: 4 additions & 6 deletions pyredactkit/core_redactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,18 @@ def __init__(self) -> None:
"""
return None

def identify_data(self, line: str) -> list:
def identify_data(self, textchunk: str) -> list:
"""Function to identify specific option
Args:
line (str) : line to be supplied to identify pattern
textchunk (str) : textchunk to be supplied to identify pattern
Returns:
list (list): list of sensitive data found in lines
"""
sensitive_data = []
for id in id_object.regexes:
redact_pattern = id['pattern']
if re.search(redact_pattern, line):
pattern_string = re.search(redact_pattern, line)
pattern_string = pattern_string.group(0)
sensitive_data.append(pattern_string)
sensitive_data.append(re.findall(redact_pattern, textchunk))
sensitive_data = sum(sensitive_data, [])
return sensitive_data

def redact_all(self, line: str) -> tuple:
Expand Down
2 changes: 1 addition & 1 deletion pyredactkit/pyredactkit.py → pyredactkit/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def main():
redact_obj.process_text(args.text)


def api_return_core_identifier(text: str) -> list:
def api_identify_sensitive_data(text: str) -> list:
return redact_obj.identify_data(text)


Expand Down