From 05ed3500814372c724d642fe83f43f21fead23fa Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Mon, 4 Dec 2023 13:51:44 +0100 Subject: [PATCH 1/7] Add badge for pypi versions --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c7a0d36e..9aa27deb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![REUSE status](https://api.reuse.software/badge/github.com/SAP/credential-digger)](https://api.reuse.software/info/github.com/SAP/credential-digger) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/SAP/credential-digger?logo=github) ![PyPI](https://img.shields.io/pypi/v/credentialdigger?logo=pypi) +![PyPI - Python Version](https://img.shields.io/pypi/pyversions/credentialdigger) + ![Logo](https://raw.githubusercontent.com/SAP/credential-digger/main/github_assets/Logo-CD-Mint_48.png) From 6d6ce17d30e1dc73e2d545761bcbfe62c41040e5 Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Mon, 4 Dec 2023 13:52:14 +0100 Subject: [PATCH 2/7] Deprecate setup.py and add pyproject.toml --- pyproject.toml | 40 ++++++++++++++++++++++++++++++++++++++++ setup.py | 34 ---------------------------------- 2 files changed, 40 insertions(+), 34 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..bf6d085d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,40 @@ +[build-system] +requires = ['setuptools >= 61.0'] +build-backend = 'setuptools.build_meta' + +[project] +name = 'credentialdigger' +dynamic = ['dependencies', 'version'] +authors = [ + {name = 'SAP SE'} +] +maintainers = [ + {name = 'Marco Rosa', email = 'marco.rosa@sap.com'}, + {name = 'Slim Trabelsi', email = 'slim.trabelsi@sap.com'} +] +description = 'Credential Digger' +readme = 'README.md' +license = {file = 'LICENSE'} +requires-python = '>= 3.8, < 3.12' +classifiers = [ + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Operating System :: OS Independent', + 'Topic :: Security', +] + +[project.scripts] +credentialdigger = 'credentialdigger.__main__:main' + +[tool.setuptools.dynamic] +dependencies = {file = ['requirements.txt']} +version = {file = ['__version__']} + +[project.urls] +Homepage = 'https://github.com/sap/credential-digger' +Documentation = 'https://github.com/SAP/credential-digger/wiki' +Repository = 'https://github.com/sap/credential-digger.git' +Issues = 'https://github.com/SAP/credential-digger/issues' diff --git a/setup.py b/setup.py deleted file mode 100644 index 540c8fc4..00000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -import setuptools - - -def readme(): - with open('README.md') as f: - return f.read() - - -def requirements(): - with open('requirements.txt') as f: - return f.read().splitlines() - - -setuptools.setup( - name='credentialdigger', - version='4.12.0', - author='SAP SE', - maintainer='Marco Rosa, Slim Trabelsi', - maintainer_email='marco.rosa@sap.com, slim.trabelsi@sap.com', - description='Credential Digger', - install_requires=requirements(), - long_description=readme(), - long_description_content_type='text/markdown', - url='https://github.com/SAP/credential-digger', - packages=setuptools.find_packages(), - include_package_data=True, - classifiers=[ - 'Programming Language :: Python :: 3', - 'Operating System :: OS Independent', - ], - python_requires='>3.7, <3.12', - entry_points={'console_scripts': ['credentialdigger=credentialdigger' - '.__main__:main']}, -) From 72f223af6aea6c447afd7add30518abf54281399 Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Mon, 4 Dec 2023 13:56:35 +0100 Subject: [PATCH 3/7] Adopt src layout --- {credentialdigger => src/credentialdigger}/__init__.py | 0 {credentialdigger => src/credentialdigger}/__main__.py | 0 {credentialdigger => src/credentialdigger}/cli/__init__.py | 0 {credentialdigger => src/credentialdigger}/cli/add_rules.py | 0 {credentialdigger => src/credentialdigger}/cli/cli.py | 0 {credentialdigger => src/credentialdigger}/cli/get_discoveries.py | 0 {credentialdigger => src/credentialdigger}/cli/hook.py | 0 {credentialdigger => src/credentialdigger}/cli/scan.py | 0 {credentialdigger => src/credentialdigger}/cli/scan_path.py | 0 {credentialdigger => src/credentialdigger}/cli/scan_pr.py | 0 {credentialdigger => src/credentialdigger}/cli/scan_snapshot.py | 0 {credentialdigger => src/credentialdigger}/cli/scan_user.py | 0 {credentialdigger => src/credentialdigger}/cli/scan_wiki.py | 0 {credentialdigger => src/credentialdigger}/client.py | 0 {credentialdigger => src/credentialdigger}/client_postgres.py | 0 {credentialdigger => src/credentialdigger}/client_sqlite.py | 0 {credentialdigger => src/credentialdigger}/models/__init__.py | 0 {credentialdigger => src/credentialdigger}/models/base_model.py | 0 .../credentialdigger}/models/model_manager.py | 0 .../credentialdigger}/models/password_model.py | 0 {credentialdigger => src/credentialdigger}/models/path_model.py | 0 {credentialdigger => src/credentialdigger}/scanners/__init__.py | 0 .../credentialdigger}/scanners/base_scanner.py | 0 .../credentialdigger}/scanners/file_scanner.py | 0 .../credentialdigger}/scanners/git_file_scanner.py | 0 .../credentialdigger}/scanners/git_pr_scanner.py | 0 .../credentialdigger}/scanners/git_scanner.py | 0 {credentialdigger => src/credentialdigger}/snippet_similarity.py | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename {credentialdigger => src/credentialdigger}/__init__.py (100%) rename {credentialdigger => src/credentialdigger}/__main__.py (100%) rename {credentialdigger => src/credentialdigger}/cli/__init__.py (100%) rename {credentialdigger => src/credentialdigger}/cli/add_rules.py (100%) rename {credentialdigger => src/credentialdigger}/cli/cli.py (100%) rename {credentialdigger => src/credentialdigger}/cli/get_discoveries.py (100%) rename {credentialdigger => src/credentialdigger}/cli/hook.py (100%) rename {credentialdigger => src/credentialdigger}/cli/scan.py (100%) rename {credentialdigger => src/credentialdigger}/cli/scan_path.py (100%) rename {credentialdigger => src/credentialdigger}/cli/scan_pr.py (100%) rename {credentialdigger => src/credentialdigger}/cli/scan_snapshot.py (100%) rename {credentialdigger => src/credentialdigger}/cli/scan_user.py (100%) rename {credentialdigger => src/credentialdigger}/cli/scan_wiki.py (100%) rename {credentialdigger => src/credentialdigger}/client.py (100%) rename {credentialdigger => src/credentialdigger}/client_postgres.py (100%) rename {credentialdigger => src/credentialdigger}/client_sqlite.py (100%) rename {credentialdigger => src/credentialdigger}/models/__init__.py (100%) rename {credentialdigger => src/credentialdigger}/models/base_model.py (100%) rename {credentialdigger => src/credentialdigger}/models/model_manager.py (100%) rename {credentialdigger => src/credentialdigger}/models/password_model.py (100%) rename {credentialdigger => src/credentialdigger}/models/path_model.py (100%) rename {credentialdigger => src/credentialdigger}/scanners/__init__.py (100%) rename {credentialdigger => src/credentialdigger}/scanners/base_scanner.py (100%) rename {credentialdigger => src/credentialdigger}/scanners/file_scanner.py (100%) rename {credentialdigger => src/credentialdigger}/scanners/git_file_scanner.py (100%) rename {credentialdigger => src/credentialdigger}/scanners/git_pr_scanner.py (100%) rename {credentialdigger => src/credentialdigger}/scanners/git_scanner.py (100%) rename {credentialdigger => src/credentialdigger}/snippet_similarity.py (100%) diff --git a/credentialdigger/__init__.py b/src/credentialdigger/__init__.py similarity index 100% rename from credentialdigger/__init__.py rename to src/credentialdigger/__init__.py diff --git a/credentialdigger/__main__.py b/src/credentialdigger/__main__.py similarity index 100% rename from credentialdigger/__main__.py rename to src/credentialdigger/__main__.py diff --git a/credentialdigger/cli/__init__.py b/src/credentialdigger/cli/__init__.py similarity index 100% rename from credentialdigger/cli/__init__.py rename to src/credentialdigger/cli/__init__.py diff --git a/credentialdigger/cli/add_rules.py b/src/credentialdigger/cli/add_rules.py similarity index 100% rename from credentialdigger/cli/add_rules.py rename to src/credentialdigger/cli/add_rules.py diff --git a/credentialdigger/cli/cli.py b/src/credentialdigger/cli/cli.py similarity index 100% rename from credentialdigger/cli/cli.py rename to src/credentialdigger/cli/cli.py diff --git a/credentialdigger/cli/get_discoveries.py b/src/credentialdigger/cli/get_discoveries.py similarity index 100% rename from credentialdigger/cli/get_discoveries.py rename to src/credentialdigger/cli/get_discoveries.py diff --git a/credentialdigger/cli/hook.py b/src/credentialdigger/cli/hook.py similarity index 100% rename from credentialdigger/cli/hook.py rename to src/credentialdigger/cli/hook.py diff --git a/credentialdigger/cli/scan.py b/src/credentialdigger/cli/scan.py similarity index 100% rename from credentialdigger/cli/scan.py rename to src/credentialdigger/cli/scan.py diff --git a/credentialdigger/cli/scan_path.py b/src/credentialdigger/cli/scan_path.py similarity index 100% rename from credentialdigger/cli/scan_path.py rename to src/credentialdigger/cli/scan_path.py diff --git a/credentialdigger/cli/scan_pr.py b/src/credentialdigger/cli/scan_pr.py similarity index 100% rename from credentialdigger/cli/scan_pr.py rename to src/credentialdigger/cli/scan_pr.py diff --git a/credentialdigger/cli/scan_snapshot.py b/src/credentialdigger/cli/scan_snapshot.py similarity index 100% rename from credentialdigger/cli/scan_snapshot.py rename to src/credentialdigger/cli/scan_snapshot.py diff --git a/credentialdigger/cli/scan_user.py b/src/credentialdigger/cli/scan_user.py similarity index 100% rename from credentialdigger/cli/scan_user.py rename to src/credentialdigger/cli/scan_user.py diff --git a/credentialdigger/cli/scan_wiki.py b/src/credentialdigger/cli/scan_wiki.py similarity index 100% rename from credentialdigger/cli/scan_wiki.py rename to src/credentialdigger/cli/scan_wiki.py diff --git a/credentialdigger/client.py b/src/credentialdigger/client.py similarity index 100% rename from credentialdigger/client.py rename to src/credentialdigger/client.py diff --git a/credentialdigger/client_postgres.py b/src/credentialdigger/client_postgres.py similarity index 100% rename from credentialdigger/client_postgres.py rename to src/credentialdigger/client_postgres.py diff --git a/credentialdigger/client_sqlite.py b/src/credentialdigger/client_sqlite.py similarity index 100% rename from credentialdigger/client_sqlite.py rename to src/credentialdigger/client_sqlite.py diff --git a/credentialdigger/models/__init__.py b/src/credentialdigger/models/__init__.py similarity index 100% rename from credentialdigger/models/__init__.py rename to src/credentialdigger/models/__init__.py diff --git a/credentialdigger/models/base_model.py b/src/credentialdigger/models/base_model.py similarity index 100% rename from credentialdigger/models/base_model.py rename to src/credentialdigger/models/base_model.py diff --git a/credentialdigger/models/model_manager.py b/src/credentialdigger/models/model_manager.py similarity index 100% rename from credentialdigger/models/model_manager.py rename to src/credentialdigger/models/model_manager.py diff --git a/credentialdigger/models/password_model.py b/src/credentialdigger/models/password_model.py similarity index 100% rename from credentialdigger/models/password_model.py rename to src/credentialdigger/models/password_model.py diff --git a/credentialdigger/models/path_model.py b/src/credentialdigger/models/path_model.py similarity index 100% rename from credentialdigger/models/path_model.py rename to src/credentialdigger/models/path_model.py diff --git a/credentialdigger/scanners/__init__.py b/src/credentialdigger/scanners/__init__.py similarity index 100% rename from credentialdigger/scanners/__init__.py rename to src/credentialdigger/scanners/__init__.py diff --git a/credentialdigger/scanners/base_scanner.py b/src/credentialdigger/scanners/base_scanner.py similarity index 100% rename from credentialdigger/scanners/base_scanner.py rename to src/credentialdigger/scanners/base_scanner.py diff --git a/credentialdigger/scanners/file_scanner.py b/src/credentialdigger/scanners/file_scanner.py similarity index 100% rename from credentialdigger/scanners/file_scanner.py rename to src/credentialdigger/scanners/file_scanner.py diff --git a/credentialdigger/scanners/git_file_scanner.py b/src/credentialdigger/scanners/git_file_scanner.py similarity index 100% rename from credentialdigger/scanners/git_file_scanner.py rename to src/credentialdigger/scanners/git_file_scanner.py diff --git a/credentialdigger/scanners/git_pr_scanner.py b/src/credentialdigger/scanners/git_pr_scanner.py similarity index 100% rename from credentialdigger/scanners/git_pr_scanner.py rename to src/credentialdigger/scanners/git_pr_scanner.py diff --git a/credentialdigger/scanners/git_scanner.py b/src/credentialdigger/scanners/git_scanner.py similarity index 100% rename from credentialdigger/scanners/git_scanner.py rename to src/credentialdigger/scanners/git_scanner.py diff --git a/credentialdigger/snippet_similarity.py b/src/credentialdigger/snippet_similarity.py similarity index 100% rename from credentialdigger/snippet_similarity.py rename to src/credentialdigger/snippet_similarity.py From 5865bbe7b6df47cc283cee5fb4e26a8ef114d39e Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Mon, 4 Dec 2023 13:57:34 +0100 Subject: [PATCH 4/7] Remove old deprecated package data --- MANIFEST.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 3f2b4e22..f9bd1455 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1 @@ include requirements.txt -include credentialdigger/models_data/*.bin -include credentialdigger/generator/pattern_data/*.txt -include credentialdigger/generator/pattern_data/*.json From 8d4ff42a9aeccce8ebff69f370d2262a86d80026 Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Mon, 4 Dec 2023 13:57:53 +0100 Subject: [PATCH 5/7] Add __version__ for package version tracking --- __version__ | 1 + 1 file changed, 1 insertion(+) create mode 100644 __version__ diff --git a/__version__ b/__version__ new file mode 100644 index 00000000..813b83b6 --- /dev/null +++ b/__version__ @@ -0,0 +1 @@ +4.13.0 From 9c5f1b64354d52ddbb52720ed24a2db958029bef Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Fri, 15 Dec 2023 12:05:57 +0100 Subject: [PATCH 6/7] Change version filename --- pyproject.toml | 2 +- __version__ => version.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename __version__ => version.py (100%) diff --git a/pyproject.toml b/pyproject.toml index bf6d085d..b8958ece 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ credentialdigger = 'credentialdigger.__main__:main' [tool.setuptools.dynamic] dependencies = {file = ['requirements.txt']} -version = {file = ['__version__']} +version = {file = ['version.py']} [project.urls] Homepage = 'https://github.com/sap/credential-digger' diff --git a/__version__ b/version.py similarity index 100% rename from __version__ rename to version.py From 26895974f9e1ebe20b44295733cc6990b425625b Mon Sep 17 00:00:00 2001 From: Marco Rosa Date: Fri, 15 Dec 2023 13:58:48 +0100 Subject: [PATCH 7/7] Ignore pep8 violations in file version.py --- .pep8speaks.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pep8speaks.yml b/.pep8speaks.yml index 7829f2fa..da51ef84 100644 --- a/.pep8speaks.yml +++ b/.pep8speaks.yml @@ -10,6 +10,8 @@ flake8: # Same as scanner.linter value - W292 # no newline at the end of file (introduces W391) - W503 # line break before binary operator - W504 # line break after binary operator + exclude: # Exclude some files + - version.py no_blank_comment: True # If True, no comment is made on PR without any errors. descending_issues_order: False # If True, PEP 8 issues in message will be displayed in descending order of line numbers in the file