actproof 0.2.0__py3-none-any.whl
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.
- actproof/__init__.py +234 -0
- actproof/anchor.py +586 -0
- actproof/canonical.py +369 -0
- actproof/catalogue.py +1031 -0
- actproof/cli.py +593 -0
- actproof/manifest.py +728 -0
- actproof/receipt.py +678 -0
- actproof/signers/__init__.py +89 -0
- actproof/signers/google_kms.py +392 -0
- actproof/signers/interface.py +298 -0
- actproof/signers/mnemonic.py +153 -0
- actproof/timestamp.py +527 -0
- actproof/verify.py +683 -0
- actproof-0.2.0.dist-info/METADATA +295 -0
- actproof-0.2.0.dist-info/RECORD +18 -0
- actproof-0.2.0.dist-info/WHEEL +4 -0
- actproof-0.2.0.dist-info/entry_points.txt +2 -0
- actproof-0.2.0.dist-info/licenses/LICENSE +21 -0
actproof/__init__.py
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Deyan Paroushev
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
"""
|
|
4
|
+
actproof: anchor signed JSON manifests; verify anyone's anchored receipts.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
__version__ = "0.2.0"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# ─────────────────────────────────────────────────────────────────
|
|
13
|
+
# PUBLIC API
|
|
14
|
+
# ─────────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
# v0.0.2: canonical.py
|
|
17
|
+
from actproof.canonical import (
|
|
18
|
+
CanonicalizationError,
|
|
19
|
+
IJSON_MAX_SAFE_INT,
|
|
20
|
+
IJSON_MIN_SAFE_INT,
|
|
21
|
+
canonicalize,
|
|
22
|
+
canonicalize_from_json,
|
|
23
|
+
canonicalize_str,
|
|
24
|
+
hash_canonical,
|
|
25
|
+
hash_canonical_hex,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
# v0.0.3: manifest.py
|
|
29
|
+
from actproof.manifest import (
|
|
30
|
+
BATCHING_PROFILE_SINGLE,
|
|
31
|
+
RECEIPT_PROFILE_V1,
|
|
32
|
+
CatalogueBinding,
|
|
33
|
+
Evidence,
|
|
34
|
+
Issuer,
|
|
35
|
+
Manifest,
|
|
36
|
+
ManifestValidationError,
|
|
37
|
+
Recipient,
|
|
38
|
+
build_manifest,
|
|
39
|
+
hash_email,
|
|
40
|
+
hash_file_bytes,
|
|
41
|
+
hash_json_bytes,
|
|
42
|
+
hash_manifest,
|
|
43
|
+
hash_manifest_hex,
|
|
44
|
+
manifest_from_dict,
|
|
45
|
+
manifest_to_dict,
|
|
46
|
+
normalize_email,
|
|
47
|
+
validate_manifest_shape,
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
# v0.0.4: catalogue.py (extended in v0.1.1 with v3 schema support)
|
|
51
|
+
from actproof.catalogue import (
|
|
52
|
+
ENV_CATALOGUE_PATH,
|
|
53
|
+
SCHEMA_DISCRIMINATOR,
|
|
54
|
+
SCHEMA_DISCRIMINATOR_V2,
|
|
55
|
+
SCHEMA_DISCRIMINATOR_V3,
|
|
56
|
+
SCHEMA_DISCRIMINATORS,
|
|
57
|
+
Catalogue,
|
|
58
|
+
CatalogueEntry,
|
|
59
|
+
CatalogueLoadError,
|
|
60
|
+
DisclosureProfile,
|
|
61
|
+
PriorReceiptsProfile,
|
|
62
|
+
RegulatedContextProfile,
|
|
63
|
+
RegulatoryCitation,
|
|
64
|
+
RelianceContext,
|
|
65
|
+
SignaturePolicy,
|
|
66
|
+
ValidationIssue,
|
|
67
|
+
hash_entry_file,
|
|
68
|
+
hash_schema_file,
|
|
69
|
+
load_catalogue,
|
|
70
|
+
validate_manifest,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
# v0.0.5: receipt.py
|
|
74
|
+
from actproof.receipt import (
|
|
75
|
+
ALGORAND_BETANET,
|
|
76
|
+
ALGORAND_MAINNET,
|
|
77
|
+
ALGORAND_TESTNET,
|
|
78
|
+
ARC2_DAPP_NAME,
|
|
79
|
+
ARC2_FORMAT_VERSION_JSON,
|
|
80
|
+
ARC2_NOTE_FORMAT,
|
|
81
|
+
AnchorRecord,
|
|
82
|
+
IssuerEvidence,
|
|
83
|
+
PlaintextRecipient,
|
|
84
|
+
Receipt,
|
|
85
|
+
ReceiptError,
|
|
86
|
+
TimestampToken,
|
|
87
|
+
build_issuer_evidence,
|
|
88
|
+
build_receipt,
|
|
89
|
+
issuer_evidence_from_dict,
|
|
90
|
+
issuer_evidence_to_dict,
|
|
91
|
+
read_issuer_evidence,
|
|
92
|
+
read_receipt,
|
|
93
|
+
receipt_from_dict,
|
|
94
|
+
receipt_to_dict,
|
|
95
|
+
write_issuer_evidence,
|
|
96
|
+
write_receipt,
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
# v0.0.6: timestamp.py
|
|
100
|
+
from actproof.timestamp import (
|
|
101
|
+
DEFAULT_TIMEOUT_SECONDS,
|
|
102
|
+
DEFAULT_TSA_CHAIN,
|
|
103
|
+
SUPPORTED_HASH_ALGORITHMS,
|
|
104
|
+
AcquisitionResult,
|
|
105
|
+
TimestampAuthority,
|
|
106
|
+
TimestampError,
|
|
107
|
+
TSAAttempt,
|
|
108
|
+
acquire_timestamp_token,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# v0.0.7: anchor.py
|
|
112
|
+
from actproof.anchor import (
|
|
113
|
+
ALGORAND_NOTE_MAX_BYTES,
|
|
114
|
+
DEFAULT_ALGOD_URL_MAINNET,
|
|
115
|
+
DEFAULT_ALGOD_URL_TESTNET,
|
|
116
|
+
DEFAULT_CONFIRMATION_TIMEOUT_SECONDS,
|
|
117
|
+
NOTE_VERSION,
|
|
118
|
+
AnchorError,
|
|
119
|
+
AnchorMode,
|
|
120
|
+
Signer,
|
|
121
|
+
anchor_manifest,
|
|
122
|
+
build_note_bytes,
|
|
123
|
+
build_note_payload,
|
|
124
|
+
build_transaction,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# v0.0.8: signers/
|
|
128
|
+
from actproof.signers import (
|
|
129
|
+
FORBIDDEN_METHOD_NAMES,
|
|
130
|
+
AlgorandSigner,
|
|
131
|
+
GoogleKMSSigner,
|
|
132
|
+
MnemonicSigner,
|
|
133
|
+
SignerValidationError,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# v0.0.9: verify.py
|
|
137
|
+
from actproof.verify import (
|
|
138
|
+
DEFAULT_INDEXER_URL_MAINNET,
|
|
139
|
+
DEFAULT_INDEXER_URL_TESTNET,
|
|
140
|
+
SUPPORTED_RECEIPT_PROFILES,
|
|
141
|
+
CheckResult,
|
|
142
|
+
CheckStatus,
|
|
143
|
+
VerificationError,
|
|
144
|
+
VerificationResult,
|
|
145
|
+
verify_receipt,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
__all__ = [
|
|
150
|
+
"__version__",
|
|
151
|
+
# canonical.py (v0.0.2)
|
|
152
|
+
"canonicalize", "canonicalize_str", "canonicalize_from_json",
|
|
153
|
+
"hash_canonical", "hash_canonical_hex",
|
|
154
|
+
"CanonicalizationError", "IJSON_MAX_SAFE_INT", "IJSON_MIN_SAFE_INT",
|
|
155
|
+
# manifest.py (v0.0.3)
|
|
156
|
+
"Manifest", "CatalogueBinding", "Issuer", "Evidence", "Recipient",
|
|
157
|
+
"build_manifest", "manifest_to_dict", "manifest_from_dict",
|
|
158
|
+
"hash_manifest", "hash_manifest_hex",
|
|
159
|
+
"normalize_email", "hash_email", "hash_file_bytes", "hash_json_bytes",
|
|
160
|
+
"validate_manifest_shape", "ManifestValidationError",
|
|
161
|
+
"RECEIPT_PROFILE_V1", "BATCHING_PROFILE_SINGLE",
|
|
162
|
+
# catalogue.py (v0.0.4; v3 schema support added in v0.1.1)
|
|
163
|
+
"Catalogue", "CatalogueEntry", "RegulatoryCitation", "SignaturePolicy",
|
|
164
|
+
"ValidationIssue", "CatalogueLoadError",
|
|
165
|
+
"load_catalogue", "validate_manifest",
|
|
166
|
+
"hash_entry_file", "hash_schema_file",
|
|
167
|
+
"SCHEMA_DISCRIMINATOR", "ENV_CATALOGUE_PATH",
|
|
168
|
+
"RegulatedContextProfile", "PriorReceiptsProfile",
|
|
169
|
+
"RelianceContext", "DisclosureProfile",
|
|
170
|
+
"SCHEMA_DISCRIMINATOR_V2", "SCHEMA_DISCRIMINATOR_V3",
|
|
171
|
+
"SCHEMA_DISCRIMINATORS",
|
|
172
|
+
# receipt.py (v0.0.5)
|
|
173
|
+
"AnchorRecord", "TimestampToken", "Receipt",
|
|
174
|
+
"PlaintextRecipient", "IssuerEvidence", "ReceiptError",
|
|
175
|
+
"build_receipt", "build_issuer_evidence",
|
|
176
|
+
"receipt_to_dict", "receipt_from_dict",
|
|
177
|
+
"read_receipt", "write_receipt",
|
|
178
|
+
"issuer_evidence_to_dict", "issuer_evidence_from_dict",
|
|
179
|
+
"read_issuer_evidence", "write_issuer_evidence",
|
|
180
|
+
"ALGORAND_MAINNET", "ALGORAND_TESTNET", "ALGORAND_BETANET",
|
|
181
|
+
"ARC2_NOTE_FORMAT", "ARC2_DAPP_NAME", "ARC2_FORMAT_VERSION_JSON",
|
|
182
|
+
# timestamp.py (v0.0.6)
|
|
183
|
+
"TimestampAuthority", "TSAAttempt", "AcquisitionResult",
|
|
184
|
+
"TimestampError", "acquire_timestamp_token",
|
|
185
|
+
"DEFAULT_TSA_CHAIN", "DEFAULT_TIMEOUT_SECONDS",
|
|
186
|
+
"SUPPORTED_HASH_ALGORITHMS",
|
|
187
|
+
# anchor.py (v0.0.7)
|
|
188
|
+
"AnchorMode", "Signer", "AnchorError",
|
|
189
|
+
"anchor_manifest",
|
|
190
|
+
"build_note_payload", "build_note_bytes", "build_transaction",
|
|
191
|
+
"DEFAULT_ALGOD_URL_MAINNET", "DEFAULT_ALGOD_URL_TESTNET",
|
|
192
|
+
"DEFAULT_CONFIRMATION_TIMEOUT_SECONDS",
|
|
193
|
+
"ALGORAND_NOTE_MAX_BYTES", "NOTE_VERSION",
|
|
194
|
+
# signers/ (v0.0.8)
|
|
195
|
+
"AlgorandSigner", "MnemonicSigner", "GoogleKMSSigner",
|
|
196
|
+
"FORBIDDEN_METHOD_NAMES", "SignerValidationError",
|
|
197
|
+
# verify.py (v0.0.9)
|
|
198
|
+
"verify_receipt", "CheckResult", "CheckStatus",
|
|
199
|
+
"VerificationResult", "VerificationError",
|
|
200
|
+
"DEFAULT_INDEXER_URL_MAINNET", "DEFAULT_INDEXER_URL_TESTNET",
|
|
201
|
+
"SUPPORTED_RECEIPT_PROFILES",
|
|
202
|
+
]
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
# ─────────────────────────────────────────────────────────────────
|
|
206
|
+
# v0.1.0: All planned v0.x public API has landed. v0.2.0 adds docs and
|
|
207
|
+
# the GitHub Action wrapper. v0.3.0 adds the conformance test suite.
|
|
208
|
+
# v1.0.0 freezes the API.
|
|
209
|
+
#
|
|
210
|
+
# v0.1.1: Additive support for actproof-events catalogue schema v3.
|
|
211
|
+
# Four new optional CatalogueEntry sub-objects (RegulatedContextProfile,
|
|
212
|
+
# PriorReceiptsProfile, RelianceContext, DisclosureProfile) and three
|
|
213
|
+
# new discriminator constants (SCHEMA_DISCRIMINATOR_V2,
|
|
214
|
+
# SCHEMA_DISCRIMINATOR_V3, SCHEMA_DISCRIMINATORS). The legacy
|
|
215
|
+
# SCHEMA_DISCRIMINATOR name remains as a backward-compatible alias for
|
|
216
|
+
# SCHEMA_DISCRIMINATOR_V2. No breaking changes.
|
|
217
|
+
# ─────────────────────────────────────────────────────────────────
|
|
218
|
+
|
|
219
|
+
_PLACEHOLDERS: dict[str, str] = {}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def __getattr__(name: str) -> None:
|
|
223
|
+
if name in _PLACEHOLDERS:
|
|
224
|
+
raise NotImplementedError(
|
|
225
|
+
f"actproof.{name} is part of the planned public API but is not "
|
|
226
|
+
f"yet implemented in this release ({__version__}). "
|
|
227
|
+
f"It {_PLACEHOLDERS[name]}. "
|
|
228
|
+
f"See https://github.com/deyan-paroushev/actproof-py/blob/main/CHANGELOG.md"
|
|
229
|
+
)
|
|
230
|
+
raise AttributeError(f"module 'actproof' has no attribute {name!r}")
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def __dir__() -> list[str]:
|
|
234
|
+
return sorted(set(__all__) | set(_PLACEHOLDERS.keys()))
|