overturo-sdk 2.0.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.
- overturo_sdk-2.0.0/.github/workflows/release.yml +45 -0
- overturo_sdk-2.0.0/.gitignore +7 -0
- overturo_sdk-2.0.0/CHANGELOG.md +110 -0
- overturo_sdk-2.0.0/LICENSE +201 -0
- overturo_sdk-2.0.0/PKG-INFO +144 -0
- overturo_sdk-2.0.0/README.md +112 -0
- overturo_sdk-2.0.0/SECURITY.md +14 -0
- overturo_sdk-2.0.0/endpoints.json +38 -0
- overturo_sdk-2.0.0/examples/cedar_adapter/EXAMPLE_DISCLAIMER.md +22 -0
- overturo_sdk-2.0.0/examples/cedar_adapter/README.md +101 -0
- overturo_sdk-2.0.0/examples/cedar_adapter/app.py +94 -0
- overturo_sdk-2.0.0/examples/cedar_adapter/cedar_adapter.py +217 -0
- overturo_sdk-2.0.0/examples/cedar_adapter/policy.json +29 -0
- overturo_sdk-2.0.0/examples/cedar_adapter/tests/test_cedar_adapter.py +109 -0
- overturo_sdk-2.0.0/integration/__init__.py +0 -0
- overturo_sdk-2.0.0/integration/scenario.py +71 -0
- overturo_sdk-2.0.0/integration/test_sdk_integration.py +174 -0
- overturo_sdk-2.0.0/pyproject.toml +97 -0
- overturo_sdk-2.0.0/src/overturo/__init__.py +185 -0
- overturo_sdk-2.0.0/src/overturo/_experimental.py +37 -0
- overturo_sdk-2.0.0/src/overturo/_http.py +279 -0
- overturo_sdk-2.0.0/src/overturo/_logger.py +67 -0
- overturo_sdk-2.0.0/src/overturo/authorize/__init__.py +30 -0
- overturo_sdk-2.0.0/src/overturo/authorize/_jurisdiction.py +14 -0
- overturo_sdk-2.0.0/src/overturo/authorize/adapter.py +33 -0
- overturo_sdk-2.0.0/src/overturo/authorize/client.py +334 -0
- overturo_sdk-2.0.0/src/overturo/authorize/dpop.py +139 -0
- overturo_sdk-2.0.0/src/overturo/authorize/receipt.py +50 -0
- overturo_sdk-2.0.0/src/overturo/authorize/record_stream.py +76 -0
- overturo_sdk-2.0.0/src/overturo/canonicalize.py +45 -0
- overturo_sdk-2.0.0/src/overturo/consent_records/__init__.py +34 -0
- overturo_sdk-2.0.0/src/overturo/consent_records/client.py +285 -0
- overturo_sdk-2.0.0/src/overturo/decisions/__init__.py +46 -0
- overturo_sdk-2.0.0/src/overturo/decisions/client.py +338 -0
- overturo_sdk-2.0.0/src/overturo/errors.py +374 -0
- overturo_sdk-2.0.0/src/overturo/meetings/__init__.py +32 -0
- overturo_sdk-2.0.0/src/overturo/meetings/client.py +373 -0
- overturo_sdk-2.0.0/src/overturo/models.py +567 -0
- overturo_sdk-2.0.0/src/overturo/oversight/__init__.py +34 -0
- overturo_sdk-2.0.0/src/overturo/oversight/client.py +336 -0
- overturo_sdk-2.0.0/src/overturo/oversight/discovery.py +132 -0
- overturo_sdk-2.0.0/src/overturo/oversight/evidence_digest.py +25 -0
- overturo_sdk-2.0.0/src/overturo/oversight/heartbeat.py +71 -0
- overturo_sdk-2.0.0/src/overturo/oversight/iss_role.py +22 -0
- overturo_sdk-2.0.0/src/overturo/oversight/sequence.py +52 -0
- overturo_sdk-2.0.0/src/overturo/oversight/token.py +44 -0
- overturo_sdk-2.0.0/src/overturo/oversight/types.py +78 -0
- overturo_sdk-2.0.0/src/overturo/receipts/__init__.py +14 -0
- overturo_sdk-2.0.0/src/overturo/receipts/client.py +171 -0
- overturo_sdk-2.0.0/src/overturo/records.py +225 -0
- overturo_sdk-2.0.0/src/overturo/verify.py +429 -0
- overturo_sdk-2.0.0/tests/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/authorize/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/authorize/conftest.py +70 -0
- overturo_sdk-2.0.0/tests/authorize/test_adapter.py +38 -0
- overturo_sdk-2.0.0/tests/authorize/test_client.py +293 -0
- overturo_sdk-2.0.0/tests/authorize/test_client_authorize_escalate.py +187 -0
- overturo_sdk-2.0.0/tests/authorize/test_decision.py +182 -0
- overturo_sdk-2.0.0/tests/authorize/test_dpop.py +140 -0
- overturo_sdk-2.0.0/tests/authorize/test_errors.py +118 -0
- overturo_sdk-2.0.0/tests/authorize/test_errors_approval_required.py +91 -0
- overturo_sdk-2.0.0/tests/authorize/test_new_errors.py +50 -0
- overturo_sdk-2.0.0/tests/authorize/test_receipt.py +58 -0
- overturo_sdk-2.0.0/tests/authorize/test_record_stream.py +149 -0
- overturo_sdk-2.0.0/tests/authorize/test_shared.py +94 -0
- overturo_sdk-2.0.0/tests/authorize/test_verify.py +121 -0
- overturo_sdk-2.0.0/tests/conformance/README.md +34 -0
- overturo_sdk-2.0.0/tests/conformance/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/conformance/conftest.py +38 -0
- overturo_sdk-2.0.0/tests/conformance/test_scaffolding.py +47 -0
- overturo_sdk-2.0.0/tests/conftest.py +107 -0
- overturo_sdk-2.0.0/tests/consent_records/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/consent_records/test_client.py +110 -0
- overturo_sdk-2.0.0/tests/corpus.py +64 -0
- overturo_sdk-2.0.0/tests/decisions/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/decisions/test_decisions_module.py +331 -0
- overturo_sdk-2.0.0/tests/decisions/test_discover.py +111 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Accounts_index.json +50 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_ConsentStatuses_lookup.json +47 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_MeetingConsents_create.json +53 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_MeetingConsents_destroy.json +19 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_MeetingConsents_index.json +53 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_MeetingConsents_participants.json +54 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_MeetingConsents_show.json +47 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_MeetingConsents_update.json +51 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_Webhooks_create.json +44 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_Webhooks_destroy.json +19 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_Webhooks_index.json +37 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_Webhooks_show.json +35 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Applications_Webhooks_update.json +39 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/AuthorizationReceipts_show.json +151 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/AuthorizationReceipts_show.signed.json +158 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/CleanRooms_index.json +36 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/CleanRooms_show.json +50 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Connections_destroy.json +27 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Connections_index.json +33 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Connections_show.json +36 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Connections_suspend.json +44 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Connections_unsuspend.json +36 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/ConsentRecords_create.json +58 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/ConsentRecords_import.json +39 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/ConsentRecords_imports.json +57 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/ConsentRecords_show.json +43 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_Captures_create.json +41 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_FlowDisclosures_show.json +81 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_authorize.json +35 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_cancel.json +23 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_create.json +34 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_show.json +52 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Decisions_wait.json +25 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Delegations_create.json +50 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Delegations_index.json +43 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Delegations_revoke.json +39 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Delegations_show.json +44 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Delegations_update.json +45 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/DisclosureReceipts_create.json +120 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Me_show.json +27 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/MeetingConsents_revoke.json +44 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/MeetingConsents_status.json +45 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Oap_Authorize_create.escalate.json +50 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Oap_Authorize_create.json +40 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Oap_EscalationSettlements_show.approved.json +38 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Oap_EscalationSettlements_show.json +30 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/PreviewTokens_create.json +28 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/QuorumRequests_create.json +47 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/QuorumRequests_index.json +41 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/QuorumRequests_show.json +40 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/QuorumRequests_vote.json +49 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Vouches_create.json +39 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Vouches_destroy.json +32 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Vouches_index.json +34 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Vouches_received.json +34 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Vouches_show.404.json +26 -0
- overturo_sdk-2.0.0/tests/fixtures/api_responses/Vouches_show.json +39 -0
- overturo_sdk-2.0.0/tests/fixtures/discovery/flow_disclosures.json +119 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/authorization_record_valid.json +135 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/consent_record_escaped_text.json +81 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/consent_record_valid.json +100 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/manifest.json +60 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/manifest_pin_content.json +17 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/manifest_pin_mismatch.json +17 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/notice_record_valid.json +105 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/rotated_key_version.json +135 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/tampered_receipt.json +135 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/unknown_key_version.json +135 -0
- overturo_sdk-2.0.0/tests/fixtures/signed_records/wrong_embedded_key.json +135 -0
- overturo_sdk-2.0.0/tests/meetings/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/meetings/test_client.py +132 -0
- overturo_sdk-2.0.0/tests/oversight/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/oversight/test_canonicalize.py +45 -0
- overturo_sdk-2.0.0/tests/oversight/test_client.py +246 -0
- overturo_sdk-2.0.0/tests/oversight/test_discovery.py +85 -0
- overturo_sdk-2.0.0/tests/oversight/test_evidence_digest.py +36 -0
- overturo_sdk-2.0.0/tests/oversight/test_http.py +155 -0
- overturo_sdk-2.0.0/tests/oversight/test_iss_role.py +36 -0
- overturo_sdk-2.0.0/tests/oversight/test_logger.py +77 -0
- overturo_sdk-2.0.0/tests/oversight/test_sequence.py +58 -0
- overturo_sdk-2.0.0/tests/oversight/test_shared.py +94 -0
- overturo_sdk-2.0.0/tests/oversight/test_token.py +56 -0
- overturo_sdk-2.0.0/tests/oversight/test_verify.py +204 -0
- overturo_sdk-2.0.0/tests/receipts/__init__.py +1 -0
- overturo_sdk-2.0.0/tests/receipts/test_client.py +154 -0
- overturo_sdk-2.0.0/tests/receipts/test_roundtrip.py +48 -0
- overturo_sdk-2.0.0/tests/records/__init__.py +1 -0
- overturo_sdk-2.0.0/tests/records/test_records.py +100 -0
- overturo_sdk-2.0.0/tests/records/test_signed_record_corpus.py +85 -0
- overturo_sdk-2.0.0/tests/shared/__init__.py +0 -0
- overturo_sdk-2.0.0/tests/shared/test_errors_dispatch.py +198 -0
- overturo_sdk-2.0.0/tests/shared/test_experimental.py +82 -0
- overturo_sdk-2.0.0/tests/shared/test_public_surface.py +123 -0
- overturo_sdk-2.0.0/tests/test_corpus_loader.py +20 -0
- overturo_sdk-2.0.0/tests/test_endpoints_manifest.py +101 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Release workflow for overturo-sdk. Runs on this repository's version
|
|
2
|
+
# tag, builds the package from this tree and publishes it with the registry's
|
|
3
|
+
# short-lived trusted-publisher credential. No token is stored anywhere.
|
|
4
|
+
#
|
|
5
|
+
# First version: until the repository variable OVERTURO_PUBLISH is set, the
|
|
6
|
+
# workflow builds and keeps the artefact without publishing (a trusted publisher
|
|
7
|
+
# on npm can only be named for a package that already exists; a maintainer
|
|
8
|
+
# publishes the first version from a session, names the publisher, then sets
|
|
9
|
+
# the variable). A version the registry already serves is left alone, so a
|
|
10
|
+
# re-run is never red. This workflow never commits, tags or pushes.
|
|
11
|
+
name: Release
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
tags: ["v*"]
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
publish:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
environment: release
|
|
21
|
+
permissions:
|
|
22
|
+
contents: read
|
|
23
|
+
id-token: write
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
|
+
- name: Version from the tag
|
|
27
|
+
id: v
|
|
28
|
+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
|
|
29
|
+
- uses: actions/setup-python@v6
|
|
30
|
+
with:
|
|
31
|
+
python-version: "3.12"
|
|
32
|
+
- run: python -m pip install --upgrade pip build
|
|
33
|
+
- run: python -m build
|
|
34
|
+
- uses: actions/upload-artifact@v6
|
|
35
|
+
with:
|
|
36
|
+
name: package
|
|
37
|
+
path: dist/
|
|
38
|
+
- name: First version — not published by this run
|
|
39
|
+
if: vars.OVERTURO_PUBLISH == ''
|
|
40
|
+
run: echo "::notice::OVERTURO_PUBLISH is not set on this repository; the build is kept as a run artefact."
|
|
41
|
+
- name: Publish
|
|
42
|
+
if: vars.OVERTURO_PUBLISH != ''
|
|
43
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
44
|
+
with:
|
|
45
|
+
skip-existing: true
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## 2.0.0 (2026-10-26)
|
|
4
|
+
### Changed — public names, before the first registry publish
|
|
5
|
+
- The audit-record pointer is `record_id` everywhere (`OverturoDecision.record_id`, the receipt claim, the audit-trail entries); `chronicle_id` is gone from the wire and the models — nothing is dual-emitted.
|
|
6
|
+
- `overturo.oversight` takes `application_id` (was `touchpoint_id`) and sends it on the attestation, escalation and revocation requests.
|
|
7
|
+
- `OverturoRecordStream` (module `overturo.authorize.record_stream`) replaces `OverturoChronicleStream`.
|
|
8
|
+
### Changed
|
|
9
|
+
- Vendored corpus refreshed: `Oap_Authorize_create` (allow and `.escalate`) and `Oap_EscalationSettlements_show` (pending and `.approved`) join; the OAP recordings carry `record_id`.
|
|
10
|
+
|
|
11
|
+
## 1.2.0 (2026-10-15)
|
|
12
|
+
### Added
|
|
13
|
+
- `overturo.consent_records` — consents captured outside Overturo's surfaces (API token): `create_record` (capture and commit in one call, idempotent on your key), `commit_capture` (commit the capture token your own form received), `retrieve_record`, `import_records` (consents you already hold, up to 5000 rows per batch, with a dry run), `retrieve_import` and `status` (the per-purpose status for a subject, by email or your own identifier), each with an `_async` twin except `commit_capture`. Tests run against the recorded corpus.
|
|
14
|
+
### Changed
|
|
15
|
+
- Vendored corpus refreshed to the shared corpus 1.0.5 and the signed-record fixtures regenerated against schema `overturo-cr/2.12`; published keys unchanged.
|
|
16
|
+
|
|
17
|
+
## 1.1.0 (2026-10-10)
|
|
18
|
+
### Added
|
|
19
|
+
- `overturo.meetings` — the organisation's side of meeting consent (API token): `list_meetings`, `create_meeting`, `retrieve_meeting`, `update_meeting` (rename / reschedule), `cancel_meeting`, `list_participants` (each person's decision per purpose), each with an `_async` twin. A meeting is the unit of record: window, platform identity, cancellation, participant rows. Tests run against the recorded corpus; the module joins the strict mypy surface.
|
|
20
|
+
|
|
21
|
+
## 1.0.3 (2026-10-09)
|
|
22
|
+
### Changed
|
|
23
|
+
- Vendored discovery corpus refreshed to the shared corpus 1.0.3: the canonical flow's `care_reminders` purpose now runs on legitimate interest with the opt-out (right to object) mechanism, and its choices step is titled "Your Choices"; the discovery test follows. Tests only — the published package is unchanged.
|
|
24
|
+
|
|
25
|
+
## 1.0.2 (2026-10-09)
|
|
26
|
+
### Changed
|
|
27
|
+
- Vendored signed-record corpus refreshed to the shared corpus 1.0.2: a new `consent_record_escaped_text` case (receipt text containing `<`, `>`, `&` and U+2028), regenerated record identifiers and the `overturo-cr/2.9` schema label; published keys unchanged. Tests only — the published package is unchanged.
|
|
28
|
+
|
|
29
|
+
## 1.0.1 (2026-09-12)
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- The README links the public documentation and the rendered API reference at overturo.com/developers; the vendored API response corpus is re-recorded against the published document, whose operations now list the SDKs that reach them (`x-overturo-sdks`).
|
|
34
|
+
|
|
35
|
+
## 1.0.0 (unreleased)
|
|
36
|
+
|
|
37
|
+
Initial release. Consolidates `overturo-authorize` v1.2.0 and
|
|
38
|
+
`overturo-oversight` v0.2.0 into a single package.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Source comments, tests, the example adapter and this changelog describe behaviour only; planning references were removed.
|
|
43
|
+
- The test suite is self-contained: the signed-record corpus and the discovery fixture are vendored under `tests/fixtures/` (the shared copies are read when the package sits next to them).
|
|
44
|
+
|
|
45
|
+
### Fixed — decision envelopes (found by the recorded API corpus)
|
|
46
|
+
|
|
47
|
+
- `DecisionToken.from_response` / `DecisionStatus.from_response` read the
|
|
48
|
+
envelope the API actually sends: the token and the one-shot status arrive
|
|
49
|
+
wrapped under `decision`, the validity bound is `deadline_at`, and a pending
|
|
50
|
+
long-poll envelope carries no `session_token`. The previous parser raised
|
|
51
|
+
`KeyError` on every real response.
|
|
52
|
+
- The test suite stubs recorded operations from the shared API response corpus
|
|
53
|
+
(`tests/corpus.py`; vendored under `tests/fixtures/api_responses`); the discovery
|
|
54
|
+
test reads a vendored copy of the shared discovery fixture when the shared corpus
|
|
55
|
+
is not present.
|
|
56
|
+
|
|
57
|
+
### Added — pre-flight disclosure discovery
|
|
58
|
+
|
|
59
|
+
- **`overturo.decisions.discover(base_url, *, flow_id, publishable_key,
|
|
60
|
+
locale=None)`** — fetch what a consent flow would ask a person (purposes,
|
|
61
|
+
fields, steps, the action label, expiry, application branding) BEFORE any
|
|
62
|
+
session exists, in public vocabulary and the requested locale. The publishable
|
|
63
|
+
key is an embed-safe, per-application credential passed explicitly (this
|
|
64
|
+
endpoint ignores any bearer token). Sync, standalone (takes `base_url`, not a
|
|
65
|
+
client). An unknown / foreign / non-consent flow raises `OverturoApiError`
|
|
66
|
+
(`http_status=404`). Returns the `FlowDisclosures` TypedDict.
|
|
67
|
+
- Cross-language parity is gated by the shared corpus at
|
|
68
|
+
`lib/sdk/shared/conformance/discovery/flow_disclosures.json`.
|
|
69
|
+
|
|
70
|
+
### Added — authority records
|
|
71
|
+
|
|
72
|
+
- **`overturo.records`** — `verify_record` (durable signed-record
|
|
73
|
+
verification: overturo-jcs-1 canonical bytes, a detached signature,
|
|
74
|
+
published-key resolution by key_version, opt-in embedded-key mode),
|
|
75
|
+
`verify_manifest_pin` / `manifest_content_hash` (the
|
|
76
|
+
capability-manifest pin), and the `RecordInvalid` typed error.
|
|
77
|
+
Cross-language parity is gated by the shared corpus at
|
|
78
|
+
`lib/sdk/shared/conformance/signed_records/`.
|
|
79
|
+
- **`overturo.receipts`** — `retrieve_authorization_receipt` (the
|
|
80
|
+
durable record, `audit:verify` scope; canonical/signed/dpv flavors)
|
|
81
|
+
and `create_disclosure_receipt` (the operator-declared disclosure
|
|
82
|
+
mint, `disclosures:write` scope). Typed refusals raise
|
|
83
|
+
`OverturoValidationError` with the machine code in `reason_code`.
|
|
84
|
+
|
|
85
|
+
### Added — cross-border
|
|
86
|
+
|
|
87
|
+
- **`authorize(..., jurisdiction=...)`** — declare the action's target
|
|
88
|
+
jurisdiction (an ISO country) so the platform can enforce a jurisdiction
|
|
89
|
+
bound; mapped into the authorize context. A refusal arrives with
|
|
90
|
+
`failed_bound == "jurisdiction_bounds"` (reason code
|
|
91
|
+
`jurisdiction_not_permitted`), distinct from a transport-level refusal.
|
|
92
|
+
- **Cross-border credential verification** in `verify` — resolve a presented
|
|
93
|
+
credential against its issuer's own published key (shares the
|
|
94
|
+
`@overturo/verify` resolution; see that SDK's notes).
|
|
95
|
+
|
|
96
|
+
### Replaces
|
|
97
|
+
|
|
98
|
+
- `overturo-authorize` v1.2.0 → `overturo.authorize`
|
|
99
|
+
- `overturo-oversight` v0.2.0 → `overturo.oversight`
|
|
100
|
+
|
|
101
|
+
### Added
|
|
102
|
+
|
|
103
|
+
- `overturo.models` — single home for cross-cutting dataclasses (the earlier
|
|
104
|
+
vendored `_shared.py` is gone).
|
|
105
|
+
- `overturo.errors.OverturoError` is now the unified root for both the
|
|
106
|
+
protocol (`OapError`) and transport (`OverturoApiError`, etc.) families.
|
|
107
|
+
- `overturo.decisions` promoted from `overturo_oversight.decisions` to
|
|
108
|
+
a top-level subpackage.
|
|
109
|
+
- `@experimental` decorator marks pre-1.0 oversight surfaces
|
|
110
|
+
(`heartbeat`, `iss_role`, `sequence`).
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Overturo Geneva Association
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: overturo-sdk
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Overturo SDK — authorize, oversight, and decisions for backend integrators
|
|
5
|
+
Project-URL: Homepage, https://overturo.com/developers/docs
|
|
6
|
+
Project-URL: Repository, https://github.com/overturo/sdk-python
|
|
7
|
+
Project-URL: Issues, https://github.com/overturo/sdk-python/issues
|
|
8
|
+
Author-email: Overturo <sdk@overturo.com>
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent,agent-authorization,ai-agent,attestation,consent,decisions,oap,oversight,overturo
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Security :: Cryptography
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: cryptography>=42
|
|
23
|
+
Requires-Dist: httpx>=0.27
|
|
24
|
+
Provides-Extra: lint
|
|
25
|
+
Requires-Dist: mypy>=1.10; extra == 'lint'
|
|
26
|
+
Requires-Dist: ruff>=0.6; extra == 'lint'
|
|
27
|
+
Provides-Extra: test
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
|
|
29
|
+
Requires-Dist: pytest>=8; extra == 'test'
|
|
30
|
+
Requires-Dist: respx>=0.21; extra == 'test'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
> **Release mirror.** This repository is a read-only snapshot of
|
|
34
|
+
> `overturo-sdk` 2.0.0, published from Overturo's main
|
|
35
|
+
> development repository. Issues and pull requests are welcome here; accepted
|
|
36
|
+
> changes are ported upstream and appear in the next release snapshot.
|
|
37
|
+
> Security reports: see [SECURITY.md](./SECURITY.md).
|
|
38
|
+
|
|
39
|
+
# overturo-sdk
|
|
40
|
+
|
|
41
|
+
**Documentation:** <https://overturo.com/developers/docs> · **Agent authorization:** <https://overturo.com/developers/agent-authorization> · **API reference:** <https://overturo.com/developers/openapi>
|
|
42
|
+
|
|
43
|
+
Python SDK for [Overturo](https://overturo.com) — the trust conductor.
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
pip install overturo-sdk
|
|
48
|
+
|
|
49
|
+
The distribution is `overturo-sdk`; the import is `overturo`.
|
|
50
|
+
|
|
51
|
+
## Quickstart
|
|
52
|
+
|
|
53
|
+
from overturo import OverturoAuthorize, OverturoOversight
|
|
54
|
+
from overturo import decisions
|
|
55
|
+
from overturo.errors import OapError, OapApprovalRequired, OverturoError
|
|
56
|
+
|
|
57
|
+
Subpackages:
|
|
58
|
+
|
|
59
|
+
- `overturo.authorize` — Relying-party SDK (OAP v1.0 authorize + verify)
|
|
60
|
+
- `overturo.oversight` — Issuer / attester SDK (Oversight Mode)
|
|
61
|
+
- `overturo.decisions` — Needs-approval URL minting + long-poll subscription
|
|
62
|
+
- `overturo.receipts` — Authority record client methods (durable Authorization Receipts + disclosure mint)
|
|
63
|
+
- `overturo.consent_records` — Consent records captured outside Overturo's surfaces (create, commit a capture, read, import, status)
|
|
64
|
+
|
|
65
|
+
## Authority records
|
|
66
|
+
|
|
67
|
+
The durable **Authorization Receipt** is a different artifact from the short-lived runtime receipt `authorize()` returns — the runtime receipt's TTL bounds *honoring*, not evidence, while the durable record is the archival, offline-verifiable account of the authorization.
|
|
68
|
+
|
|
69
|
+
from overturo import verify_record
|
|
70
|
+
from overturo.receipts import retrieve_authorization_receipt, create_disclosure_receipt
|
|
71
|
+
|
|
72
|
+
# The durable record (audit:verify scope). Flavors: canonical (default), signed, dpv.
|
|
73
|
+
envelope = retrieve_authorization_receipt(
|
|
74
|
+
base_url="https://overturo.us", api_token=token, record_id="acc_...", flavor="signed"
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
# Verify offline against the region's published keys (key_version -> base64 key,
|
|
78
|
+
# e.g. reshaped from the region's key-discovery document).
|
|
79
|
+
verified = verify_record(envelope, published_keys=published_keys)
|
|
80
|
+
|
|
81
|
+
# Mint an operator-declared disclosure receipt (disclosures:write scope).
|
|
82
|
+
minted = create_disclosure_receipt(
|
|
83
|
+
base_url="https://overturo.us", api_token=token,
|
|
84
|
+
flow_id="acc_...", agent_id="agt_...", disclosed_at="2026-08-06T10:00:00Z",
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
Typed refusals raise `OverturoValidationError` carrying the machine code in `reason_code` (`unknown_flavor`, `not_signable`, `dpv_unavailable`; `agent_not_disclosed`, `invalid_disclosed_at`, `purposes_missing`). The 404 contract is parity-preserving: unknown, foreign, and non-authority ids are indistinguishable. An authorization-kind record is refused by the consent-receipts read with a typed hint — authority records are served only by these endpoints. Field semantics and verification: the Receipt Interop & Verification guide in the developer documentation.
|
|
88
|
+
|
|
89
|
+
## Consent records
|
|
90
|
+
|
|
91
|
+
Consents captured outside Overturo's surfaces — in your own form, or already held in your systems — become records with the same receipt, status and evidence as a decision taken on an Overturo surface.
|
|
92
|
+
|
|
93
|
+
from overturo import consent_records
|
|
94
|
+
|
|
95
|
+
# Capture and commit in one call — idempotent on your key.
|
|
96
|
+
envelope = consent_records.create_record(
|
|
97
|
+
base_url="https://overturo.us", api_token=token,
|
|
98
|
+
flow_id="flw_...", subject={"email": "ana@example.com", "external_id": "crm-1842"},
|
|
99
|
+
decisions={"marketing_email": {"decision": "granted"}, "analytics": {"decision": "declined"}},
|
|
100
|
+
idempotency_key="signup-1842",
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# Commit the capture token your own form received (the form-capture path of @overturo/js).
|
|
104
|
+
decision = consent_records.commit_capture(
|
|
105
|
+
base_url="https://overturo.us", api_token=token, token=capture_token, subject={"email": "ana@example.com"},
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# Import consents you already hold — up to 5000 rows per batch; dry_run reports without writing.
|
|
109
|
+
batch = consent_records.import_records(
|
|
110
|
+
base_url="https://overturo.us", api_token=token, flow_id="flw_...", records=rows, dry_run=True,
|
|
111
|
+
)
|
|
112
|
+
progress = consent_records.retrieve_import(
|
|
113
|
+
base_url="https://overturo.us", api_token=token, import_id=batch["import"]["id"]
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
# The per-purpose status for a subject, by email or your own identifier.
|
|
117
|
+
status = consent_records.status(
|
|
118
|
+
base_url="https://overturo.us", api_token=token, application_id="app_...", email="ana@example.com"
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
Every read and write except `commit_capture` has an `_async` twin.
|
|
122
|
+
|
|
123
|
+
## Contract and testing
|
|
124
|
+
|
|
125
|
+
This client is written against Overturo's published OpenAPI document, kept at
|
|
126
|
+
<https://github.com/overturo/openapi> and rendered at
|
|
127
|
+
<https://overturo.com/developers/openapi>, where each operation lists the SDKs that reach it. When the client and the API disagree, the
|
|
128
|
+
document is the authority; a change to it is a change to this client.
|
|
129
|
+
|
|
130
|
+
The test suite stubs recorded operations from the shared API response corpus
|
|
131
|
+
(<https://github.com/overturo/conformance>, `api_responses/`), vendored under
|
|
132
|
+
`tests/fixtures/api_responses`. Each recording was made against the real API and checked against
|
|
133
|
+
the published document before it was committed, so a passing suite means the
|
|
134
|
+
client parses what the API actually sends — not what a test author remembered.
|
|
135
|
+
Identifiers, timestamps and tokens in the recordings are placeholders
|
|
136
|
+
(`<PREFIX_ID:1>`, `2026-01-01T00:00:00Z`, `<TOKEN>`); the corpus README documents the
|
|
137
|
+
grammar.
|
|
138
|
+
|
|
139
|
+
Run the suite with `pytest`. When you add a test for a recorded operation, stub it
|
|
140
|
+
from the recording (`corpus_route(router, "Decisions_create", BASE)`) rather than writing the response by hand.
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
Apache-2.0
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
> **Release mirror.** This repository is a read-only snapshot of
|
|
2
|
+
> `overturo-sdk` 2.0.0, published from Overturo's main
|
|
3
|
+
> development repository. Issues and pull requests are welcome here; accepted
|
|
4
|
+
> changes are ported upstream and appear in the next release snapshot.
|
|
5
|
+
> Security reports: see [SECURITY.md](./SECURITY.md).
|
|
6
|
+
|
|
7
|
+
# overturo-sdk
|
|
8
|
+
|
|
9
|
+
**Documentation:** <https://overturo.com/developers/docs> · **Agent authorization:** <https://overturo.com/developers/agent-authorization> · **API reference:** <https://overturo.com/developers/openapi>
|
|
10
|
+
|
|
11
|
+
Python SDK for [Overturo](https://overturo.com) — the trust conductor.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
pip install overturo-sdk
|
|
16
|
+
|
|
17
|
+
The distribution is `overturo-sdk`; the import is `overturo`.
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
from overturo import OverturoAuthorize, OverturoOversight
|
|
22
|
+
from overturo import decisions
|
|
23
|
+
from overturo.errors import OapError, OapApprovalRequired, OverturoError
|
|
24
|
+
|
|
25
|
+
Subpackages:
|
|
26
|
+
|
|
27
|
+
- `overturo.authorize` — Relying-party SDK (OAP v1.0 authorize + verify)
|
|
28
|
+
- `overturo.oversight` — Issuer / attester SDK (Oversight Mode)
|
|
29
|
+
- `overturo.decisions` — Needs-approval URL minting + long-poll subscription
|
|
30
|
+
- `overturo.receipts` — Authority record client methods (durable Authorization Receipts + disclosure mint)
|
|
31
|
+
- `overturo.consent_records` — Consent records captured outside Overturo's surfaces (create, commit a capture, read, import, status)
|
|
32
|
+
|
|
33
|
+
## Authority records
|
|
34
|
+
|
|
35
|
+
The durable **Authorization Receipt** is a different artifact from the short-lived runtime receipt `authorize()` returns — the runtime receipt's TTL bounds *honoring*, not evidence, while the durable record is the archival, offline-verifiable account of the authorization.
|
|
36
|
+
|
|
37
|
+
from overturo import verify_record
|
|
38
|
+
from overturo.receipts import retrieve_authorization_receipt, create_disclosure_receipt
|
|
39
|
+
|
|
40
|
+
# The durable record (audit:verify scope). Flavors: canonical (default), signed, dpv.
|
|
41
|
+
envelope = retrieve_authorization_receipt(
|
|
42
|
+
base_url="https://overturo.us", api_token=token, record_id="acc_...", flavor="signed"
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
# Verify offline against the region's published keys (key_version -> base64 key,
|
|
46
|
+
# e.g. reshaped from the region's key-discovery document).
|
|
47
|
+
verified = verify_record(envelope, published_keys=published_keys)
|
|
48
|
+
|
|
49
|
+
# Mint an operator-declared disclosure receipt (disclosures:write scope).
|
|
50
|
+
minted = create_disclosure_receipt(
|
|
51
|
+
base_url="https://overturo.us", api_token=token,
|
|
52
|
+
flow_id="acc_...", agent_id="agt_...", disclosed_at="2026-08-06T10:00:00Z",
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
Typed refusals raise `OverturoValidationError` carrying the machine code in `reason_code` (`unknown_flavor`, `not_signable`, `dpv_unavailable`; `agent_not_disclosed`, `invalid_disclosed_at`, `purposes_missing`). The 404 contract is parity-preserving: unknown, foreign, and non-authority ids are indistinguishable. An authorization-kind record is refused by the consent-receipts read with a typed hint — authority records are served only by these endpoints. Field semantics and verification: the Receipt Interop & Verification guide in the developer documentation.
|
|
56
|
+
|
|
57
|
+
## Consent records
|
|
58
|
+
|
|
59
|
+
Consents captured outside Overturo's surfaces — in your own form, or already held in your systems — become records with the same receipt, status and evidence as a decision taken on an Overturo surface.
|
|
60
|
+
|
|
61
|
+
from overturo import consent_records
|
|
62
|
+
|
|
63
|
+
# Capture and commit in one call — idempotent on your key.
|
|
64
|
+
envelope = consent_records.create_record(
|
|
65
|
+
base_url="https://overturo.us", api_token=token,
|
|
66
|
+
flow_id="flw_...", subject={"email": "ana@example.com", "external_id": "crm-1842"},
|
|
67
|
+
decisions={"marketing_email": {"decision": "granted"}, "analytics": {"decision": "declined"}},
|
|
68
|
+
idempotency_key="signup-1842",
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Commit the capture token your own form received (the form-capture path of @overturo/js).
|
|
72
|
+
decision = consent_records.commit_capture(
|
|
73
|
+
base_url="https://overturo.us", api_token=token, token=capture_token, subject={"email": "ana@example.com"},
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Import consents you already hold — up to 5000 rows per batch; dry_run reports without writing.
|
|
77
|
+
batch = consent_records.import_records(
|
|
78
|
+
base_url="https://overturo.us", api_token=token, flow_id="flw_...", records=rows, dry_run=True,
|
|
79
|
+
)
|
|
80
|
+
progress = consent_records.retrieve_import(
|
|
81
|
+
base_url="https://overturo.us", api_token=token, import_id=batch["import"]["id"]
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
# The per-purpose status for a subject, by email or your own identifier.
|
|
85
|
+
status = consent_records.status(
|
|
86
|
+
base_url="https://overturo.us", api_token=token, application_id="app_...", email="ana@example.com"
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
Every read and write except `commit_capture` has an `_async` twin.
|
|
90
|
+
|
|
91
|
+
## Contract and testing
|
|
92
|
+
|
|
93
|
+
This client is written against Overturo's published OpenAPI document, kept at
|
|
94
|
+
<https://github.com/overturo/openapi> and rendered at
|
|
95
|
+
<https://overturo.com/developers/openapi>, where each operation lists the SDKs that reach it. When the client and the API disagree, the
|
|
96
|
+
document is the authority; a change to it is a change to this client.
|
|
97
|
+
|
|
98
|
+
The test suite stubs recorded operations from the shared API response corpus
|
|
99
|
+
(<https://github.com/overturo/conformance>, `api_responses/`), vendored under
|
|
100
|
+
`tests/fixtures/api_responses`. Each recording was made against the real API and checked against
|
|
101
|
+
the published document before it was committed, so a passing suite means the
|
|
102
|
+
client parses what the API actually sends — not what a test author remembered.
|
|
103
|
+
Identifiers, timestamps and tokens in the recordings are placeholders
|
|
104
|
+
(`<PREFIX_ID:1>`, `2026-01-01T00:00:00Z`, `<TOKEN>`); the corpus README documents the
|
|
105
|
+
grammar.
|
|
106
|
+
|
|
107
|
+
Run the suite with `pytest`. When you add a test for a recorded operation, stub it
|
|
108
|
+
from the recording (`corpus_route(router, "Decisions_create", BASE)`) rather than writing the response by hand.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
Apache-2.0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported version
|
|
4
|
+
|
|
5
|
+
The latest release snapshot in this repository (2.0.0) is supported.
|
|
6
|
+
Older snapshots receive no fixes; upgrade to the latest release.
|
|
7
|
+
|
|
8
|
+
## Reporting a vulnerability
|
|
9
|
+
|
|
10
|
+
Email **security@overturo.com**. Do not open a public issue for a security
|
|
11
|
+
report. You will receive an acknowledgement within two working days and a
|
|
12
|
+
resolution plan once the report is confirmed.
|
|
13
|
+
|
|
14
|
+
Issues that are not security-sensitive go to https://github.com/overturo/sdk-python/issues.
|