Metadata-Version: 2.4
Name: oneaddress-partner-sdk
Version: 1.3.0
Summary: Official OneAddress partner integration SDK for Python — webhook verification, address decryption
License: Apache-2.0
Keywords: oneaddress,address,partner,webhook,sdk
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptography>=48.0.1
Provides-Extra: pq
Requires-Dist: kyber-py>=1.2; extra == "pq"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
Requires-Dist: kyber-py>=1.2; extra == "dev"
Dynamic: license-file

# oneaddress-partner-sdk — Python

Official Python SDK for OneAddress partner webhook integrations.

## Installation

> **Not yet on PyPI.** This SDK is complete and validated against the canonical
> protocol test vectors, but it has not been published to a public registry yet — the command
> below will not resolve today. To use it now, ask **partners@oneaddress.io** for a build, or
> implement the protocol directly from
> [the protocol specification](https://partners.oneaddress.io), which is published in the Docs tab of the partner portal once you have signed up,
> which is written to be implementable without any OneAddress code. We will update this section
> when the package is published.

```bash
pip install oneaddress-partner-sdk
```

Requires Python 3.9+ and the [`cryptography`](https://cryptography.io) package (installed automatically).

## Quick start

```python
import os
from oneaddress import create_handler

def handle_update(event):
    # event.customer.email is ALWAYS empty on a dispatch: OneAddress never
    # learns a consumer's email for a partner it is not sent to. Match on
    # account_number and/or name, and never print the decrypted address.
    account = event.customer.account_number
    if not account:
        raise RuntimeError("dispatch carried no account number to match on")
    db.update_address(account, event.address)
    # Then close the loop: call /api/confirm with the dispatch id. The
    # return value of this function does not reach OneAddress on its own.

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"].replace("\\n", "\n"),
    on_update=handle_update,
)

# Call handler(raw_body, headers) in your framework route:
# response = handler(raw_body, dict(request.headers))
# response.status_code, response.body, response.headers
```

### FastAPI example

```python
from fastapi import FastAPI, Request, Response
from oneaddress import create_handler
import os

app = FastAPI()

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"].replace("\\n", "\n"),
    on_update=lambda event: db.update_address(event.address),
    on_verify=lambda event: db.confirm_address(event.address),
)

@app.post("/webhook/oneaddress")
async def webhook(request: Request):
    raw_body = (await request.body()).decode()
    result = handler(raw_body, dict(request.headers))
    return Response(
        content=result.body,
        status_code=result.status_code,
        headers=result.headers,
    )
```

### Flask example

```python
from flask import Flask, request, Response
from oneaddress import create_handler
import os

app = Flask(__name__)

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"].replace("\\n", "\n"),
    on_update=lambda event: db.update_address(event.address),
)

@app.route("/webhook/oneaddress", methods=["POST"])
def webhook():
    result = handler(request.get_data(as_text=True), dict(request.headers))
    return Response(result.body, status=result.status_code, headers=result.headers)
```

### AWS Lambda example

```python
from oneaddress import create_handler
import os

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"].replace("\\n", "\n"),
    on_update=lambda event: print(f"New address: {event.address}"),
)

def lambda_handler(event, context):
    result = handler(event["body"], event.get("headers", {}))
    return {
        "statusCode": result.status_code,
        "headers": result.headers,
        "body": result.body,
    }
```

## Webhook secret rotation

**Rotate with an overlap.** Staging a new secret in the Partner Portal does
**not** change what we sign with: we keep using your current secret until you
press *Switch over*. So the safe sequence is stage, deploy the new secret
alongside the current one, verify with both, then switch. At every point the
secret we sign with is one your receiver already holds.

Pass both for the whole overlap, and for 24 hours after switching -- the old
secret stays valid for the callbacks you send us during that window:

```python
import os
from oneaddress import create_handler

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"].replace("\\n", "\n"),
    on_update=handle_update,
    previous_webhook_secret=os.environ.get("OA_PREVIOUS_WEBHOOK_SECRET"),
    webhook_secret_grace_until=os.environ.get("OA_SECRET_GRACE_UNTIL"),  # ISO-8601 or Unix ms
)
```

## API reference

### `create_handler(webhook_secret, private_key_pem, on_update, *, on_verify=None, on_account_verify=None, loa_public_key_pem=None, previous_webhook_secret=None, webhook_secret_grace_until=None, timestamp_tolerance_secs=300, idempotency_store=None, key_id=None, accepted_update_types=None, on_test=None)`

Create a framework-agnostic handler callable.

| Parameter | Type | Description |
|-----------|------|-------------|
| `webhook_secret` | `str` | HMAC-SHA256 secret from the Partner Portal |
| `private_key_pem` | `str` | PKCS#8 PEM (or raw PKCS#8 base64) ECDH P-256 private key |
| `on_update` | `Callable[[OneAddressEvent], dict \| None]` | Called for `address.updated` and `contact.updated` events. Read `event.update_types` for what the update carries |
| `on_verify` | `Callable[[OneAddressEvent], dict \| None] \| None` | Called for `address.verify` events (optional) |
| `on_account_verify` | `Callable[[OneAddressAccountVerifyEvent], dict \| None] \| None` | Called for pre-payment `account.verify` events (optional) |
| `loa_public_key_pem` | `str \| None` | OneAddress's ECDSA P-256 LOA signing public key (SPKI PEM). When set, D5 `address.updated` dispatches decrypt + **verify** the signed LOA and are rejected (500) on an invalid signature. When unset, the decrypted LOA is still exposed as `event.loa` / `event.loa_ref` for you to verify (optional) |
| `previous_webhook_secret` | `str \| None` | Previous secret during rotation grace window |
| `webhook_secret_grace_until` | `str \| int \| float \| None` | ISO-8601 or Unix timestamp until previous secret is accepted |
| `timestamp_tolerance_secs` | `int` | Replay-window tolerance in seconds (default 300) |
| `idempotency_store` | object with `has(id)`/`set(id)` `\| None` | Dedup store for retried deliveries (optional) |
| `accepted_update_types` | `Sequence[str] \| None` | The kinds this receiver's CODE can handle: `"address"`, `"phone"`, `"email"`. Default address-only. See "Phone and email updates" below |
| `on_test` | `Callable[[OneAddressTestEvent], Any] \| None` | Called for `address.test` / `address.test-dispatch` records. **Required to pass the portal's connection check.** See "Connection verification" below |

Returns a callable `handler(raw_body: str, headers: dict) -> WebhookResponse`.

## Phone and email updates

A OneAddress dispatch can carry a new postal address, a new telephone number or
a new email address, alone or together. Two things decide what you receive:
CONSENT, ticked by a person in the partner portal, and CAPABILITY, declared by
this code with `accepted_update_types`. A kind is dispatched to you only where
both hold, and the conformance run ties them together: it reads your
declaration off your first acknowledgement, sends a real contact-only envelope
for every kind you declared, sends one kind you did NOT declare and requires a
refusal, and fails when the portal promises a kind this code has not declared.

```python
handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"],
    accepted_update_types=["address", "phone", "email"],
    on_update=handle_update,
)

def handle_update(event):
    account = event.customer.account_number if event.customer else None
    if not account:
        raise ValueError("Dispatch carried no account number to match on")
    # `update_types` says what is inside; read it rather than probing fields.
    # A phone-only change arrives as ["phone"] with NO address at all.
    if event.concerns("address"):
        db.update_address(account, event.address)
    if event.concerns("phone"):
        db.update_phone(account, event.new_phone)     # E.164
    if event.concerns("email"):
        db.update_email(account, event.new_email)     # lowercased
```

What the handler guarantees:

| Situation | Response | `on_update` |
|---|---|---|
| Every kind in the envelope is declared | `200 {"ok": true, "accepted_update_types": [...]}` | runs |
| A kind you did not declare | `422 update_type_not_accepted` | never runs |
| A kind name this SDK build does not know | `422 invalid_update_types` | never runs |
| `contact.updated` without a session envelope | `400 missing_session_envelope` | never runs |

- A dispatch carrying an address is `address.updated` exactly as before, whether
  or not a contact detail rides beside it. One carrying no address is
  `contact.updated`. Both reach the same `on_update`; route on
  `event.update_types`, not on the event name.
- On a contact-only update `event.address` is an `OneAddressAddress` of empty
  strings. Use `event.concerns("address")` rather than testing the fields.
- `update_types` is literal: `["phone"]` means the phone number changed and
  nothing else. It is never widened to include `"address"`.
- Refusal is deliberate. Acknowledging a kind you cannot store would look
  identical to success on both sides while the consumer has already paid. The
  422 leaves the dispatch unmarked in your `idempotency_store`, so once you
  widen `accepted_update_types` OneAddress's retry is processed rather than
  dismissed as a duplicate.
- `accepted_update_types` rides every authenticated 2xx. It is never included
  in a 401, so an unsigned caller learns nothing about your receiver.

## D5 — session-envelope decryption

Under the current dispatch model each `address.updated` webhook carries a per-partner
`session_envelope` (AES-256-GCM ciphertext of the new address + account number + IDV ref) plus a
structured `session_key_share` block — an ECDH-ES wrap of the session key under your registered key,
identified by a stable `key_id`. Decrypt it with `decrypt_session`:

```python
from oneaddress import decrypt_session

body = request.json
private_key = key_store[body["session_key_share"]["key_id"]]  # look up by key_id

data = decrypt_session(
    body["session_key_share"],
    body["session_envelope"],
    private_key,
    body["partner_id"],          # bound into the HKDF info string
)

print(data.new_address["street"], data.account_number, data.verified_name)
print(data.known_names)          # alias list for record-matching
```

A webhook carries **either** the legacy `address_encrypted` shape **or** the D5 shape — never both.
Detect with `if body.get("session_envelope"): ...` else fall back to `decrypt_address`.

`create_handler` does this for you: on a D5 `address.updated` dispatch it decrypts the envelope and
populates `event.address` **and** `event.customer` (name / `known_names` / `account_number`) from the
recovered `SessionData` — there is **no cleartext `customer` block on the wire** for `address.updated`
any more. (`address.verify` and `account.verify` carry no cleartext `customer` block either — as of
2026.2, identity travels encrypted inside `address_encrypted` / `customer_encrypted`; decrypt to read it.)

### D5 Letter of Authority (encrypted consent)

Consent for an `address.updated` dispatch no longer travels as a cleartext `letter_of_authority`.
Instead a D5 dispatch carries `loa_encrypted` — a `{ session_envelope, session_key_share }` object
wrapped to the **same `key_id`** as the address envelope (one private key decrypts both). It recovers a
structured, signed `OneAddressD5LOA`.

`create_handler` decrypts it automatically: `event.loa` is the decrypted `OneAddressD5LOA` and
`event.loa_ref` is a non-PII `base64url(SHA-256(canonical form))`. **Echo `event.loa_ref` in your
`/api/confirm` callback's `loa_ref` field** so OneAddress can confirm you decrypted a valid signed
consent.

```python
from oneaddress import verify_d5_loa  # optional manual verification

def handle_update(event):
    db.update_address(event.customer.account_number, event.address)
    # If you did not pass loa_public_key_pem to create_handler, verify yourself:
    # assert verify_d5_loa(event.loa, LOA_PUBLIC_KEY_PEM)
    return {"status": "updated", "loa_ref": event.loa_ref}   # <- echo the ref
```

Pass `loa_public_key_pem=` to `create_handler` to have the handler verify the ECDSA-P256 signature for
you and reject (HTTP 500) any dispatch whose consent proof doesn't verify. Fetch the public key from
`https://oneaddress.io/.well-known/oneaddress-loa-key.pem` and cache it.

Standalone LOA helpers (all snake_case):

| Function | Description |
|----------|-------------|
| `canonical_d5_loa_form(loa) -> str` | Pipe-joined signed form: `consumer_name\|authorisation_date\|scope\|update_uid\|oneaddress_acn` |
| `d5_loa_ref(loa) -> str` | `base64url(SHA-256(canonical form))`, no padding — the value to echo in `/api/confirm` |
| `verify_d5_loa(loa, public_key_pem) -> bool` | ECDSA P-256 verify of `oneaddress_signature` (hex, IEEE-P1363) over the canonical form. `False` for HMAC-SHA256 |
| `decrypt_loa_encrypted(loa_encrypted, private_key_pem, partner_id) -> OneAddressD5LOA` | Decrypt a `loa_encrypted` block via the session machinery |

### Keeping the private key in a KMS or HSM

Anywhere this SDK takes `private_key_pem` for a session envelope (`decrypt_session`,
`decrypt_loa_encrypted`, `create_handler`), it also accepts a `PrivateKeyOperations` delegate. The
delegate performs only the one step that needs the private key, so the key never enters your
process; the HKDF, the AES-GCM unwrap of the session key and the envelope decrypt stay in the SDK,
unchanged. The LOA is wrapped to the same key, so the same delegate opens it too.

A delegate has a `name` (used only in error messages) and whichever of these operations your key
source offers:

| Operation | Wrap algorithm | Returns |
|-----------|----------------|---------|
| `derive_shared_secret(epk_spki: bytes) -> bytes` | `ECDH-ES+HKDF-SHA256+A256GCM` | Raw P-256 ECDH shared secret (X coordinate, 32 bytes, no KDF) |
| `decrypt_rsa_oaep(wrapped_key: bytes) -> bytes` | `RSA-OAEP-256+A256GCM` | The session key itself (RSA-OAEP, SHA-256, MGF1-SHA-256) |
| `decapsulate_xwing(kem_ciphertext: bytes) -> bytes` | `MLKEM768X25519+HKDF-SHA256+A256GCM` | Raw 32-byte X-Wing shared secret (no KDF) |

**RSA is the strongest:** the unwrap happens inside the KMS and only the session key comes back.
With ECDH and X-Wing the key still never leaves the KMS, but a per-dispatch shared secret does,
which opens that one dispatch and nothing else. AWS KMS offers ECDH and RSA; Google Cloud KMS
offers RSA and X-Wing; Azure Key Vault and HashiCorp Vault Transit offer RSA.

A share whose algorithm needs an operation your delegate lacks is refused by name before anything
is called, and a shared secret that is not exactly 32 bytes is refused rather than failing later as
a wrong-key error. The legacy `address_encrypted` and `customer_encrypted` blobs still need the raw
key and are refused by name when the handler holds a delegate.

```python
import boto3
from oneaddress import create_handler

class AwsKmsKey:
    name = "aws-kms:partner-key"

    def __init__(self, key_id: str):
        self._kms = boto3.client("kms")
        self._key_id = key_id

    def derive_shared_secret(self, epk_spki: bytes) -> bytes:
        return self._kms.derive_shared_secret(
            KeyId=self._key_id, KeyAgreementAlgorithm="ECDH", PublicKey=epk_spki,
        )["SharedSecret"]

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=AwsKmsKey(os.environ["OA_KMS_KEY_ID"]),
    on_update=handle_update,
)
```

Implementations must not log, cache or persist anything they return.

## Account verification (pre-payment, guest flow)

OneAddress runs an optional pre-payment existence check during guest checkout. The payload carries
**no encrypted address** — just a cleartext customer block (name + `known_names` + `account_number`) —
and the consumer is waiting, so reply synchronously. Partners that don't supply `on_account_verify`
are silently skipped.

```python
def on_account_verify(event):
    c = event.customer  # email, name, known_names, account_number
    row = db.find_customer(account_number=c.account_number)
    if not row:
        return {"status": "no_account"}
    names = [c.name, *(c.known_names or [])]
    ok = any(row.full_name.lower() == n.lower() for n in names)
    return {"status": "match" if ok else "no_match"}

handler = create_handler(
    webhook_secret=os.environ["OA_WEBHOOK_SECRET"],
    private_key_pem=os.environ["OA_PRIVATE_KEY_PEM"],
    on_update=handle_update,
    on_account_verify=on_account_verify,
)
```

Return `{"status": "match" | "no_match" | "no_account"}`. The result is informational only — the
consumer can correct a mistyped account number but is never blocked from paying.

## Connection verification (`address.test`, `address.test-dispatch`)

Before you go live, OneAddress sends five `address.test` records, and the admin stress test sends
`address.test-dispatch`. Each is a real signed D5 dispatch (session envelope + key share) carrying
**fabricated** data plus `index`, `total` and `verification_id`. With `on_test` supplied, the handler
checks the signature and replay window, decrypts the envelope exactly like a real dispatch (a KMS
delegate works too), passes a `OneAddressTestEvent` to `on_test` and **never** to `on_update`, then
replies:

```json
{"ok": true, "test": true, "verification": true, "index": 3}
```

The portal counts a probe as decrypted only when the reply carries `verification: true`, and that is
sent only after a successful decrypt; a decrypt failure is a 500, as for a real dispatch. **Without
`on_test`, test records are acknowledged `{"ok": true, "skipped": true}` with a warning, and your
receiver reads as "decrypted 0 of 5".** Never write the test record to a customer record.

```python
handler = create_handler(..., on_test=lambda t: log.info("test %s/%s decrypted", t.index, t.total))
```

### `WebhookResponse`

Dataclass returned by the handler callable.

| Field | Type | Description |
|-------|------|-------------|
| `status_code` | `int` | HTTP status code (200, 400, 401, 500) |
| `body` | `str` | JSON-encoded response body |
| `headers` | `dict[str, str]` | Response headers (always includes `Content-Type: application/json`) |

`.json()` — decode `body` as a Python dict.

### `OneAddressEvent`

Passed to `on_update` and `on_verify` callbacks.

| Field | Type | Description |
|-------|------|-------------|
| `event` | `str` | Event type: `"address.updated"`, `"contact.updated"` or `"address.verify"` |
| `version` | `str` | Protocol version (e.g. `"2026.1"`) |
| `id` | `str` | Event UUID |
| `timestamp` | `int` | Unix timestamp from `X-OneAddress-Timestamp` header |
| `partner_id` | `str` | Your partner UUID |
| `dispatch_id` | `str` | Unique dispatch ID — use for idempotency |
| `customer` | `OneAddressCustomer \| None` | Customer info. On D5 `address.updated`, derived from the decrypted envelope (name / known_names / account_number; `email` is `""`) — never a cleartext wire block |
| `address` | `OneAddressAddress` | Decrypted address |
| `raw` | `dict` | Raw decrypted payload (includes optional fields) |
| `loa` | `OneAddressD5LOA \| dict \| None` | Letter of Authority. On D5 `address.updated` this is the decrypted, structured `OneAddressD5LOA` (from `loa_encrypted`); on legacy dispatches, the freeform `loa` dict (optional) |
| `loa_ref` | `str \| None` | D5 only — `base64url(SHA-256(canonical LOA form))`. **Echo this in your `/api/confirm` callback's `loa_ref` field** (optional) |
| `id_verification` | `dict \| None` | IDV attestation block — `verification_ref`, `method`, `verified_at`, … (optional) |

### `OneAddressAddress`

| Field | Type | Description |
|-------|------|-------------|
| `street` | `str` | Street address |
| `suburb` | `str` | Suburb / city |
| `state` | `str` | State abbreviation (e.g. `"NSW"`) |
| `postcode` | `str` | Postcode |
| `country` | `str` | ISO country code (e.g. `"AU"`) |
| `full_name` | `str \| None` | Consumer's full name (optional) |
| `preferred_name` | `str \| None` | Preferred name (optional) |
| `known_names` | `list \| None` | All known names (optional) |
| `account_reference` | `str \| None` | Your customer/account reference (optional) |
| `address_type` | `str \| None` | `"residential"`, `"postal"`, or `"both"` (optional) |

### `OneAddressD5LOA`

Decrypted from `loa_encrypted` on a D5 `address.updated` dispatch.

| Field | Type | Description |
|-------|------|-------------|
| `consumer_name` | `str` | Consumer-provided name (identity is separately verified via IDV) |
| `authorisation_date` | `str` | ISO 8601 UTC authorisation timestamp |
| `scope` | `str` | Authorisation scope string |
| `update_uid` | `str` | Cross-reference to the parent update event |
| `oneaddress_acn` | `str` | OneAddress ACN |
| `oneaddress_signature` | `str` | Signature over the canonical form (hex; IEEE-P1363 for ECDSA-P256) |
| `signature_algorithm` | `str` | `"ECDSA-P256"` (verifiable) or `"HMAC-SHA256"` (deprecated) |
| `raw` | `dict` | The exact decrypted JSON object |

### Standalone utilities

```python
from oneaddress import (
    verify_signature, verify_with_grace, is_fresh_timestamp,
    decrypt_address, decrypt_session, validate_address, compare_addresses,
    canonical_d5_loa_form, d5_loa_ref, verify_d5_loa, decrypt_loa_encrypted,
)
```

#### `verify_signature(raw_body, signature, timestamp, secret) -> bool`

Verify an HMAC-SHA256 webhook signature. Signs `f"{timestamp}.{raw_body}"`.
Uses `hmac.compare_digest` for timing-safe comparison.

#### `verify_with_grace(raw_body, timestamp, signature, current_secret, previous_secret=None, grace_until=None) -> bool`

Verify with grace-window fallback for secret rotations.

#### `is_fresh_timestamp(timestamp, tolerance_secs=300) -> bool`

Return `True` if the timestamp string is a valid Unix timestamp within
`tolerance_secs` seconds of now.

#### `decrypt_address(payload, private_key_pem, partner_id) -> dict`

Decrypt an ECDH P-256 + HKDF-SHA256 + AES-256-GCM encrypted address payload (legacy `address_encrypted`).

#### `decrypt_session(share, envelope_b64, private_key_pem, partner_id) -> OneAddressSessionData`

`private_key_pem` may be a `PrivateKeyOperations` delegate (see *Keeping the private key in a KMS or HSM*).

Decrypt a D5 session envelope (current dispatch model). Returns a dataclass with `verified_name`,
`new_address`, `account_number`, `id_verification_ref`, `known_names`, and the full `raw` dict.

#### `validate_address(raw) -> dict`

Raise `ValueError` unless `raw` carries non-empty `street`, `suburb`, `state`, `postcode`, `country`.

#### `compare_addresses(a, b) -> bool`

Conservative address match — expands AU street-suffix abbreviations (St→Street …), case-folds
suburb/state, left-pads postcode to 4 digits, treats country as optional. Use it to set the
`address_match` field on a verify-result callback.

## Idempotency

Deduplicate on `(partner_id, dispatch_id)` — the same address update may be
retried if your endpoint returns a non-2xx status, or answers after our
10-second timeout. Up to 28 attempts over 48 hours; keep the dedup record at
least that long.

**The `idempotency_store` this SDK accepts is a `has(id)` / `set(id)` pair,
and that pair has no atomic claim.** Two retries arriving at the same moment
both observe "not seen" and both apply the update. This is documented rather
than fixed here; the TypeScript SDK's `claim` / `complete` shape closes the
window with a single `INSERT ... ON CONFLICT DO NOTHING`. If concurrent
retries matter to you, make the database write itself idempotent (an upsert
keyed on the dispatch id), which is safe regardless of the store:

```python
def handle_update(event):
    if db.already_processed(event.partner_id, event.dispatch_id):
        return  # idempotent — already handled
    db.upsert_address(event.address)
    db.mark_processed(event.partner_id, event.dispatch_id)
```

## Conformance testing

```bash
npx @oneaddress/conformance test https://my-api.example.com/webhook/oneaddress
```

## Security

- Private keys never leave your server
- Timestamp replay window enforced **before** signature check
- Timing-safe HMAC comparison via `hmac.compare_digest`
- Decryption errors return HTTP 200 (not 500) to prevent retry storms — check
  your server logs if address data is missing

## Migrating from `oneaddress` (legacy python-sdk)

The legacy `oneaddress` package has been superseded by `oneaddress-partner-sdk`.
Key differences:

| Legacy (`oneaddress`) | This package (`oneaddress-partner-sdk`) |
|---|---|
| `handler.handle(body, headers)` returns `(int, dict)` | `handler(body, headers)` returns `WebhookResponse` |
| `on_verify` passed to `create_handler` | `on_verify` passed as keyword arg |
| No `dispatch_id` on event | `event.dispatch_id` available |
| `event.address.street` etc. | Same |

```python
# Before (legacy)
status, body = handler.handle(raw_body, headers)

# After
result = handler(raw_body, headers)
status, body = result.status_code, result.json()
```

## Licence

Apache License 2.0. See [LICENSE](./LICENSE).

Apache-2.0 rather than MIT deliberately: it carries an **express patent grant**,
bounded to this package. OneAddress holds a pending patent application over the
address-change notification architecture, and this SDK is the recipient half of
it. Partners using it is the entire point, so an explicit, bounded grant is
clearer for you than MIT's silence on patents.
