netdoc-sdk 0.2.3__tar.gz → 0.2.4__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.
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.markdownlint.yaml +3 -2
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.pre-commit-config.yaml +3 -3
- netdoc_sdk-0.2.4/.release-please-manifest.json +3 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/CHANGELOG.md +7 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/PKG-INFO +1 -1
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/pyproject.toml +8 -8
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/client.py +7 -1
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_003_discovery_run.py +4 -1
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_004_discovery_job.py +4 -1
- netdoc_sdk-0.2.3/.release-please-manifest.json +0 -3
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.editorconfig +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.github/CODEOWNERS +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.github/workflows/cd.yml +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.github/workflows/ci.yml +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.gitignore +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.pylintrc +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.snyk +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/.yamlfmt +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/CONTRIBUTING.md +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/LICENSE +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/Makefile +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/README.md +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/poetry.lock +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/release-please-config.json +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/__init__.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/exceptions.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/__init__.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/core.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/discovery.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/inventory.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/src/netdoc_sdk/models/snapshots.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/conftest.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/core/test_001_authentication.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/core/test_002_tenant.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/core/test_003_user.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/core/test_004_token.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/core/test_005_profile.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/core/test_006_audit_log.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_001_credentials.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/discovery/test_002_collector.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/inventory/test_001_site.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/inventory/test_002_canonical_device.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/conftest.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_001_normalize_base_url.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_002_headers.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_003_api_path.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_004_clean_params.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_005_serialize_body.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_006_context_manager.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_007_error_mapping.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_008_network_errors.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_009_query_params.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_010_response_parsing.py +0 -0
- {netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/unit/test_011_from_credentials.py +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# MD013 - Line length
|
|
2
2
|
MD013:
|
|
3
|
-
|
|
3
|
+
heading_line_length: 80
|
|
4
|
+
line_length: 10000
|
|
4
5
|
code_blocks: false
|
|
5
6
|
tables: false
|
|
6
|
-
strict:
|
|
7
|
+
strict: false
|
|
7
8
|
# MD024 - No duplicate headings (useful in changelogs where ## Added repeats)
|
|
8
9
|
MD024:
|
|
9
10
|
siblings_only: true # allows duplicate headings in different sections
|
|
@@ -63,14 +63,14 @@ repos:
|
|
|
63
63
|
# --------------------------------------------------------------------------
|
|
64
64
|
# Security: static analysis for common vulnerabilities.
|
|
65
65
|
# Ruff has partial coverage (S ruleset) but bandit is more thorough.
|
|
66
|
-
# Config lives in
|
|
66
|
+
# Config lives in pyproject.toml [tool.bandit].
|
|
67
67
|
# --------------------------------------------------------------------------
|
|
68
68
|
- repo: https://github.com/PyCQA/bandit
|
|
69
69
|
rev: 1.9.4
|
|
70
70
|
hooks:
|
|
71
71
|
- id: bandit
|
|
72
|
-
args: ["-c", "pyproject.toml"]
|
|
73
|
-
exclude:
|
|
72
|
+
args: ["-c", "pyproject.toml"]
|
|
73
|
+
exclude: "tests|scripts"
|
|
74
74
|
# --------------------------------------------------------------------------
|
|
75
75
|
# Markdown linting.
|
|
76
76
|
# Config in .markdownlint.yaml.
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.4](https://github.com/NetDocLab/netdoc-sdk/compare/v0.2.3...v0.2.4) (2026-05-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add content-type to post/put/patch methods / fix tests on collector ([a3d99d4](https://github.com/NetDocLab/netdoc-sdk/commit/a3d99d460486ff45d34496be15a013583ed6295c))
|
|
9
|
+
|
|
3
10
|
## [0.2.3](https://github.com/NetDocLab/netdoc-sdk/compare/v0.2.2...v0.2.3) (2026-05-29)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "netdoc-sdk"
|
|
3
3
|
description = "Network Documentation Platform - SDK"
|
|
4
|
-
version = "0.2.
|
|
4
|
+
version = "0.2.4"
|
|
5
5
|
authors = [
|
|
6
|
-
{name = "Andrea Cavazzini",email = "cavazzini.andrea@gmail.com"},
|
|
7
|
-
{name = "Andrea Dainese",email = "andrea.dainese@gmail.com"}
|
|
6
|
+
{name = "Andrea Cavazzini", email = "cavazzini.andrea@gmail.com"},
|
|
7
|
+
{name = "Andrea Dainese", email = "andrea.dainese@gmail.com"},
|
|
8
8
|
]
|
|
9
9
|
classifiers = [
|
|
10
10
|
"Development Status :: 3 - Alpha",
|
|
@@ -85,14 +85,10 @@ mkdocstrings = {version = ">=0.24", extras = ["python"]}
|
|
|
85
85
|
# ---------------------------------------------------------------------------
|
|
86
86
|
|
|
87
87
|
[tool.bandit]
|
|
88
|
-
# Scan only the production package, not tests.
|
|
89
|
-
# Tests use assert statements (B101) and may import test-only modules.
|
|
90
|
-
exclude_dirs = ["tests", "docs"]
|
|
91
|
-
|
|
92
88
|
# B101: assert used — expected in tests (already excluded above, belt-and-suspenders)
|
|
93
89
|
# B404: import subprocess — common and not inherently unsafe in an SDK
|
|
94
90
|
# B603: subprocess without shell=True — safe, explicit args list
|
|
95
|
-
|
|
91
|
+
skip = ["B101", "B404", "B603"]
|
|
96
92
|
|
|
97
93
|
# Minimum severity and confidence to report (LOW / MEDIUM / HIGH)
|
|
98
94
|
# MEDIUM/MEDIUM avoids noise from low-confidence findings
|
|
@@ -185,12 +181,14 @@ exclude = [
|
|
|
185
181
|
"venv",
|
|
186
182
|
]
|
|
187
183
|
|
|
184
|
+
|
|
188
185
|
[tool.ruff.format]
|
|
189
186
|
quote-style = "single"
|
|
190
187
|
indent-style = "space"
|
|
191
188
|
line-ending = "lf"
|
|
192
189
|
skip-magic-trailing-comma = false
|
|
193
190
|
|
|
191
|
+
|
|
194
192
|
[tool.ruff.lint]
|
|
195
193
|
select = [
|
|
196
194
|
"B", # flake8-bugbear
|
|
@@ -212,10 +210,12 @@ ignore = [
|
|
|
212
210
|
"ARG001", # unused function argument — common in abstract/protocol methods
|
|
213
211
|
]
|
|
214
212
|
|
|
213
|
+
|
|
215
214
|
[tool.ruff.lint.isort]
|
|
216
215
|
known-first-party = ["netdoc_sdk"]
|
|
217
216
|
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
|
|
218
217
|
|
|
218
|
+
|
|
219
219
|
[tool.ruff.lint.per-file-ignores]
|
|
220
220
|
"tests/**/*.py" = ["S101", "ARG001", "ARG002"]
|
|
221
221
|
"tests/factories.py" = ["F401"]
|
|
@@ -184,6 +184,12 @@ class NetDocClient:
|
|
|
184
184
|
params: Mapping[str, Any] | None = None,
|
|
185
185
|
response_model: Any = None,
|
|
186
186
|
) -> Any:
|
|
187
|
+
request_headers = {}
|
|
188
|
+
if method.upper() in ('POST', 'PUT', 'PATCH'):
|
|
189
|
+
request_headers['Content-Type'] = 'application/json'
|
|
190
|
+
if headers:
|
|
191
|
+
request_headers.update(headers)
|
|
192
|
+
|
|
187
193
|
expected = None
|
|
188
194
|
if expected_status is not None:
|
|
189
195
|
expected = (
|
|
@@ -193,7 +199,7 @@ class NetDocClient:
|
|
|
193
199
|
try:
|
|
194
200
|
response = await self.client.request(
|
|
195
201
|
content=content,
|
|
196
|
-
headers=
|
|
202
|
+
headers=request_headers,
|
|
197
203
|
json=self._serialize_body(json) if json is not None else None,
|
|
198
204
|
method=method,
|
|
199
205
|
params=self._clean_params(params),
|
|
@@ -21,10 +21,13 @@ class TestDiscoveryRun:
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
# Create collector (heartbeat)
|
|
24
|
-
await collector_client.collector_heartbeat(
|
|
24
|
+
collector = await collector_client.collector_heartbeat(
|
|
25
25
|
name='collector@host.example.com', version='0.1.0'
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
+
# Activate collector
|
|
29
|
+
await admin_client.collector_update(collector.id, is_active=True)
|
|
30
|
+
|
|
28
31
|
# Test functions
|
|
29
32
|
discovery_run = await admin_client.discovery_add()
|
|
30
33
|
res = await admin_client.discovery_list()
|
|
@@ -21,10 +21,13 @@ class TestDiscoveryRun:
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
# Create collector (heartbeat)
|
|
24
|
-
await collector_client.collector_heartbeat(
|
|
24
|
+
collector = await collector_client.collector_heartbeat(
|
|
25
25
|
name='collector@host.example.com', version='0.1.0'
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
+
# Activate collector
|
|
29
|
+
await admin_client.collector_update(collector.id, is_active=True)
|
|
30
|
+
|
|
28
31
|
# Test functions
|
|
29
32
|
await collector_client.discoveryjob_claim()
|
|
30
33
|
# TODO heartbeat
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netdoc_sdk-0.2.3 → netdoc_sdk-0.2.4}/tests/integration/inventory/test_002_canonical_device.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|