Skip to main content

Syncanix intent verification SDK for Python (Django, Flask, FastAPI)

Project description

syncanix-sdk

Python intent verification SDK for Syncanix (Django, Flask, FastAPI).

Install: pip install syncanix-sdk[django] or [flask] or [fastapi].

See the Syncanix docs for usage.

v2 (act-as-user) binds

The per-route helpers — syncanix_verify_intent (Flask/Django) and require_syncanix_intent (FastAPI) — accept optional keyword args to enforce the v2 argsHash / audience / single-use-nonce binds (omit them and only the v1 coordinate is checked, unchanged):

@syncanix_verify_intent(
    secret=SECRET,
    # CANONICAL args — NOT the raw body. Reconstruct from every source
    # (ADR-0138): REST → {**view_args, **query, **body}; GraphQL → variables.
    get_args=lambda request: canonical_args(request),
    expected_audience="syncanix:tenant:<tenantId>",  # or omit to skip
    nonce_store=InMemoryNonceStore(),                 # or omit to skip
)
def refund(request): ...

Each bind is opt-in. Replay protection needs a nonce_store (InMemoryNonceStore is single-instance only — use a shared store for a horizontally scaled API). The v2 sub is surfaced on the verified payload's .sub. Passing the bare request body as get_args would falsely reject path-param / GET / GraphQL calls — reconstruct the canonical args.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

syncanix_sdk-0.1.0.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

syncanix_sdk-0.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file syncanix_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: syncanix_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for syncanix_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a326445727d48e21c94a8914d2e702797673b30e5ec7d987c2feaf8f1173f574
MD5 6dfd7be8dea4d779b385d181dd041f36
BLAKE2b-256 be2011015072f6baedc84ebb08ac5a08141e62bd240d169897227bce8a87d177

See more details on using hashes here.

File details

Details for the file syncanix_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: syncanix_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for syncanix_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 732d581b8a9cd3fa895a308953cd4c9ee1d4f7c05e261276ea79bf36f965ce4d
MD5 df1671b317cbda2ea059fd659cc309e3
BLAKE2b-256 fd1344d94a311c821eea8a716d9766a7999413f4f3fd1bf21c0a8a66674d4029

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page