openentity 0.4.0__tar.gz → 0.5.1__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 (28) hide show
  1. openentity-0.5.1/PKG-INFO +60 -0
  2. openentity-0.5.1/README.md +44 -0
  3. {openentity-0.4.0 → openentity-0.5.1}/openentity/__init__.py +2 -1
  4. openentity-0.5.1/openentity/cli.py +1251 -0
  5. {openentity-0.4.0 → openentity-0.5.1}/openentity/client.py +9 -7
  6. openentity-0.5.1/openentity/httpsig.py +110 -0
  7. {openentity-0.4.0 → openentity-0.5.1}/openentity/issuer.py +20 -0
  8. openentity-0.5.1/openentity/schema.py +28 -0
  9. openentity-0.5.1/openentity/schemas/openentity-1.0.json +1251 -0
  10. {openentity-0.4.0 → openentity-0.5.1}/pyproject.toml +6 -2
  11. openentity-0.5.1/tests/test_cli.py +273 -0
  12. {openentity-0.4.0 → openentity-0.5.1}/tests/test_client.py +66 -24
  13. {openentity-0.4.0 → openentity-0.5.1}/tests/test_core.py +10 -8
  14. openentity-0.5.1/tests/test_httpsig.py +116 -0
  15. openentity-0.5.1/tests/test_parity.py +159 -0
  16. openentity-0.5.1/uv.lock +1309 -0
  17. openentity-0.4.0/PKG-INFO +0 -46
  18. openentity-0.4.0/README.md +0 -33
  19. openentity-0.4.0/openentity/cli.py +0 -323
  20. openentity-0.4.0/uv.lock +0 -293
  21. {openentity-0.4.0 → openentity-0.5.1}/.gitignore +0 -0
  22. {openentity-0.4.0 → openentity-0.5.1}/openentity/core.py +0 -0
  23. {openentity-0.4.0 → openentity-0.5.1}/openentity/identity.py +0 -0
  24. {openentity-0.4.0 → openentity-0.5.1}/openentity/report.py +0 -0
  25. {openentity-0.4.0 → openentity-0.5.1}/tests/test_identity.py +0 -0
  26. {openentity-0.4.0 → openentity-0.5.1}/tests/test_issuer.py +0 -0
  27. {openentity-0.4.0 → openentity-0.5.1}/tests/test_trust.py +0 -0
  28. {openentity-0.4.0 → openentity-0.5.1}/tests/test_verifier.py +0 -0
@@ -0,0 +1,60 @@
1
+ Metadata-Version: 2.5
2
+ Name: openentity
3
+ Version: 0.5.1
4
+ Summary: Open Entity (OEIS-1) client: JCS, did:key, eddsa-jcs-2022, Merkle proofs, adopt().
5
+ Project-URL: Homepage, https://openentity.org
6
+ Project-URL: Documentation, https://oeis.dev
7
+ Project-URL: Source, https://github.com/moltbot-den/openentity
8
+ License-Expression: MIT
9
+ Requires-Python: >=3.11
10
+ Requires-Dist: cryptography>=42
11
+ Requires-Dist: jsonschema>=4.18
12
+ Requires-Dist: pycryptodome>=3.20
13
+ Provides-Extra: wallet
14
+ Requires-Dist: eth-account>=0.11; extra == 'wallet'
15
+ Description-Content-Type: text/markdown
16
+
17
+ # openentity (Python)
18
+
19
+ Python client for the Open Entity Identity Standard (spec id `OEIS-1`). Dependencies: `cryptography`, `pycryptodome`, `jsonschema`. Optional: `openentity[wallet]` (`eth-account`) to sign wallet proofs.
20
+
21
+ ```
22
+ uvx openentity adopt --name "My Agent" --agree
23
+ ```
24
+
25
+ Same commands, flags, `--json`, exit codes and `~/.openentity/<eid>/` file layout (`key` JWK at 0600, `entity.json`, `declaration.json`, `state.json`, `record.jsonl`, `current`) as the npm CLI, so either one can read what the other saved. The registry is `--registry URL`, then `$OPENENTITY_REGISTRY`, then the entity's own, then openentity.org. Pass `--eid` when there are several entities.
26
+
27
+ ```
28
+ openentity adopt --name N --agree [--description --operator --operator-kind --contact --custody --model --provider --runtime --capabilities a,b --wallet KEY|0x.. --erc8004 eip155:1:0x..:7 --chain N --dry-run]
29
+ openentity whoami | self [--entries N] | stats
30
+ openentity anchor [--format text|openclaw|claude|agents] [--write --dir D]
31
+ openentity document set <field> <value> | edit | push
32
+ openentity record stance --type refusal --reason values --cost low --context TEXT [--conflict]
33
+ openentity record update --topic T --from A --to B
34
+ openentity record arc open|close --id SLUG --title TEXT
35
+ openentity record collab --with EID --role R --outcome O
36
+ openentity record continuity --event rotation --from A --to B
37
+ openentity record push | redact <seq> (--no-push appends without pushing; --payload '<json>' replaces the flags)
38
+ openentity alias add domain|wallet|erc8004|platform <value> [--wallet KEY|0x.. --chain N --signature 0x..]
39
+ openentity card [--url U | --extension-only] [--eid EID] openentity conformance <registry-url>
40
+ openentity rotate | migrate [--to keyfile --dry-run] openentity recover --previous EID --via ALIAS, then --proof FILE
41
+ openentity verify <eid|url|file> openentity resolve <did>
42
+ openentity present --audience A --nonce N [--no-attestations] openentity verify-presentation FILE --audience A --nonce N
43
+ openentity log checkpoint | proof <index> | audit <n>
44
+ openentity export [--with-key --out FILE] openentity import FILE [--key JWK --force]
45
+ openentity dispute --subject EID [--object SHA256] --reason inaccurate --statement "..."
46
+ openentity find --capability C [-q TEXT --alias-type T --level L1]
47
+ openentity withdraw --force
48
+ ```
49
+
50
+ With a wallet key (`--wallet <hex key or key file>`, or `$OPENENTITY_WALLET_KEY`) `adopt --wallet/--erc8004` and `alias add wallet|erc8004` sign the EIP-4361 proof here and the entity lands at L1 in one command. With only an address, `alias add wallet` prints the EIP-4361 message, you sign it with the wallet, and a second run with `--signature` submits it. Objects are validated against the spec schemas (packaged in the wheel) before signing. Keys saved by 0.4 under `~/.openentity/keys/` are migrated into the layout above on first use; the old file is left alone.
51
+
52
+ Exit codes match the npm CLI: 0 ok, 1 usage, 2 network, 3 verification failed, 4 registry rejected, 5 local state. `verify` checks signatures, the signer, the Declaration hash, the record chain (with Redaction signatures) and the log checkpoint and inclusion proof.
53
+
54
+ Library, each taking the 32-byte seed and a registry URL: `adopt(name, registry=...)`, `withdraw(seed, registry)`, `record(seed, [(kind, payload), ...], registry)` (chains `seq` and `prev` from the registry head, pushes in batches of 100), `dispute(seed, subject, reason, statement, object_sha256=None, registry=...)`, `find(registry, capability=..., q=..., alias_type=..., level=...)`, `present(seed, audience, nonce, registry=None)`. Primitives: `canonicalize`, `sign_object`, `verify_object`, `verify_presentation`, `did_key`, `mint_stamp`, `verify_inclusion`.
55
+
56
+ Shared core: `Identity.load_or_create()` (key in the OS keychain, else `~/.openentity/identity.key` at 0600; pass `.seed` to the calls above), `adopt(..., client="adk")` (an unsigned label: adk, goose, langchain, ui-tars, cli, other), `trust(eid)` (a `TrustReport` from registry reads only, every signature verified locally, cached 5 minutes, `ok=False` on any failure), and `openentity.issuer` (`attestation`, `revocation`, `did_document`, `openentity_json`).
57
+
58
+ HTTP message signatures (RFC 9421, Web Bot Auth profile): `sign_request(method, url, body, private_key, did)` returns `Signature-Input`, `Signature` and, for a non-empty body, `Content-Digest` (`private_key` is an `Identity`, a `KeyPair` or a 32-byte seed; ed25519, `keyid` = the signer's did:key, covers `@method`, `@target-uri`, `content-digest`; `created`, `expires`, `nonce`). `verify_request(method, url, headers, body)` returns `{"did", "keyid", "created", "expires", "nonce"}` or raises `HttpSigError` with a `.code` (`missing_headers`, `unknown_alg`, `bad_keyid`, `digest_mismatch`, `created_in_future`, `created_too_old`, `expired`, `lifetime_too_long`, `missing_nonce`, `bad_signature`). Nonce replay tracking is yours. Shared vectors: `test-vectors/http-signature.json`.
59
+
60
+ Written from the spec text alone, independent of the TypeScript SDK.
@@ -0,0 +1,44 @@
1
+ # openentity (Python)
2
+
3
+ Python client for the Open Entity Identity Standard (spec id `OEIS-1`). Dependencies: `cryptography`, `pycryptodome`, `jsonschema`. Optional: `openentity[wallet]` (`eth-account`) to sign wallet proofs.
4
+
5
+ ```
6
+ uvx openentity adopt --name "My Agent" --agree
7
+ ```
8
+
9
+ Same commands, flags, `--json`, exit codes and `~/.openentity/<eid>/` file layout (`key` JWK at 0600, `entity.json`, `declaration.json`, `state.json`, `record.jsonl`, `current`) as the npm CLI, so either one can read what the other saved. The registry is `--registry URL`, then `$OPENENTITY_REGISTRY`, then the entity's own, then openentity.org. Pass `--eid` when there are several entities.
10
+
11
+ ```
12
+ openentity adopt --name N --agree [--description --operator --operator-kind --contact --custody --model --provider --runtime --capabilities a,b --wallet KEY|0x.. --erc8004 eip155:1:0x..:7 --chain N --dry-run]
13
+ openentity whoami | self [--entries N] | stats
14
+ openentity anchor [--format text|openclaw|claude|agents] [--write --dir D]
15
+ openentity document set <field> <value> | edit | push
16
+ openentity record stance --type refusal --reason values --cost low --context TEXT [--conflict]
17
+ openentity record update --topic T --from A --to B
18
+ openentity record arc open|close --id SLUG --title TEXT
19
+ openentity record collab --with EID --role R --outcome O
20
+ openentity record continuity --event rotation --from A --to B
21
+ openentity record push | redact <seq> (--no-push appends without pushing; --payload '<json>' replaces the flags)
22
+ openentity alias add domain|wallet|erc8004|platform <value> [--wallet KEY|0x.. --chain N --signature 0x..]
23
+ openentity card [--url U | --extension-only] [--eid EID] openentity conformance <registry-url>
24
+ openentity rotate | migrate [--to keyfile --dry-run] openentity recover --previous EID --via ALIAS, then --proof FILE
25
+ openentity verify <eid|url|file> openentity resolve <did>
26
+ openentity present --audience A --nonce N [--no-attestations] openentity verify-presentation FILE --audience A --nonce N
27
+ openentity log checkpoint | proof <index> | audit <n>
28
+ openentity export [--with-key --out FILE] openentity import FILE [--key JWK --force]
29
+ openentity dispute --subject EID [--object SHA256] --reason inaccurate --statement "..."
30
+ openentity find --capability C [-q TEXT --alias-type T --level L1]
31
+ openentity withdraw --force
32
+ ```
33
+
34
+ With a wallet key (`--wallet <hex key or key file>`, or `$OPENENTITY_WALLET_KEY`) `adopt --wallet/--erc8004` and `alias add wallet|erc8004` sign the EIP-4361 proof here and the entity lands at L1 in one command. With only an address, `alias add wallet` prints the EIP-4361 message, you sign it with the wallet, and a second run with `--signature` submits it. Objects are validated against the spec schemas (packaged in the wheel) before signing. Keys saved by 0.4 under `~/.openentity/keys/` are migrated into the layout above on first use; the old file is left alone.
35
+
36
+ Exit codes match the npm CLI: 0 ok, 1 usage, 2 network, 3 verification failed, 4 registry rejected, 5 local state. `verify` checks signatures, the signer, the Declaration hash, the record chain (with Redaction signatures) and the log checkpoint and inclusion proof.
37
+
38
+ Library, each taking the 32-byte seed and a registry URL: `adopt(name, registry=...)`, `withdraw(seed, registry)`, `record(seed, [(kind, payload), ...], registry)` (chains `seq` and `prev` from the registry head, pushes in batches of 100), `dispute(seed, subject, reason, statement, object_sha256=None, registry=...)`, `find(registry, capability=..., q=..., alias_type=..., level=...)`, `present(seed, audience, nonce, registry=None)`. Primitives: `canonicalize`, `sign_object`, `verify_object`, `verify_presentation`, `did_key`, `mint_stamp`, `verify_inclusion`.
39
+
40
+ Shared core: `Identity.load_or_create()` (key in the OS keychain, else `~/.openentity/identity.key` at 0600; pass `.seed` to the calls above), `adopt(..., client="adk")` (an unsigned label: adk, goose, langchain, ui-tars, cli, other), `trust(eid)` (a `TrustReport` from registry reads only, every signature verified locally, cached 5 minutes, `ok=False` on any failure), and `openentity.issuer` (`attestation`, `revocation`, `did_document`, `openentity_json`).
41
+
42
+ HTTP message signatures (RFC 9421, Web Bot Auth profile): `sign_request(method, url, body, private_key, did)` returns `Signature-Input`, `Signature` and, for a non-empty body, `Content-Digest` (`private_key` is an `Identity`, a `KeyPair` or a 32-byte seed; ed25519, `keyid` = the signer's did:key, covers `@method`, `@target-uri`, `content-digest`; `created`, `expires`, `nonce`). `verify_request(method, url, headers, body)` returns `{"did", "keyid", "created", "expires", "nonce"}` or raises `HttpSigError` with a `.code` (`missing_headers`, `unknown_alg`, `bad_keyid`, `digest_mismatch`, `created_in_future`, `created_too_old`, `expired`, `lifetime_too_long`, `missing_nonce`, `bad_signature`). Nonce replay tracking is yours. Shared vectors: `test-vectors/http-signature.json`.
43
+
44
+ Written from the spec text alone, independent of the TypeScript SDK.
@@ -1,7 +1,8 @@
1
1
  from .client import adopt, dispute, find, present, record, rotate, withdraw # noqa: F401
2
2
  from .core import * # noqa: F401,F403
3
3
  from . import issuer # noqa: F401
4
+ from .httpsig import HttpSigError, sign_request, verify_request # noqa: F401
4
5
  from .identity import Identity # noqa: F401
5
6
  from .report import TrustReport, trust # noqa: F401
6
7
 
7
- __version__ = "0.4.0"
8
+ __version__ = "0.5.1"