certmonitor 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. certmonitor-0.1.0/.github/workflows/ci.yml +106 -0
  2. certmonitor-0.1.0/.gitignore +276 -0
  3. certmonitor-0.1.0/.markdownlint.yml +41 -0
  4. certmonitor-0.1.0/.yamllint.yaml +12 -0
  5. certmonitor-0.1.0/LICENSE +21 -0
  6. certmonitor-0.1.0/Makefile +37 -0
  7. certmonitor-0.1.0/PKG-INFO +265 -0
  8. certmonitor-0.1.0/README.md +255 -0
  9. certmonitor-0.1.0/certmonitor/__init__.py +3 -0
  10. certmonitor-0.1.0/certmonitor/cipher_algorithms.py +135 -0
  11. certmonitor-0.1.0/certmonitor/config.py +14 -0
  12. certmonitor-0.1.0/certmonitor/core.py +438 -0
  13. certmonitor-0.1.0/certmonitor/error_handlers.py +28 -0
  14. certmonitor-0.1.0/certmonitor/protocol_handlers/base.py +24 -0
  15. certmonitor-0.1.0/certmonitor/protocol_handlers/ssh_handler.py +51 -0
  16. certmonitor-0.1.0/certmonitor/protocol_handlers/ssl_handler.py +135 -0
  17. certmonitor-0.1.0/certmonitor/rust_certinfo/Cargo.lock +562 -0
  18. certmonitor-0.1.0/certmonitor/rust_certinfo/Cargo.toml +13 -0
  19. certmonitor-0.1.0/certmonitor/rust_certinfo/src/lib.rs +84 -0
  20. certmonitor-0.1.0/certmonitor/utils/__init__.py +0 -0
  21. certmonitor-0.1.0/certmonitor/utils/utils.py +0 -0
  22. certmonitor-0.1.0/certmonitor/validators/__init__.py +56 -0
  23. certmonitor-0.1.0/certmonitor/validators/base.py +49 -0
  24. certmonitor-0.1.0/certmonitor/validators/expiration.py +85 -0
  25. certmonitor-0.1.0/certmonitor/validators/hostname.py +143 -0
  26. certmonitor-0.1.0/certmonitor/validators/key_info.py +97 -0
  27. certmonitor-0.1.0/certmonitor/validators/root_certificate_validator.py +97 -0
  28. certmonitor-0.1.0/certmonitor/validators/subject_alt_names.py +227 -0
  29. certmonitor-0.1.0/certmonitor/validators/tls_version.py +65 -0
  30. certmonitor-0.1.0/certmonitor/validators/weak_cipher.py +63 -0
  31. certmonitor-0.1.0/docs/development.md +69 -0
  32. certmonitor-0.1.0/docs/images/logo.svg +17 -0
  33. certmonitor-0.1.0/docs/index.md +165 -0
  34. certmonitor-0.1.0/docs/reference/certmonitor.md +17 -0
  35. certmonitor-0.1.0/docs/reference/cipher_algorithms.md +3 -0
  36. certmonitor-0.1.0/docs/reference/error_handlers.md +3 -0
  37. certmonitor-0.1.0/docs/reference/protocol_handlers.md +5 -0
  38. certmonitor-0.1.0/docs/reference/utils.md +3 -0
  39. certmonitor-0.1.0/docs/reference/validators.md +3 -0
  40. certmonitor-0.1.0/docs/requirements.txt +7 -0
  41. certmonitor-0.1.0/docs/usage/basic.md +139 -0
  42. certmonitor-0.1.0/docs/usage/cipher.md +37 -0
  43. certmonitor-0.1.0/docs/usage/context_manager.md +51 -0
  44. certmonitor-0.1.0/docs/usage/custom_validators.md +86 -0
  45. certmonitor-0.1.0/docs/usage/env.md +7 -0
  46. certmonitor-0.1.0/docs/usage/error_handling.md +20 -0
  47. certmonitor-0.1.0/docs/usage/faq.md +51 -0
  48. certmonitor-0.1.0/docs/usage/full_workflow.md +113 -0
  49. certmonitor-0.1.0/docs/usage/index.md +33 -0
  50. certmonitor-0.1.0/docs/usage/installation.md +46 -0
  51. certmonitor-0.1.0/docs/usage/ip.md +49 -0
  52. certmonitor-0.1.0/docs/usage/performance.md +88 -0
  53. certmonitor-0.1.0/docs/usage/protocol.md +70 -0
  54. certmonitor-0.1.0/docs/usage/raw_cert.md +67 -0
  55. certmonitor-0.1.0/docs/usage/troubleshooting.md +6 -0
  56. certmonitor-0.1.0/docs/usage/validator_args.md +55 -0
  57. certmonitor-0.1.0/docs/usage/validators.md +73 -0
  58. certmonitor-0.1.0/docs/validators/expiration.md +3 -0
  59. certmonitor-0.1.0/docs/validators/hostname.md +3 -0
  60. certmonitor-0.1.0/docs/validators/index.md +19 -0
  61. certmonitor-0.1.0/docs/validators/key_info.md +3 -0
  62. certmonitor-0.1.0/docs/validators/root_certificate.md +3 -0
  63. certmonitor-0.1.0/docs/validators/subject_alt_names.md +3 -0
  64. certmonitor-0.1.0/docs/validators/tls_version.md +3 -0
  65. certmonitor-0.1.0/docs/validators/weak_cipher.md +3 -0
  66. certmonitor-0.1.0/main.py +91 -0
  67. certmonitor-0.1.0/mkdocs.yml +98 -0
  68. certmonitor-0.1.0/output.json +78 -0
  69. certmonitor-0.1.0/poetry.lock +389 -0
  70. certmonitor-0.1.0/pyproject.toml +38 -0
  71. certmonitor-0.1.0/pytest.ini +3 -0
  72. certmonitor-0.1.0/readthedocs.yaml +19 -0
  73. certmonitor-0.1.0/test2.py +32 -0
  74. certmonitor-0.1.0/tests/__init__.py +1 -0
  75. certmonitor-0.1.0/tests/conftest.py +67 -0
  76. certmonitor-0.1.0/tests/test_config.py +1 -0
  77. certmonitor-0.1.0/tests/test_core.py +99 -0
  78. certmonitor-0.1.0/tests/test_validators/__init__.py +1 -0
  79. certmonitor-0.1.0/tests/test_validators/test_expiration.py +27 -0
  80. certmonitor-0.1.0/tests/test_validators/test_hostname.py +15 -0
  81. certmonitor-0.1.0/tests/test_validators/test_subject_alt_names.py +23 -0
  82. certmonitor-0.1.0/uv.lock +1508 -0
@@ -0,0 +1,106 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+ release:
9
+ types: [published]
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ - name: Set up uv
24
+ uses: astral-sh/setup-uv@v1
25
+ with:
26
+ version: "0.6.17"
27
+ - name: Install dependencies
28
+ run: |
29
+ uv sync --group dev
30
+ - name: Check formatting
31
+ run: |
32
+ uv run ruff format --check .
33
+ - name: Lint
34
+ run: |
35
+ uv run ruff check .
36
+ - name: Build Rust extension
37
+ run: |
38
+ make maturin-build
39
+ - name: Install Rust extension
40
+ run: |
41
+ make maturin-develop
42
+ - name: Run tests
43
+ run: |
44
+ uv run pytest --maxfail=2 --disable-warnings
45
+
46
+ docs:
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - name: Set up Python 3.11
51
+ uses: actions/setup-python@v5
52
+ with:
53
+ python-version: "3.11"
54
+ - name: Set up uv
55
+ uses: astral-sh/setup-uv@v1
56
+ with:
57
+ version: "0.6.17"
58
+ - name: Create venv
59
+ run: |
60
+ uv venv .venv
61
+ - name: Set up venv PATH
62
+ run: |
63
+ echo ".venv/bin" >> $GITHUB_PATH
64
+ - name: Install dependencies
65
+ run: |
66
+ uv sync --group docs
67
+ - name: Build docs
68
+ run: |
69
+ uv run mkdocs build --strict
70
+
71
+ publish:
72
+ if: github.event_name == 'release' && github.event.action == 'published'
73
+ needs: [test, docs]
74
+ runs-on: ubuntu-latest
75
+ steps:
76
+ - uses: actions/checkout@v4
77
+ - name: Set up Python 3.11
78
+ uses: actions/setup-python@v5
79
+ with:
80
+ python-version: "3.11"
81
+ - name: Set up uv
82
+ uses: astral-sh/setup-uv@v1
83
+ with:
84
+ version: "0.6.17"
85
+ - name: Create venv
86
+ run: |
87
+ uv venv .venv
88
+ - name: Add venv to PATH
89
+ run: |
90
+ echo ".venv/bin" >> $GITHUB_PATH
91
+ - name: Install build dependencies
92
+ run: |
93
+ uv sync --group dev
94
+ - name: Build Rust extension
95
+ run: |
96
+ make maturin-build
97
+ - name: Build Python package
98
+ run: |
99
+ uv build
100
+ - name: Publish to PyPI
101
+ env:
102
+ UV_PUBLISH_NO_TRUSTED: "1"
103
+ TWINE_USERNAME: __token__
104
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
105
+ run: |
106
+ uv publish
@@ -0,0 +1,276 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,windows,macos,linux
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode,windows,macos,linux
3
+
4
+ ### Linux ###
5
+ *~
6
+
7
+ # temporary files which can be created if a process still has a handle open of a deleted file
8
+ .fuse_hidden*
9
+
10
+ # KDE directory preferences
11
+ .directory
12
+
13
+ # Linux trash folder which might appear on any partition or disk
14
+ .Trash-*
15
+
16
+ # .nfs files are created when an open file is removed but is still being accessed
17
+ .nfs*
18
+
19
+ ### macOS ###
20
+ # General
21
+ .DS_Store
22
+ .AppleDouble
23
+ .LSOverride
24
+
25
+ # Icon must end with two \r
26
+ Icon
27
+
28
+
29
+ # Thumbnails
30
+ ._*
31
+
32
+ # Files that might appear in the root of a volume
33
+ .DocumentRevisions-V100
34
+ .fseventsd
35
+ .Spotlight-V100
36
+ .TemporaryItems
37
+ .Trashes
38
+ .VolumeIcon.icns
39
+ .com.apple.timemachine.donotpresent
40
+
41
+ # Directories potentially created on remote AFP share
42
+ .AppleDB
43
+ .AppleDesktop
44
+ Network Trash Folder
45
+ Temporary Items
46
+ .apdisk
47
+
48
+ ### macOS Patch ###
49
+ # iCloud generated files
50
+ *.icloud
51
+
52
+ ### Python ###
53
+ # Byte-compiled / optimized / DLL files
54
+ __pycache__/
55
+ *.py[cod]
56
+ *$py.class
57
+
58
+ # C extensions
59
+ *.so
60
+
61
+ # Distribution / packaging
62
+ .Python
63
+ build/
64
+ develop-eggs/
65
+ dist/
66
+ downloads/
67
+ eggs/
68
+ .eggs/
69
+ lib/
70
+ lib64/
71
+ parts/
72
+ sdist/
73
+ var/
74
+ wheels/
75
+ share/python-wheels/
76
+ *.egg-info/
77
+ .installed.cfg
78
+ *.egg
79
+ MANIFEST
80
+
81
+ # PyInstaller
82
+ # Usually these files are written by a python script from a template
83
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
84
+ *.manifest
85
+ *.spec
86
+
87
+ # Installer logs
88
+ pip-log.txt
89
+ pip-delete-this-directory.txt
90
+
91
+ # Unit test / coverage reports
92
+ htmlcov/
93
+ .tox/
94
+ .nox/
95
+ .coverage
96
+ .coverage.*
97
+ .cache
98
+ nosetests.xml
99
+ coverage.xml
100
+ *.cover
101
+ *.py,cover
102
+ .hypothesis/
103
+ .pytest_cache/
104
+ cover/
105
+
106
+ # Translations
107
+ *.mo
108
+ *.pot
109
+
110
+ # Django stuff:
111
+ *.log
112
+ local_settings.py
113
+ db.sqlite3
114
+ db.sqlite3-journal
115
+
116
+ # Flask stuff:
117
+ instance/
118
+ .webassets-cache
119
+
120
+ # Scrapy stuff:
121
+ .scrapy
122
+
123
+ # Sphinx documentation
124
+ docs/_build/
125
+
126
+ # PyBuilder
127
+ .pybuilder/
128
+ target/
129
+
130
+ # Jupyter Notebook
131
+ .ipynb_checkpoints
132
+
133
+ # IPython
134
+ profile_default/
135
+ ipython_config.py
136
+
137
+ # pyenv
138
+ # For a library or package, you might want to ignore these files since the code is
139
+ # intended to run in multiple environments; otherwise, check them in:
140
+ # .python-version
141
+
142
+ # pipenv
143
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
144
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
145
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
146
+ # install all needed dependencies.
147
+ #Pipfile.lock
148
+
149
+ # poetry
150
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
151
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
152
+ # commonly ignored for libraries.
153
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
154
+ #poetry.lock
155
+
156
+ # pdm
157
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
158
+ #pdm.lock
159
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
160
+ # in version control.
161
+ # https://pdm.fming.dev/#use-with-ide
162
+ .pdm.toml
163
+
164
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
165
+ __pypackages__/
166
+
167
+ # Celery stuff
168
+ celerybeat-schedule
169
+ celerybeat.pid
170
+
171
+ # SageMath parsed files
172
+ *.sage.py
173
+
174
+ # Environments
175
+ .env
176
+ .venv
177
+ env/
178
+ venv/
179
+ ENV/
180
+ env.bak/
181
+ venv.bak/
182
+
183
+ # Spyder project settings
184
+ .spyderproject
185
+ .spyproject
186
+
187
+ # Rope project settings
188
+ .ropeproject
189
+
190
+ # mkdocs documentation
191
+ /site
192
+
193
+ # mypy
194
+ .mypy_cache/
195
+ .dmypy.json
196
+ dmypy.json
197
+
198
+ # Pyre type checker
199
+ .pyre/
200
+
201
+ # pytype static type analyzer
202
+ .pytype/
203
+
204
+ # Cython debug symbols
205
+ cython_debug/
206
+
207
+ # PyCharm
208
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
209
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
210
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
211
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
212
+ #.idea/
213
+
214
+ ### Python Patch ###
215
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
216
+ poetry.toml
217
+
218
+ # ruff
219
+ .ruff_cache/
220
+
221
+ # LSP config files
222
+ pyrightconfig.json
223
+
224
+ ### VisualStudioCode ###
225
+ .vscode/*
226
+ !.vscode/settings.json
227
+ !.vscode/tasks.json
228
+ !.vscode/launch.json
229
+ !.vscode/extensions.json
230
+ !.vscode/*.code-snippets
231
+
232
+ # Local History for Visual Studio Code
233
+ .history/
234
+
235
+ # Built Visual Studio Code Extensions
236
+ *.vsix
237
+
238
+ ### VisualStudioCode Patch ###
239
+ # Ignore all local history of files
240
+ .history
241
+ .ionide
242
+
243
+ ### Windows ###
244
+ # Windows thumbnail cache files
245
+ Thumbs.db
246
+ Thumbs.db:encryptable
247
+ ehthumbs.db
248
+ ehthumbs_vista.db
249
+
250
+ # Dump file
251
+ *.stackdump
252
+
253
+ # Folder config file
254
+ [Dd]esktop.ini
255
+
256
+ # Recycle Bin used on file shares
257
+ $RECYCLE.BIN/
258
+
259
+ # Windows Installer files
260
+ *.cab
261
+ *.msi
262
+ *.msix
263
+ *.msm
264
+ *.msp
265
+
266
+ # Windows shortcuts
267
+ *.lnk
268
+
269
+ .venv
270
+ .vscode
271
+ test.py
272
+ .vscode/launch.json
273
+
274
+ # Reference files that should not be included in the final package
275
+ crypto_openssl_test.py
276
+ crypto_standard_lib.py
@@ -0,0 +1,41 @@
1
+ ---
2
+ # MD007 - Unordered list indentation
3
+ # Sets nested list indents to 4 spaces instead of the default of 2.
4
+ # Required for proper ReadTheDocs rendering.
5
+ MD007:
6
+ indent: 4
7
+
8
+ # MD010 - No hard tabs
9
+ # No hard tabs allowed in docs. Use 4 spaces instead.
10
+ # This is disabled inline when used. E.g. docs/development/getting-started.md
11
+ MD010: true
12
+
13
+ # MD013 - Line length
14
+ # Defaults to 80 characters.
15
+ MD013: false
16
+
17
+ # MD014 - Dollar signs used before commands without showing output
18
+ # Ignores terminal examples using dollar signs without any output examples after.
19
+ # These occur in multiple places throughout our docs.
20
+ MD014: false
21
+
22
+ # MD024 - Multiple headings with the same content
23
+ # Multiple identical headings in the document are not allowed
24
+ # This is disabled on all of the release notes pages in docs/release-notes
25
+ MD024: true
26
+
27
+ # MD033 - Inline HTML
28
+ # Triggered when raw HTML is used in a markdown document
29
+ # Used/disabled in a few files. E.g. docs/user-guides/graphql.md
30
+ MD033: true
31
+
32
+ # MD041 - First line in a file should be a top-level heading
33
+ # This requires a top-level heading as the first line in every doc.
34
+ # This is only ignored inline in docs/index.md, but enabled globally elsewhere.
35
+ MD041: true
36
+
37
+ # MD046 - Code block style
38
+ # This rule is triggered when unwanted or different code block styles are used in the same document.
39
+ # However this conflicts with how ReadTheDocs renders "warning", "note", etc boxes, as those use indentation
40
+ # but code blocks do not.
41
+ MD046: false
@@ -0,0 +1,12 @@
1
+ ---
2
+ extends: "default"
3
+ rules:
4
+ comments: "enable"
5
+ empty-values: "disable"
6
+ indentation:
7
+ indent-sequences: "consistent"
8
+ line-length: "disable"
9
+ quoted-strings:
10
+ quote-type: "double"
11
+ ignore: |
12
+ .venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2024] [Brad Haas]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # Makefile for certmonitor project
2
+
3
+ .PHONY: maturin-develop build maturin-build test docs clean lint format
4
+
5
+ # Develop using maturin
6
+ maturin-develop:
7
+ uv run maturin develop --manifest-path certmonitor/rust_certinfo/Cargo.toml
8
+
9
+ # Build the project
10
+ build:
11
+ uv pip install -e .
12
+ $(MAKE) maturin-develop
13
+
14
+ # Build using maturin
15
+ maturin-build:
16
+ uv run maturin build --release --manifest-path certmonitor/rust_certinfo/Cargo.toml
17
+
18
+ # Run tests
19
+ test:
20
+ uv pip install -e .
21
+ pytest -v
22
+
23
+ # Serve documentation
24
+ docs:
25
+ mkdocs serve
26
+
27
+ # Clean build artifacts and caches
28
+ clean:
29
+ rm -rf build/ dist/ .venv/ .mypy_cache/ .pytest_cache/ __pycache__ */__pycache__ *.egg-info
30
+
31
+ # Lint code using ruff
32
+ lint:
33
+ uv run ruff check .
34
+
35
+ # Format code using ruff
36
+ format:
37
+ uv run ruff format .