Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

stwrd

Python SDK for stwrd: server-side login (ASGI/FastAPI), verify_token, mcp.protect and a generated management client.

pip install stwrd

Python 3.11 or newer.

Management client

Async client for the Management API, authenticated with an API key (<client_id>.<secret>). It reads STWRD_API_KEY and STWRD_ISSUER from the environment by default and fails closed when they are missing or malformed.

from stwrd.management import ConflictError, create_management

async with create_management() as mgmt:
    # Resources with an ETag return WithEtag(data=..., etag=...).
    res = await mgmt.users.get("usr_123")
    print(res.data["email"])

    # Optimistic concurrency: pass the ETag you read. A change in between raises ConflictError (412).
    try:
        await mgmt.users.update("usr_123", {"locale": "es"}, if_match=res.etag)
    except ConflictError:
        ...  # re-read and decide again

    # Without if_match the write has no condition: the last write wins.
    await mgmt.users.update("usr_123", {"locale": "es"})

    # Lists are paginated; async for walks every page.
    async for user in mgmt.users.list(limit=50):
        print(user["id"])
  • get on agents, API keys, applications, managed key grants, organizations, the tenant, users and webhook endpoints returns WithEtag. etag is "" if the server sent none. Everything else returns the body directly.
  • The client never reads the ETag by itself: if_match is sent only when you pass it.
  • Errors derive from StwrdApiError (status, code, request_id, details): ConflictError (412), UserExistsError and LimitExceededError (409). A bad configuration raises ManagementConfigError.
  • Retries (up to 3, growing wait, honors Retry-After; on 429, 502, 503, 504 and network errors): reads, deletes and POST (the Idempotency-Key is added automatically and reused) are retried. An unconditional PATCH/PUT (no if_match, or *) is retried only if the request was never sent.
  • An API key gets 403 step_up_required on routes that need a recent second factor (webhooks, mail provider, secrets, administrators, signing keys, key management, deleting applications, users or the tenant). Do those from the dashboard.

See https://stwrd.id for documentation.

License

MIT

Metadata

Release files for stwrd 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for stwrd 0.2.0
File Size Uploaded Provenance Actions
stwrd-0.2.0.tar.gz 70.8 kB Without provenance Details for stwrd-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stwrd 0.2.0
File Interpreter ABI Platform Actions
stwrd-0.2.0-py3-none-any.whl Python 3 none any Details for stwrd-0.2.0-py3-none-any.whl

Total release size: 158.9 kB

Release files / stwrd-0.2.0.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stwrd-0.2.0.tar.gz
Size 70.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ced1c94c35cfb3d0cc1318aead76b96ad5dfc58cbc5347f47411b4baca4338d9
BLAKE2b-256 checksum
How to use checksums
769dc420e27cffddf72ffdbf4f4c1457d94ad3c42dce2b481f07a7607e97b9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / stwrd-0.2.0-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stwrd-0.2.0-py3-none-any.whl
Size 88.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7882218eb69b662347519a3a83b447208ee14e9a76bb01e43a00dfed4db4189d
BLAKE2b-256 checksum
How to use checksums
f138896f6b2bb9ad44a1bf12b1532d4b29780a157435f2315a0fa38cc8d73d40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for stwrd 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.1.1 2 files With provenance
  • Added 0.2.0 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Loss of provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page