Skip to content
Draft
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
14 changes: 7 additions & 7 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
path: data
key: cred-data-${{ hashFiles('checksums.md5') }}

- name: Set up Python 3.10
- name: Set up Python 3.11
if: steps.cache-data.outputs.cache-hit != 'true'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - 2026.01.22
with:
python-version: "3.10"
python-version: "3.11"

- name: Update PIP
run: python -m pip install --upgrade pip
Expand Down Expand Up @@ -112,10 +112,10 @@ jobs:
if: steps.cache-data.outputs.cache-hit == 'true'
run: ls -al . && ls -al data

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - 2026.01.22
with:
python-version: "3.10"
python-version: "3.11"

- name: Update PIP
run: python -m pip install --upgrade pip
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]

steps:

Expand Down Expand Up @@ -407,10 +407,10 @@ jobs:
mv data ${{ github.workspace }}/CredData/
mv meta ${{ github.workspace }}/CredData/

- name: Set up Python 3.10
- name: Set up Python 3.11
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - 2026.01.22
with:
python-version: "3.10"
python-version: "3.11"

- name: Update PIP
run: python -m pip install --upgrade pip
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ jobs:

# # # pylint

- name: Analysing the code with pylint and minimum Python version 3.10
if: ${{ always() && steps.setup_credsweeper.conclusion == 'success' }}
run: pylint --py-version=3.10 --verbose credsweeper

- name: Analysing the code with pylint and minimum Python version 3.11
if: ${{ always() && steps.setup_credsweeper.conclusion == 'success' }}
run: pylint --py-version=3.11 --verbose credsweeper
Expand All @@ -122,11 +118,6 @@ jobs:

# # # mypy

- name: Analysing the code with mypy and minimum Python version 3.10
if: ${{ always() && steps.setup_credsweeper.conclusion == 'success' }}
run: |
mypy --config-file .mypy.ini --python-version=3.10 credsweeper

- name: Analysing the code with mypy and minimum Python version 3.11
if: ${{ always() && steps.setup_credsweeper.conclusion == 'success' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - 2026.01.22
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - 2026.01.22
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]

steps:

Expand Down Expand Up @@ -80,16 +80,7 @@ jobs:
run: |
pip install pytest pytest-random-order deepdiff hypothesis

- name: UnitTest with pytest for Python & ubuntu-latest
if: ${{ matrix.os == 'ubuntu-latest' && ( matrix.python-version == '3.11' || matrix.python-version == '3.12' || matrix.python-version == '3.13' || matrix.python-version == '3.14' ) }}
run: |
# skip app test with stderr checking - [W:onnxruntime:Default, device_discovery.cc:131 GetPciBusId]
pytest --verbose --random-order --random-order-bucket=global \
-k 'not (test_log_p or test_log_n or test_rules_ml_p or test_rules_ml_n or test_it_works_n or test_no_filters_p or test_external_ml_p or test_external_ml_n or test_import_config_p or test_import_config_n)' \
tests

- name: UnitTest with pytest
if: ${{ matrix.os != 'ubuntu-latest' || matrix.python-version == '3.10' }}
run: |
# put the command into one line to use in various OS to avoid processing differences in new line char sequence
pytest --verbose --random-order --random-order-bucket=global tests
Expand All @@ -102,7 +93,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]

steps:

Expand Down Expand Up @@ -201,7 +192,7 @@ jobs:
path: coverage_html

- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version == '3.10' }}
if: ${{ matrix.python-version == '3.11' }}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 - 2025.12.09
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: "ubuntu-lts-latest"
tools:
python: "3.10"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Full documentation can be found here: <https://credsweeper.readthedocs.io/>

### Main Requirements

- Python 3.10, 3.11, 3.12, 3.13, 3.14
- Python 3.11, 3.12, 3.13, 3.14

### Installation

Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ branding:
color: "gray-dark"
inputs:
python_version:
description: "Python Version. 3.10 - default"
default: "3.10"
description: "Python Version. 3.11 - default"
default: "3.11"
required: false
path:
description: "Path to scan"
Expand Down
2 changes: 1 addition & 1 deletion credsweeper/deep_scanner/mxfile_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def data_scan(
tree = etree.fromstring(data_provider.text)
for element in tree.iter():
if "mxCell" == getattr(element, "tag"):
line_number = element.sourceline
line_number = -1 if element.sourceline is None else int(element.sourceline)
attr = getattr(element, "attrib")
if attr is None or not (value := attr.get("value")):
continue
Expand Down
26 changes: 2 additions & 24 deletions credsweeper/deep_scanner/sqlite3_scanner.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import logging
import os.path
import sqlite3
import sys
import tempfile
from abc import ABC
from typing import List, Optional, Tuple, Any, Generator, Union

Expand Down Expand Up @@ -41,28 +38,9 @@ def __walk(sqlite3db) -> Generator[Tuple[str, Any], None, None]:
@staticmethod
def walk_sqlite(data: bytes) -> Generator[Tuple[str, Any], None, None]:
"""Yields data from sqlite3 database"""
if 10 < sys.version_info.minor:
# Added in version 3.11
with sqlite3.connect(":memory:") as sqlite3db:
sqlite3db.deserialize(data) # type: ignore
yield from Sqlite3Scanner.__walk(sqlite3db)
elif "nt" != os.name:
# a tmpfile has to be used. TODO: remove when 3.10 will deprecate
with tempfile.NamedTemporaryFile(suffix=".sqlite") as t:
t.write(data)
t.flush()
with sqlite3.connect(t.name) as sqlite3db:
yield from Sqlite3Scanner.__walk(sqlite3db)
elif "nt" == os.name:
# windows trick. TODO: remove when 3.10 will deprecate
with tempfile.NamedTemporaryFile(delete=False, suffix=".sqlite") as t:
t.write(data)
t.flush()
sqlite3db = sqlite3.connect(t.name)
with sqlite3.connect(":memory:") as sqlite3db:
sqlite3db.deserialize(data) # type: ignore
yield from Sqlite3Scanner.__walk(sqlite3db)
sqlite3db.close()
if os.path.exists(t.name):
os.remove(t.name)

def data_scan(
self, #
Expand Down
9 changes: 6 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
myst_parser[linkify]==4.0.1
sphinx==8.1.3
sphinx_rtd_theme==3.0.2
# Python 3.11.15
# pip 26.0.1

myst_parser[linkify]==5.0.0
sphinx==9.0.4
sphinx_rtd_theme==3.1.0
8 changes: 4 additions & 4 deletions docs/source/credsweeper.common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ credsweeper.common.constants module

.. automodule:: credsweeper.common.constants
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.common.keyword\_checklist module
--------------------------------------------

.. automodule:: credsweeper.common.keyword_checklist
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.common.keyword\_pattern module
------------------------------------------

.. automodule:: credsweeper.common.keyword_pattern
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

Module contents
---------------

.. automodule:: credsweeper.common
:members:
:undoc-members:
:show-inheritance:
:undoc-members:
4 changes: 2 additions & 2 deletions docs/source/credsweeper.config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ credsweeper.config.config module

.. automodule:: credsweeper.config.config
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

Module contents
---------------

.. automodule:: credsweeper.config
:members:
:undoc-members:
:show-inheritance:
:undoc-members:
14 changes: 7 additions & 7 deletions docs/source/credsweeper.credentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,53 @@ credsweeper.credentials.augment\_candidates module

.. automodule:: credsweeper.credentials.augment_candidates
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.credentials.candidate module
----------------------------------------

.. automodule:: credsweeper.credentials.candidate
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.credentials.candidate\_group\_generator module
----------------------------------------------------------

.. automodule:: credsweeper.credentials.candidate_group_generator
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.credentials.candidate\_key module
---------------------------------------------

.. automodule:: credsweeper.credentials.candidate_key
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.credentials.credential\_manager module
--------------------------------------------------

.. automodule:: credsweeper.credentials.credential_manager
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

credsweeper.credentials.line\_data module
-----------------------------------------

.. automodule:: credsweeper.credentials.line_data
:members:
:undoc-members:
:show-inheritance:
:undoc-members:

Module contents
---------------

.. automodule:: credsweeper.credentials
:members:
:undoc-members:
:show-inheritance:
:undoc-members:
Loading
Loading