ledgix-python 0.1.3__tar.gz → 0.1.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.
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/PKG-INFO +2 -2
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/README.md +1 -1
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/pyproject.toml +1 -1
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/__init__.py +1 -1
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/client.py +25 -2
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/models.py +2 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/.gitignore +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/demo.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/requirements.txt +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/adapters/__init__.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/adapters/crewai.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/adapters/langchain.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/adapters/llamaindex.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/config.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/enforce.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/src/ledgix_python/exceptions.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/tests/__init__.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/tests/conftest.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/tests/test_adapters.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/tests/test_client.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/tests/test_enforce.py +0 -0
- {ledgix_python-0.1.3 → ledgix_python-0.1.4}/tests/test_models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ledgix-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Agent-agnostic compliance shim for SOX 404 policy enforcement via the ALCV Vault
|
|
5
5
|
Project-URL: Homepage, https://github.com/ledgix-dev/python-sdk
|
|
6
6
|
Project-URL: Documentation, https://docs.ledgix.dev
|
|
@@ -40,7 +40,7 @@ Description-Content-Type: text/markdown
|
|
|
40
40
|
|
|
41
41
|
# Ledgix ALCV — Python SDK
|
|
42
42
|
|
|
43
|
-
[](https://pypi.org/project/ledgix-python/)
|
|
44
44
|
[](https://python.org)
|
|
45
45
|
[](LICENSE)
|
|
46
46
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ledgix ALCV — Python SDK
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/ledgix-python/)
|
|
4
4
|
[](https://python.org)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
@@ -526,6 +526,21 @@ class LedgixClient:
|
|
|
526
526
|
for entry in sorted_entries:
|
|
527
527
|
if entry.prev_row_hash != previous_row_hash:
|
|
528
528
|
raise TokenVerificationError(f"Ledger chain broken at seq {entry.seq}")
|
|
529
|
+
previous_row_hash = entry.row_hash
|
|
530
|
+
|
|
531
|
+
first_signed_entry_index = next(
|
|
532
|
+
(
|
|
533
|
+
index
|
|
534
|
+
for index, entry in enumerate(sorted_entries)
|
|
535
|
+
if entry.receipt_payload and entry.row_signature and entry.signer_key_id
|
|
536
|
+
),
|
|
537
|
+
-1,
|
|
538
|
+
)
|
|
539
|
+
if first_signed_entry_index == -1:
|
|
540
|
+
raise TokenVerificationError("No signed receipt proof data is available for this ledger yet")
|
|
541
|
+
|
|
542
|
+
signed_entries = sorted_entries[first_signed_entry_index:]
|
|
543
|
+
for entry in signed_entries:
|
|
529
544
|
if not entry.receipt_payload or not entry.row_signature or not entry.signer_key_id:
|
|
530
545
|
raise TokenVerificationError(f"Missing receipt proof data at seq {entry.seq}")
|
|
531
546
|
if not algorithm.verify(
|
|
@@ -534,7 +549,6 @@ class LedgixClient:
|
|
|
534
549
|
self._decode_base64url(entry.row_signature),
|
|
535
550
|
):
|
|
536
551
|
raise TokenVerificationError(f"Ledger receipt signature invalid at seq {entry.seq}")
|
|
537
|
-
previous_row_hash = entry.row_hash
|
|
538
552
|
|
|
539
553
|
previous_manifest_hash = "sha256:" + ("0" * 64)
|
|
540
554
|
sorted_manifests = sorted(manifests, key=lambda item: item.period_start)
|
|
@@ -565,10 +579,17 @@ class LedgixClient:
|
|
|
565
579
|
|
|
566
580
|
return LedgerVerificationResult(
|
|
567
581
|
intact=True,
|
|
568
|
-
verified_entries=len(
|
|
582
|
+
verified_entries=len(signed_entries),
|
|
569
583
|
verified_manifests=len(sorted_manifests),
|
|
570
584
|
latest_row_hash=sorted_entries[-1].row_hash if sorted_entries else None,
|
|
571
585
|
latest_manifest_hash=sorted_manifests[-1].manifest_hash if sorted_manifests else None,
|
|
586
|
+
legacy_unsigned_entries=first_signed_entry_index,
|
|
587
|
+
coverage_note=(
|
|
588
|
+
f"Verified signed receipts from seq {signed_entries[0].seq} onward. "
|
|
589
|
+
f"{first_signed_entry_index} earlier {'entry predates' if first_signed_entry_index == 1 else 'entries predate'} signed receipt proofs."
|
|
590
|
+
if first_signed_entry_index > 0
|
|
591
|
+
else None
|
|
592
|
+
),
|
|
572
593
|
)
|
|
573
594
|
except Exception as exc:
|
|
574
595
|
return LedgerVerificationResult(
|
|
@@ -577,6 +598,8 @@ class LedgixClient:
|
|
|
577
598
|
verified_manifests=0,
|
|
578
599
|
latest_row_hash=None,
|
|
579
600
|
latest_manifest_hash=None,
|
|
601
|
+
legacy_unsigned_entries=0,
|
|
602
|
+
coverage_note=None,
|
|
580
603
|
error=str(exc),
|
|
581
604
|
)
|
|
582
605
|
|
|
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
|