From 81a84ef20fa2c084c0d624542edfa23d7a17a1a3 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Tue, 17 Nov 2026 12:02:26 -0500 Subject: [PATCH 01/12] feat(keycardai-oauth): get resource tokens from the local Keycard agent AgentTokenSource asks the local Keycard agent for an access token for a named resource over the agent's IssueToken procedure, a Connect unary call spoken as JSON over a Unix socket, so an application running beside the Keycard CLI holds no application credential. It implements specs/delegated-access/local-agent-token-source.md from keycard-sdk-spec (21b11f0). The socket is the socket option, else KEYCARD_SOCKET, else the keycard agent daemon's default socket, resolved from the environment the way the CLI resolves it (KEYCARD_AGENT_DIR, XDG_RUNTIME_DIR, XDG_STATE_HOME, KEYCARD_HOME, HOME), never from keycard.toml and without touching disk. Resolution runs on every call. An unreachable socket raises NetworkError naming the path and the rule that chose it, and suggests `keycard agent start` or `keycard run` when the default was used. Refusals raise AgentError, an OAuthError carrying the Connect code, with is_declined, is_rate_limited, is_prompter_unavailable, is_authorization_required, is_application_not_found and is_unavailable following the cause chain. An unusable 200 response raises AgentResponseError, which never includes the token. ResourceAuth is the resource transport, an httpx.Auth for httpx.AsyncClient that refuses a synchronous client rather than sending the request unauthenticated. The SDK does not cache tokens; the agent does (keycardlabs/cli#1343), so every call is one request to it. Tests cover the spec's non-caching unit rows and the SDK-observable part of its integration rows against a fake agent, a Starlette app under uvicorn on a real Unix socket. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/README.md | 77 +- .../agent_token_source/.python-version | 1 + .../examples/agent_token_source/README.md | 51 ++ .../oauth/examples/agent_token_source/main.py | 96 +++ .../agent_token_source/pyproject.toml | 13 + .../oauth/examples/agent_token_source/uv.lock | 561 +++++++++++++++ packages/oauth/pyproject.toml | 2 + .../oauth/src/keycardai/oauth/__init__.py | 29 + packages/oauth/src/keycardai/oauth/agent.py | 493 +++++++++++++ .../oauth/tests/keycardai/oauth/conftest.py | 112 +++ .../oauth/tests/keycardai/oauth/test_agent.py | 669 ++++++++++++++++++ .../keycardai/oauth/test_agent_integration.py | 223 ++++++ packages/oauth/tests/test_examples.py | 7 + uv.lock | 4 + 14 files changed, 2337 insertions(+), 1 deletion(-) create mode 100644 packages/oauth/examples/agent_token_source/.python-version create mode 100644 packages/oauth/examples/agent_token_source/README.md create mode 100644 packages/oauth/examples/agent_token_source/main.py create mode 100644 packages/oauth/examples/agent_token_source/pyproject.toml create mode 100644 packages/oauth/examples/agent_token_source/uv.lock create mode 100644 packages/oauth/src/keycardai/oauth/agent.py create mode 100644 packages/oauth/tests/keycardai/oauth/conftest.py create mode 100644 packages/oauth/tests/keycardai/oauth/test_agent.py create mode 100644 packages/oauth/tests/keycardai/oauth/test_agent_integration.py diff --git a/packages/oauth/README.md b/packages/oauth/README.md index f0406a42..d43ee30f 100644 --- a/packages/oauth/README.md +++ b/packages/oauth/README.md @@ -523,6 +523,75 @@ If the server's metadata has no `userinfo_endpoint`, `userinfo()` raises `ConfigError` without making a request. An expired or revoked token raises `InvalidTokenError`. +### Resource Tokens from the Local Keycard Agent + +An application running beside the Keycard CLI can get an access token for a +third-party resource without holding an application credential. +`AgentTokenSource` asks the local Keycard agent over its Unix socket, and the +agent mints the token with the developer's zone session once a human approves +the request. + +```python +import httpx +from keycardai.oauth import AgentTokenSource, ResourceAuth, is_declined + +source = AgentTokenSource(workload="my-agent") + +token = await source.resource_token("https://api.example.com", ["read"]) + +# Or attach a token to every request an httpx.AsyncClient sends: +auth = ResourceAuth(source, "https://api.example.com", ["read"]) +async with httpx.AsyncClient(auth=auth) as client: + response = await client.get("https://api.example.com/items") +``` + +The socket is the first of: + +1. `socket=`, when passed. +2. `KEYCARD_SOCKET`, which `keycard run` sets for the process it starts. +3. The `keycard agent` daemon's default socket, located the way the CLI + locates it from `KEYCARD_AGENT_DIR`, `XDG_RUNTIME_DIR`, `XDG_STATE_HOME`, + `KEYCARD_HOME` and `HOME` (on macOS, `~/.local/state/keycard/run/agent.sock`). + The daemon serves several zones, so pass `org=` and `zone=`. + +Variables are read from `env=` (default `os.environ`) on every call, never +from `keycard.toml`. Construction does no I/O. + +The first request for a resource and scope set blocks until someone answers +the approval prompt, so no timeout is applied; bound the call with +`asyncio.timeout`. The SDK does not cache tokens: each call is one request to +the agent, which caches them itself. + +Options, all keyword-only: + +| Option | Purpose | +|--------|---------| +| `socket` | Socket path; see above | +| `env` | Where the socket variables are read from | +| `workload` | Name shown in the approval prompt; self-declared | +| `app_id` | Identifier of the Keycard application the caller says it acts for, as set on the application; self-declared and matched exactly | +| `org`, `zone` | The tenant, for the multi-zone daemon; `keycard run` ignores them | +| `clock` | Wall-clock source for `expires_in` | + +`TokenResponse.expires_in` is `None` when the agent reports no expiry, and +`scope` is the granted scopes the agent reports, or `None` when it reports +none; it is never filled in from the request. + +A refusal raises `AgentError`, whose `code` is the agent's Connect error code +(`AgentCode`). Branch on the predicates rather than the message: + +| Predicate | Code | What to do | +|-----------|------|------------| +| `is_declined` | `permission_denied` | Don't retry automatically: declined, prompt expired or failed, the authorization server refused, or no session for `org`/`zone` | +| `is_rate_limited` | `resource_exhausted` | Back off | +| `is_prompter_unavailable` | `failed_precondition` | No prompt on this host; use another credential | +| `is_authorization_required` | `unauthenticated` | Sign in or authorize the resource; the message names the command | +| `is_application_not_found` | `not_found` | The declared `app_id` names no application in the zone | +| `is_unavailable` | `unavailable` | Transient; retry with backoff | + +An unreachable socket raises `NetworkError` naming the socket and how it was +chosen, and a 200 response the SDK cannot use raises `AgentResponseError`. + ## Error Handling The SDK provides a structured exception hierarchy with retry guidance. @@ -536,7 +605,9 @@ OAuthError (base) │ └── TokenExchangeError # RFC 8693 specific errors ├── NetworkError # Connection/transport failures ├── ConfigError # Client misconfiguration -└── AuthenticationError # Authentication failures +├── AuthenticationError # Authentication failures +├── AgentError # Refusals from the local Keycard agent +└── AgentResponseError # Unusable responses from the local Keycard agent ``` ### Retryable vs Non-Retryable Errors @@ -553,6 +624,9 @@ operation unchanged could succeed. | `NetworkError` | Yes | Always: transport faults are transient, permanent failures surface as protocol or HTTP errors | | `ConfigError` | No | Invalid configuration (requires code fix) | | `AuthenticationError` | No | Invalid credentials | +| `AgentError` | Yes | Code `resource_exhausted` or `unavailable` | +| `AgentError` | No | Any other code | +| `AgentResponseError` | No | Always | If you use the older `retriable` attribute: it is a legacy constructor flag, while `retryable` is the classification derived from the failure (the OAuth @@ -656,6 +730,7 @@ Working examples are available in the `examples/` directory: - **[discover_server_metadata](examples/discover_server_metadata/)** - RFC 8414 server metadata discovery - **[dynamic_client_registration](examples/dynamic_client_registration/)** - RFC 7591 client registration +- **[agent_token_source](examples/agent_token_source/)** - Resource tokens from the local Keycard agent Run examples: diff --git a/packages/oauth/examples/agent_token_source/.python-version b/packages/oauth/examples/agent_token_source/.python-version new file mode 100644 index 00000000..e4fba218 --- /dev/null +++ b/packages/oauth/examples/agent_token_source/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/packages/oauth/examples/agent_token_source/README.md b/packages/oauth/examples/agent_token_source/README.md new file mode 100644 index 00000000..170e0ecf --- /dev/null +++ b/packages/oauth/examples/agent_token_source/README.md @@ -0,0 +1,51 @@ +# Agent Token Source Example + +Gets an access token for a third-party resource from the local Keycard agent, +holding no application credential, then optionally calls the resource with it. + +## What it does + +1. Asks the agent for a token for `RESOURCE` with `AgentTokenSource`. The + first request for a resource and scope set opens an approval prompt; the + agent remembers the approval and caches the token. +2. If `CALL_URL` is set, sends a GET to it through `ResourceAuth`, which + attaches `Authorization: Bearer `. + +A refusal is reported by the predicate it matches: declined, authorization +required, no prompt available on this host, or an unknown application. + +## Usage + +The example depends on `keycardai-oauth` from this source tree (a path +dependency on `../../`), so it runs against unreleased code. + +Under `keycard run`, which starts a per-session agent and sets +`KEYCARD_SOCKET` for the process: + +```bash +uv sync +RESOURCE=https://api.example.com keycard run -- uv run python main.py +``` + +Against the `keycard agent` daemon, which serves every signed-in zone and so +needs the tenant named. With `KEYCARD_SOCKET` unset the source finds the +daemon's default socket the way the CLI does: + +```bash +keycard agent start +export KEYCARD_ORG= KEYCARD_ZONE= +RESOURCE=https://api.example.com uv run python main.py +``` + +Optional: + +- `SCOPES`: comma-separated scopes to request +- `KEYCARD_APP_ID`: identifier of a Keycard application in the zone, as set on + the application; the prompt shows it marked self-asserted +- `CALL_URL`: a URL on the resource to GET with the token attached + +## Requirements + +- Python 3.10+ +- The Keycard CLI, signed in to a zone where `RESOURCE` is registered +- A host that can show the approval prompt diff --git a/packages/oauth/examples/agent_token_source/main.py b/packages/oauth/examples/agent_token_source/main.py new file mode 100644 index 00000000..1015721e --- /dev/null +++ b/packages/oauth/examples/agent_token_source/main.py @@ -0,0 +1,96 @@ +"""Get a resource token from the local Keycard agent and call the resource with it. + +Keycard setup this example needs: + +1. The Keycard CLI, signed in to a zone (`keycard auth signin`), where the + resource named by RESOURCE is registered and the developer may obtain + tokens for it. A third-party provider's resource may first need a one-time + interactive authorization; the agent's error message names the command. +2. A running agent, either: + - `keycard run -- uv run python main.py`, which starts a per-session agent + for this process and sets KEYCARD_SOCKET, or + - `keycard agent start`, the long-running multi-zone daemon. With + KEYCARD_SOCKET unset the example finds the daemon's default socket, and + KEYCARD_ORG and KEYCARD_ZONE must name the org and zone ids to mint in. +3. A host that can show the approval prompt. The first request for a + resource and scope set waits until a human approves or declines it. +4. Optionally, a Keycard application in the zone whose identifier (as set on + the application, not its public id) is given as KEYCARD_APP_ID. The prompt + shows it marked self-asserted. + +Environment: + RESOURCE the resource indicator to request a token for (required) + SCOPES comma-separated scopes to request + KEYCARD_ORG org id, for the multi-zone daemon + KEYCARD_ZONE zone id, for the multi-zone daemon + KEYCARD_APP_ID the application this example says it acts for + CALL_URL a URL on the resource to GET with the token attached +""" + +import asyncio +import os +import sys + +import httpx + +from keycardai.oauth import ( + AgentError, + AgentTokenSource, + ConfigError, + NetworkError, + ResourceAuth, + is_application_not_found, + is_authorization_required, + is_declined, + is_prompter_unavailable, +) + + +async def main() -> int: + resource = os.environ.get("RESOURCE") + if not resource: + print("set RESOURCE to the resource indicator to request a token for") + return 2 + scopes = [s for s in os.environ.get("SCOPES", "").split(",") if s] + + source = AgentTokenSource( + workload="agent-token-source-example", + app_id=os.environ.get("KEYCARD_APP_ID", ""), + org=os.environ.get("KEYCARD_ORG", ""), + zone=os.environ.get("KEYCARD_ZONE", ""), + ) + + try: + token = await source.resource_token(resource, scopes) + except (ConfigError, NetworkError) as err: + print(err) + return 1 + except AgentError as err: + if is_declined(err): + print(f"declined: {err.message}") + elif is_authorization_required(err): + print(f"authorization required: {err.message}") + elif is_prompter_unavailable(err): + print("this host cannot show an approval prompt") + elif is_application_not_found(err): + print("KEYCARD_APP_ID names no application in this zone") + else: + print(err) + return 1 + + expiry = "no expiry" if token.expires_in is None else f"expires in {token.expires_in}s" + print(f"token for {resource}, {expiry}, granted scopes {token.scope or 'unknown'}") + + if call := os.environ.get("CALL_URL"): + # The agent caches the token, so this second request is answered + # without another prompt. The client's timeout bounds the GET, not + # the wait for the token. + auth = ResourceAuth(source, resource, scopes) + async with httpx.AsyncClient(auth=auth) as client: + response = await client.get(call) + print(f"GET {call} -> {response.status_code}") + return 0 + + +if __name__ == "__main__": + sys.exit(asyncio.run(main())) diff --git a/packages/oauth/examples/agent_token_source/pyproject.toml b/packages/oauth/examples/agent_token_source/pyproject.toml new file mode 100644 index 00000000..18773c40 --- /dev/null +++ b/packages/oauth/examples/agent_token_source/pyproject.toml @@ -0,0 +1,13 @@ +[project] +name = "agent-token-source" +version = "0.1.0" +description = "Resource tokens from the local Keycard agent" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "keycardai-oauth", + "httpx>=0.28.1", +] + +[tool.uv.sources] +keycardai-oauth = { path = "../../", editable = true } diff --git a/packages/oauth/examples/agent_token_source/uv.lock b/packages/oauth/examples/agent_token_source/uv.lock new file mode 100644 index 00000000..1c78bba8 --- /dev/null +++ b/packages/oauth/examples/agent_token_source/uv.lock @@ -0,0 +1,561 @@ +version = 1 +revision = 5 +requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version < '3.11'", +] + +[[package]] +name = "agent-token-source" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "httpx" }, + { name = "keycardai-oauth" }, +] + +[package.metadata] +requires-dist = [ + { name = "httpx", specifier = ">=0.28.1" }, + { name = "keycardai-oauth", editable = "../../" }, +] + +[[package]] +name = "annotated-types" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" }, +] + +[[package]] +name = "anyio" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, + { name = "idna" }, + { name = "typing-extensions", marker = "python_full_version < '3.15'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a1/98/7e457a3b014976887a050561955c0b76e1e7e2d6e27b78ecef2ef80518f2/anyio-4.16.0.tar.gz", hash = "sha256:59bb03251907983d1603d27c3087ddb1e93299ea2163adcdba37899a4fb12ffb", size = 310971, upload-time = "2026-11-01T11:20:07.282Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a9/16/7757fb84c819accc7d7e9af5291b261e4abb8627ee040f99e7d35ef2457a/anyio-4.16.0-py3-none-any.whl", hash = "sha256:c66ae634e0b8228396b801741beb3294326d4b6102f7bba4041c0dfb58c29026", size = 134521, upload-time = "2026-11-01T11:20:05.59Z" }, +] + +[[package]] +name = "certifi" +version = "2026.10.23" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fd/11/b524cbd9bbdaca58608e4cf4053fd463417549e1959fa8d3aa18319f9555/certifi-2026.10.23.tar.gz", hash = "sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd", size = 136225, upload-time = "2026-10-23T11:36:16.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/d1/a3652fe2c19134d0d15922177821d863cbd7e842d53a21bbe7e8e3a1b5ac/certifi-2026.10.23-py3-none-any.whl", hash = "sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1", size = 135082, upload-time = "2026-10-23T11:36:14.763Z" }, +] + +[[package]] +name = "cffi" +version = "2.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pycparser", version = "3.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11' and implementation_name != 'PyPy'" }, + { name = "pycparser", version = "3.12", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11' and implementation_name != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/d2/2cde336b375f55c76ca670f0be3978cc048e31e24f3b4d7ce8473150a388/cffi-2.1.1-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be", size = 183779, upload-time = "2026-08-03T21:19:15.602Z" }, + { url = "https://files.pythonhosted.org/packages/94/1a/4b2f7c92293ba05cbd4a9a1b28faaf0326272d9488e6354657571c48a7aa/cffi-2.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b", size = 184178, upload-time = "2026-08-03T21:19:16.67Z" }, + { url = "https://files.pythonhosted.org/packages/17/0b/ba385d8ccedf926c3cd06e8e2f327027da5afe5f0eb30f1f7bc43ac55125/cffi-2.1.1-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004", size = 211037, upload-time = "2026-08-03T21:19:17.705Z" }, + { url = "https://files.pythonhosted.org/packages/a3/b9/0f2e58b2cefa33255bff36935d42b13180fe559bba82596540eb404bde7d/cffi-2.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9", size = 218652, upload-time = "2026-08-03T21:19:18.735Z" }, + { url = "https://files.pythonhosted.org/packages/37/15/180e0dab27b9312c7479003d14c9e547634b7dcb934e2cc4650e1b131a7a/cffi-2.1.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98", size = 205422, upload-time = "2026-08-03T21:19:19.96Z" }, + { url = "https://files.pythonhosted.org/packages/18/d4/03026f0c850cbbaa9030750490225b4a7f4d524ea4df72c3cc740a90f4ef/cffi-2.1.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9", size = 205444, upload-time = "2026-08-03T21:19:21.246Z" }, + { url = "https://files.pythonhosted.org/packages/75/77/60bebf6f818bec84210ac5b6979ce4eeadce6fbbaabc9c7ab23e506d1ce5/cffi-2.1.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6", size = 218742, upload-time = "2026-08-03T21:19:22.523Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ae/679bf47e73fd77b352171727f07de559a003f14de5d02b904a6ec1fa73ca/cffi-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf", size = 221054, upload-time = "2026-08-03T21:19:23.694Z" }, + { url = "https://files.pythonhosted.org/packages/09/b8/eefc0e06913b70aa153bf74c946094a18f58fd4aff11b7f372bfdfdca050/cffi-2.1.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659", size = 213489, upload-time = "2026-08-03T21:19:24.922Z" }, + { url = "https://files.pythonhosted.org/packages/6f/13/4e56852824a03cdf68523a35686f1c28eacd4bd30a7b0a78e682e6e6e1d3/cffi-2.1.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9", size = 220241, upload-time = "2026-08-03T21:19:26.214Z" }, + { url = "https://files.pythonhosted.org/packages/99/7f/040f9e163e4acac3ee3d85b02d00b2576e7ca980d8785f0a3a5f1a9bf7f5/cffi-2.1.1-cp310-cp310-win32.whl", hash = "sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41", size = 174578, upload-time = "2026-08-03T21:19:27.338Z" }, + { url = "https://files.pythonhosted.org/packages/ba/0b/644a2ec1a4eaba49c2939410bb1eb1d25b09d6d0582f5d2f95c537043725/cffi-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1", size = 185082, upload-time = "2026-08-03T21:19:28.409Z" }, + { url = "https://files.pythonhosted.org/packages/70/d2/16d99a0c4948febc0ebd133a13b2f688ff7f8cb04da971e1128872ce0c03/cffi-2.1.1-cp311-cp311-macosx_10_15_x86_64.whl", hash = "sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12", size = 183838, upload-time = "2026-08-03T21:19:29.637Z" }, + { url = "https://files.pythonhosted.org/packages/cd/95/31b535a9f0220ae9f357de4a08d57ce89cb417653c2fd9f075f50822a388/cffi-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1", size = 184168, upload-time = "2026-08-03T21:19:30.764Z" }, + { url = "https://files.pythonhosted.org/packages/ad/5a/4707a0dc1f203f5dde5a907b0d4e3c25d71120241048bd5bc6f1bb9d4e71/cffi-2.1.1-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0", size = 211805, upload-time = "2026-08-03T21:19:31.867Z" }, + { url = "https://files.pythonhosted.org/packages/ad/66/c19feabb28485b6e0bbaaafa90837a1ef5d302e90f2178bd33f17a49879b/cffi-2.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813", size = 218716, upload-time = "2026-08-03T21:19:32.896Z" }, + { url = "https://files.pythonhosted.org/packages/a7/92/500760486c8baab49a7a8a58ba7fc3355ec3974b454b8a09e528efde9e1d/cffi-2.1.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990", size = 205569, upload-time = "2026-08-03T21:19:34.142Z" }, + { url = "https://files.pythonhosted.org/packages/a5/a7/a67c733254d6e7373f7822f8082d8d6beade791e0cf12a7611f376fa61c7/cffi-2.1.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af", size = 204907, upload-time = "2026-08-03T21:19:35.174Z" }, + { url = "https://files.pythonhosted.org/packages/f7/a4/4399daaf8f7dfee9d7c3327fdb0426ee041cc63edc358b93911ceb2bfc7a/cffi-2.1.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632", size = 217807, upload-time = "2026-08-03T21:19:36.286Z" }, + { url = "https://files.pythonhosted.org/packages/28/f7/dabe6da2466ecbd82dc62e7342dc6b1065dad990c06f00f0ede9ebf2a0ed/cffi-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd", size = 221252, upload-time = "2026-08-03T21:19:37.416Z" }, + { url = "https://files.pythonhosted.org/packages/ce/87/616202d8e51342c07d2534c510111c4cc37201775ce8f60802c9335d1edd/cffi-2.1.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a", size = 214214, upload-time = "2026-08-03T21:19:38.507Z" }, + { url = "https://files.pythonhosted.org/packages/b4/c6/ab025d75d2c26c19b087c0124e75ee31cb65032f4fe345d356d8c507ab97/cffi-2.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa", size = 219408, upload-time = "2026-08-03T21:19:39.809Z" }, + { url = "https://files.pythonhosted.org/packages/db/e2/7e8109f65445bdc673a7b54f02c677de462db75674220fd1335efc8eb598/cffi-2.1.1-cp311-cp311-win32.whl", hash = "sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3", size = 174470, upload-time = "2026-08-03T21:19:41.246Z" }, + { url = "https://files.pythonhosted.org/packages/73/c0/77ba02423c2f7d7091143c45cd49e0e6575c4c1967394bb542bd923a9b74/cffi-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0", size = 185096, upload-time = "2026-08-03T21:19:42.615Z" }, + { url = "https://files.pythonhosted.org/packages/7c/47/9f1f85f9672ceda4984dc6c4f8824e8558992a2972c3d3c81fb8eb28d4ba/cffi-2.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455", size = 179941, upload-time = "2026-08-03T21:19:43.747Z" }, + { url = "https://files.pythonhosted.org/packages/10/69/43965eccfdead3b9220015fd1320e117be8c6ed01a62ffab76eeb752f5d5/cffi-2.1.1-cp312-cp312-macosx_10_15_x86_64.whl", hash = "sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0", size = 184821, upload-time = "2026-08-03T21:19:44.887Z" }, + { url = "https://files.pythonhosted.org/packages/54/7d/16e5a096677b5e313ca80cd5e5170efa3ea44624a82bb111925522da64b1/cffi-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf", size = 184719, upload-time = "2026-08-03T21:19:46.129Z" }, + { url = "https://files.pythonhosted.org/packages/56/e6/8941622732edec876dd17d0453dce07317ae96db34f2ec1436c9d3785986/cffi-2.1.1-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a", size = 214799, upload-time = "2026-08-03T21:19:47.218Z" }, + { url = "https://files.pythonhosted.org/packages/44/de/f98430906df1545ffde0d543dd124a7a439bc2cd32b36b9c53f805df7333/cffi-2.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890", size = 222389, upload-time = "2026-08-03T21:19:48.331Z" }, + { url = "https://files.pythonhosted.org/packages/6a/5b/717f1526b9957b34456313c31645c5b82b8fb5c3fe9e4752999be7128bfc/cffi-2.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50", size = 210249, upload-time = "2026-08-03T21:19:49.543Z" }, + { url = "https://files.pythonhosted.org/packages/64/b3/f8aa4f3e34986c7e4ec45072d1b1b9dd295b6b18007b45518d79726dd725/cffi-2.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e", size = 208775, upload-time = "2026-08-03T21:19:50.918Z" }, + { url = "https://files.pythonhosted.org/packages/b1/db/dceb9dd5b231e1da801793f8acc9f3c52a7e1afe40bb1aae37e02b0faad5/cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf", size = 221822, upload-time = "2026-08-03T21:19:52.054Z" }, + { url = "https://files.pythonhosted.org/packages/a0/d2/6cd24ae3be000a634109c247d1475d62e5616d0dc78c82770942ec384248/cffi-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517", size = 225232, upload-time = "2026-08-03T21:19:53.109Z" }, + { url = "https://files.pythonhosted.org/packages/cb/52/3fa190537004dd7f0ab860a6dc7c0175b8667f68d1e618a46f5498d30250/cffi-2.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735", size = 223597, upload-time = "2026-08-03T21:19:54.515Z" }, + { url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" }, + { url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" }, + { url = "https://files.pythonhosted.org/packages/9d/f4/035513d4117049066b4779dc3b7c0c0fdad175fa13731c9f4003f1cd1478/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e", size = 194248, upload-time = "2026-08-03T21:19:59.399Z" }, + { url = "https://files.pythonhosted.org/packages/76/af/2aeb4dbb5fc41a04161ae9ff1518de7cec08e164f44a8ce6a4cf7fd2cd1d/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c", size = 196908, upload-time = "2026-08-03T21:20:00.746Z" }, + { url = "https://files.pythonhosted.org/packages/a7/46/2e5fdde8555706dd98139a910ca11be02809f3f605ce956f655d0214e100/cffi-2.1.1-cp313-cp313-macosx_10_15_x86_64.whl", hash = "sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6", size = 184805, upload-time = "2026-08-03T21:20:02.02Z" }, + { url = "https://files.pythonhosted.org/packages/55/41/4c7042f317b9217502988f0873af87e16ad606dc20f84e546e3e6ce9764c/cffi-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971", size = 184764, upload-time = "2026-08-03T21:20:03.141Z" }, + { url = "https://files.pythonhosted.org/packages/43/1f/1c3d90d91811c8f86ced9ed637956c54bfe5b79ca98fe976d7f8c8979f6b/cffi-2.1.1-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c", size = 214722, upload-time = "2026-08-03T21:20:04.377Z" }, + { url = "https://files.pythonhosted.org/packages/37/6f/3b5ce4c3b2192d250f04908f2bfd91ef34552ec8f7716a5d4abdb8d67bb2/cffi-2.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125", size = 222369, upload-time = "2026-08-03T21:20:05.544Z" }, + { url = "https://files.pythonhosted.org/packages/02/10/4b3c75dde3d9663c9e02ba05c2668b954f671d4bbe346413ca8c696b295a/cffi-2.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264", size = 210175, upload-time = "2026-08-03T21:20:06.75Z" }, + { url = "https://files.pythonhosted.org/packages/df/62/14f74b9543e605d17701dc797b815958b8bb70b7624ce1b832ddad48ed6c/cffi-2.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3", size = 208670, upload-time = "2026-08-03T21:20:08.04Z" }, + { url = "https://files.pythonhosted.org/packages/95/95/86342356ff5953b3fb06f7ef7c5bee212d45e770abc7218d451b9148313c/cffi-2.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2", size = 221824, upload-time = "2026-08-03T21:20:09.274Z" }, + { url = "https://files.pythonhosted.org/packages/eb/ff/7b3429ff53aafe931ed8a5fc69f481bbef7ba6de87ddcbb63d08f483f613/cffi-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b", size = 225148, upload-time = "2026-08-03T21:20:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/34/34/a95870b9221e09cf4f2ce3178b1a210abdfe63a1bd357da940418d7b8d15/cffi-2.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7", size = 223564, upload-time = "2026-08-03T21:20:12.165Z" }, + { url = "https://files.pythonhosted.org/packages/70/ea/839b50531021a647fb5e929f72cf97bc1ff702b5472166164b5b6e76b851/cffi-2.1.1-cp313-cp313-win32.whl", hash = "sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac", size = 175263, upload-time = "2026-08-03T21:20:13.559Z" }, + { url = "https://files.pythonhosted.org/packages/60/a6/8b149b2c3f2e11aaa1618ef64500b45f50f22c57a977a4dff1aff1f91042/cffi-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d", size = 185688, upload-time = "2026-08-03T21:20:14.69Z" }, + { url = "https://files.pythonhosted.org/packages/01/9a/11f687cb39d6a3504060d5242f04f48c735afb4d3d533958a20594890cb2/cffi-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973", size = 180078, upload-time = "2026-08-03T21:20:15.917Z" }, + { url = "https://files.pythonhosted.org/packages/d3/7b/d6bbf82b8b96e7391438898c42f5bd96dd02030fd5b64937d248220003e2/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c", size = 194064, upload-time = "2026-08-03T21:20:17.148Z" }, + { url = "https://files.pythonhosted.org/packages/94/e6/bcc91b283be94735e268487a054004f0aa19947b6348fa367db53230abc8/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb", size = 196720, upload-time = "2026-08-03T21:20:18.268Z" }, + { url = "https://files.pythonhosted.org/packages/d9/99/c4b0c17cacdc9c3b8f280026286a9826d6a208c0f047591a3c3ce99b91fd/cffi-2.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54", size = 184964, upload-time = "2026-08-03T21:20:19.708Z" }, + { url = "https://files.pythonhosted.org/packages/b3/a9/9db617d05d7367c1ad0ab00b3aa6e6f9281edd689b4ee9ea0e5a84e89c97/cffi-2.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72", size = 184962, upload-time = "2026-08-03T21:20:20.833Z" }, + { url = "https://files.pythonhosted.org/packages/67/b8/b42132ca113dc567d37684437b46ca1dafc885902b02a110a02d5b511857/cffi-2.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1", size = 222328, upload-time = "2026-08-03T21:20:22.118Z" }, + { url = "https://files.pythonhosted.org/packages/80/10/c5c0cbf0a657aecf59ef511409734230bf556f05a0d6c9eed7aa5c0a0166/cffi-2.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062", size = 209985, upload-time = "2026-08-03T21:20:23.401Z" }, + { url = "https://files.pythonhosted.org/packages/d5/6c/bfa0b87b03b9238148beca990292843c9396ba069b54496596594173de7b/cffi-2.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03", size = 208530, upload-time = "2026-08-03T21:20:24.628Z" }, + { url = "https://files.pythonhosted.org/packages/e9/02/4e7d553a7ac4b4238b38b3c1b80d486e9d4436f8d2acbf87a0997fe3f402/cffi-2.1.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96", size = 221525, upload-time = "2026-08-03T21:20:25.758Z" }, + { url = "https://files.pythonhosted.org/packages/82/1d/a4aaf9babd75acb4d5f223bff71533bee748dd770a382619a798960ee9ba/cffi-2.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527", size = 225053, upload-time = "2026-08-03T21:20:26.985Z" }, + { url = "https://files.pythonhosted.org/packages/81/10/5dc0e7bdd18e22107054288283380fc97a06ae3f1656a106908d666a3c88/cffi-2.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13", size = 223213, upload-time = "2026-08-03T21:20:28.277Z" }, + { url = "https://files.pythonhosted.org/packages/0b/e9/d0061c364cde06ee43168a0d076ac1da512cbc380d44767b844ba34fe2b6/cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c", size = 177682, upload-time = "2026-08-03T21:20:44.288Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1c3e01e3ba14c39f6d10bfbac52753b7e22259e38088e5cfe1d704918690/cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48", size = 187949, upload-time = "2026-08-03T21:20:45.623Z" }, + { url = "https://files.pythonhosted.org/packages/87/5b/da4e39efe18eeb89cf580ea9cfc66b6a7c3eadb808fc0cc1d3a295cb5a5d/cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836", size = 182947, upload-time = "2026-08-03T21:20:46.955Z" }, + { url = "https://files.pythonhosted.org/packages/23/59/40338bf421c5accea1d45158170c87006ef1cd371b05c077e76476949728/cffi-2.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3", size = 188504, upload-time = "2026-08-03T21:20:29.495Z" }, + { url = "https://files.pythonhosted.org/packages/7d/47/5ecf1023850036e674c77ec4de86182d309ae344e39e7cba984b7df5d647/cffi-2.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2", size = 188259, upload-time = "2026-08-03T21:20:31.291Z" }, + { url = "https://files.pythonhosted.org/packages/2a/9c/92934c3bea9f785b23eba304538c0b4d37a2a96d2431eb3a1bc87a11aa19/cffi-2.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94", size = 223864, upload-time = "2026-08-03T21:20:32.571Z" }, + { url = "https://files.pythonhosted.org/packages/4d/45/ba4c93527bc38616a8bd36488acb69a2212d60486794f0c1f318949bbb76/cffi-2.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc", size = 211538, upload-time = "2026-08-03T21:20:33.808Z" }, + { url = "https://files.pythonhosted.org/packages/80/e9/b6ef565e452acb932fb0cb5443f44a78efbd1233e566f02b5a83855e9115/cffi-2.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29", size = 210688, upload-time = "2026-08-03T21:20:34.974Z" }, + { url = "https://files.pythonhosted.org/packages/9a/95/eff5f0cee78d2eabc7eebffec40d3fc1876b5f3c95582e018bb4b99601f2/cffi-2.1.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676", size = 223803, upload-time = "2026-08-03T21:20:36.564Z" }, + { url = "https://files.pythonhosted.org/packages/fa/01/579d39fb8bef00a335a23d83757b44feb24cd6345a2c451b64cb67b9c362/cffi-2.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e", size = 226763, upload-time = "2026-08-03T21:20:37.816Z" }, + { url = "https://files.pythonhosted.org/packages/8d/b0/0b44f47c60b01b57b6e2bbd92343f13a85a1d93bc46ccf6e47e244acd99c/cffi-2.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f", size = 225688, upload-time = "2026-08-03T21:20:38.959Z" }, + { url = "https://files.pythonhosted.org/packages/eb/d2/3b7176cb570a1d3e27faf67b72f591af508036e0d8b2be2ef9af9e8c84bb/cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4", size = 182868, upload-time = "2026-08-03T21:20:40.388Z" }, + { url = "https://files.pythonhosted.org/packages/56/78/31f00c1bcd97c9bbf55f1bfdf5bc809a5de8887473e90bb9960dca825e80/cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e", size = 194104, upload-time = "2026-08-03T21:20:41.725Z" }, + { url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" }, + { url = "https://files.pythonhosted.org/packages/c1/8f/9ebe220eab48a093d1a5a5e339ab0dc7316eef3bb04d63c42f0251b61f50/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d", size = 194043, upload-time = "2026-08-03T21:20:48.179Z" }, + { url = "https://files.pythonhosted.org/packages/ff/69/844bad3ece306c4782c2ecb93597035b6690d48704b803914c199da1e8b3/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b", size = 196737, upload-time = "2026-08-03T21:20:49.457Z" }, + { url = "https://files.pythonhosted.org/packages/1b/8a/af668013284634733f02d683458a0728739c7d6ddb5e14cb0c20832266fe/cffi-2.1.1-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4", size = 184933, upload-time = "2026-08-03T21:20:50.639Z" }, + { url = "https://files.pythonhosted.org/packages/0c/75/2f5207ff6d1a613133b23a5203cc0c2a628313b5eb3974d7956ae3c57950/cffi-2.1.1-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8", size = 185002, upload-time = "2026-08-03T21:20:52.173Z" }, + { url = "https://files.pythonhosted.org/packages/e2/31/9e1313b0a6e30e91b3b3d3fff51ae99c857c07738e3afcce1f7334e1b7ab/cffi-2.1.1-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6", size = 222271, upload-time = "2026-08-03T21:20:53.462Z" }, + { url = "https://files.pythonhosted.org/packages/50/e3/f6234a833e6e08c7007003074723c406559eecf9b48dfc97471e5a8eb7a0/cffi-2.1.1-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80", size = 209919, upload-time = "2026-08-03T21:20:54.783Z" }, + { url = "https://files.pythonhosted.org/packages/0d/fc/5f74e293fced6edb51af3a46c4ccf6c23c9943774ecb375ddbd522c76add/cffi-2.1.1-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779", size = 208529, upload-time = "2026-08-03T21:20:56.066Z" }, + { url = "https://files.pythonhosted.org/packages/44/16/29e6d01b388bef055ecd6ca8244b3f4d336bd09e92d5d892187b9601084e/cffi-2.1.1-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399", size = 221630, upload-time = "2026-08-03T21:20:57.336Z" }, + { url = "https://files.pythonhosted.org/packages/a4/18/fa7f1f6857d5eb88a4ca99ffcbfb7c387a287ccc154c64a73e86314745d7/cffi-2.1.1-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688", size = 225134, upload-time = "2026-08-03T21:20:58.675Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9f/e8e3dfa04a1b4c241f8c91faacad872b4d4efd051d49764ad4e2fd4b9fea/cffi-2.1.1-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7", size = 223197, upload-time = "2026-08-03T21:20:59.968Z" }, + { url = "https://files.pythonhosted.org/packages/f8/7e/8debeb04f1ab9fe2a6963964cd6f1aaf7192627b83926586a6a4e089c9fa/cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac", size = 177683, upload-time = "2026-08-03T21:21:14.901Z" }, + { url = "https://files.pythonhosted.org/packages/e0/31/5158704cc474ab65c1647932e88be78dc0873f47130e253be38bcaf13d01/cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960", size = 187897, upload-time = "2026-08-03T21:21:16.108Z" }, + { url = "https://files.pythonhosted.org/packages/cc/4b/b3a2da8570c704ffc0f9762cdc3ec0f02c8573798e0b5cf7f11c82bbb70f/cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1", size = 182935, upload-time = "2026-08-03T21:21:17.271Z" }, + { url = "https://files.pythonhosted.org/packages/d0/ef/5443574510a1207e6f6bc38ba6e1f1de36cb48fef07b2728bb896a21f430/cffi-2.1.1-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc", size = 188464, upload-time = "2026-08-03T21:21:01.163Z" }, + { url = "https://files.pythonhosted.org/packages/7e/ae/a56fa8c4686ad50e148fcbc8d3ae0d03915ff5c30d795058988c24118cef/cffi-2.1.1-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab", size = 188262, upload-time = "2026-08-03T21:21:02.382Z" }, + { url = "https://files.pythonhosted.org/packages/53/b2/6187f46f2912276a3ae284076109cc5c8680482f11f766ccf26db4a86427/cffi-2.1.1-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e", size = 223779, upload-time = "2026-08-03T21:21:03.553Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f6/c3ad28bd19f77047a03084424fbd4cbe997303267c14423737324be0385d/cffi-2.1.1-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358", size = 211520, upload-time = "2026-08-03T21:21:04.863Z" }, + { url = "https://files.pythonhosted.org/packages/a0/cd/ccac9013a5bd9fd764de118674ab9c805b5ca10c19270d90ee273f8b2240/cffi-2.1.1-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231", size = 210673, upload-time = "2026-08-03T21:21:06.223Z" }, + { url = "https://files.pythonhosted.org/packages/52/86/2976131c639aead931c5bee5aba67e4b09fbeb8018b6f282f70803f923a7/cffi-2.1.1-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6", size = 223835, upload-time = "2026-08-03T21:21:07.539Z" }, + { url = "https://files.pythonhosted.org/packages/ac/0c/33a7aeab2f9c76918c52e084beb39c570db3588133412929e8ec06fab90b/cffi-2.1.1-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94", size = 226705, upload-time = "2026-08-03T21:21:08.774Z" }, + { url = "https://files.pythonhosted.org/packages/e3/26/2cde30fdde421130bfc18f70395731a6e6b2053c6a1978a5258ff04e72fa/cffi-2.1.1-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5", size = 225539, upload-time = "2026-08-03T21:21:09.911Z" }, + { url = "https://files.pythonhosted.org/packages/6d/cd/a361394c94b2129d604bb846f624a8e88255a3ee33129c434a00d715e64f/cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66", size = 182707, upload-time = "2026-08-03T21:21:11.226Z" }, + { url = "https://files.pythonhosted.org/packages/9b/b5/ba2b299993c26577d529b6ae29841f9e15b9fcf004d65f423f4fcf94ade9/cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3", size = 193772, upload-time = "2026-08-03T21:21:12.39Z" }, + { url = "https://files.pythonhosted.org/packages/aa/29/35e016098c814cd93de9cd320c66b5bfba14dc6ecedd3cb518fa7c408c69/cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692", size = 186360, upload-time = "2026-08-03T21:21:13.636Z" }, +] + +[[package]] +name = "cryptography" +version = "50.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9d/af/182eb91b0df3fe75c4d9f26fe70684569566745f6ba7e5c9c73a862c5252/cryptography-50.0.2.tar.gz", hash = "sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5", size = 880623, upload-time = "2026-09-30T15:30:04.884Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/56/d194340cc4a57535e82e1bee9e89667ac4b7c13b5d3f59686deae3094dd5/cryptography-50.0.2-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb", size = 3914904, upload-time = "2026-09-30T14:43:44.339Z" }, + { url = "https://files.pythonhosted.org/packages/d9/69/c9bd862c3bf43d6399c433caf002df16e2dffd4be49bdf515cda38038711/cryptography-50.0.2-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0", size = 4731146, upload-time = "2026-09-30T14:43:47.113Z" }, + { url = "https://files.pythonhosted.org/packages/21/69/64cef1f702bf6657e0cc186ed1a2891d50d29fb41586b254e1c07adea261/cryptography-50.0.2-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2", size = 4719841, upload-time = "2026-09-30T14:43:49.01Z" }, + { url = "https://files.pythonhosted.org/packages/38/6b/61a3f8d8c5e1e49a6cddccafc4015cc1c0021360ab0acb4080e7a423644a/cryptography-50.0.2-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480", size = 4738340, upload-time = "2026-09-30T14:43:50.932Z" }, + { url = "https://files.pythonhosted.org/packages/7b/2e/7212ca32fd43dc91f2f41db20160b268098874b4c9a0e7be94d6835f5b2e/cryptography-50.0.2-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134", size = 5367029, upload-time = "2026-09-30T14:43:52.911Z" }, + { url = "https://files.pythonhosted.org/packages/1a/f1/b474e930c4d910328780e3940da76f5aa5cbc48ce1fc14e44d239d9ea9db/cryptography-50.0.2-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856", size = 4753050, upload-time = "2026-09-30T14:43:55.272Z" }, + { url = "https://files.pythonhosted.org/packages/7c/52/9af10e80ac16b0fcc2123f9cbd5e7afbd0fd5075bb7a607c592258a39cda/cryptography-50.0.2-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e", size = 4376724, upload-time = "2026-09-30T14:43:57.24Z" }, + { url = "https://files.pythonhosted.org/packages/71/37/6202e488cc1eb625ea110c292c6bda92823176e023f427d8d5660ce8d632/cryptography-50.0.2-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04", size = 4737859, upload-time = "2026-09-30T14:43:59.541Z" }, + { url = "https://files.pythonhosted.org/packages/8f/30/e86d7d518489b0ae2497091a35287abcb1a2ce4037837a34afbe9b1d6964/cryptography-50.0.2-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc", size = 5324103, upload-time = "2026-09-30T14:44:01.901Z" }, + { url = "https://files.pythonhosted.org/packages/d3/69/2c833a049475e0a3444e94c7d0aca0aa51d166374a449b09e92ac98138de/cryptography-50.0.2-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079", size = 4752576, upload-time = "2026-09-30T14:44:04.545Z" }, + { url = "https://files.pythonhosted.org/packages/6c/5d/906970b83bbfc1f5bbfb677a143c181f2801f23b6a7204a3b47c42c97e65/cryptography-50.0.2-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51", size = 4870819, upload-time = "2026-09-30T14:44:06.884Z" }, + { url = "https://files.pythonhosted.org/packages/68/e3/f2298d3bb55e0c4a91841ec4d01b3f020ba8c5fbf15ccdcc6dcf03f97025/cryptography-50.0.2-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93", size = 5030152, upload-time = "2026-09-30T14:44:09.443Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4f/adfc442765721292fff86d314ce385d3249d22db42295c0dd057727b60f3/cryptography-50.0.2-cp311-abi3-win_amd64.whl", hash = "sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c", size = 3824692, upload-time = "2026-09-30T14:44:11.671Z" }, + { url = "https://files.pythonhosted.org/packages/ce/cb/52eb3770c0d0be2702a98c6e96065ddc0a2877cf0845aa9c23397c142cd4/cryptography-50.0.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8", size = 3892731, upload-time = "2026-09-30T14:44:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/19/8e/aa1fc533d4546b127b45de8aa024eb5933d23eff9debfe25931e56861095/cryptography-50.0.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047", size = 4710431, upload-time = "2026-09-30T14:44:15.427Z" }, + { url = "https://files.pythonhosted.org/packages/6a/64/72bc3f75176e7e406b748a3e3830432b8c51297b38368713df04dc04898a/cryptography-50.0.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539", size = 4694824, upload-time = "2026-09-30T14:44:17.69Z" }, + { url = "https://files.pythonhosted.org/packages/4e/c6/62c77550edfa5ca3f14bf44a1e6739b9fa09d6e998a11d97ed8213bccc98/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1", size = 4716967, upload-time = "2026-09-30T14:44:19.661Z" }, + { url = "https://files.pythonhosted.org/packages/f4/37/cce70f150c432914460157a6ecc161752e053aa5ec0ef3b3f7dc6e31039a/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_ppc64le.whl", hash = "sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7", size = 5328676, upload-time = "2026-09-30T14:44:21.744Z" }, + { url = "https://files.pythonhosted.org/packages/aa/9a/6f2f0304d634ceafdeaf23e84537336664ac419b5d07611675c2ad3f6b7a/cryptography-50.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18", size = 4727698, upload-time = "2026-09-30T14:44:24.178Z" }, + { url = "https://files.pythonhosted.org/packages/1d/de/66bcf9244d118663b2e1aaded8990f4640e3d7b7411870a5765f252074d2/cryptography-50.0.2-cp314-cp314t-manylinux_2_31_armv7l.whl", hash = "sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37", size = 4354821, upload-time = "2026-09-30T14:44:26.263Z" }, + { url = "https://files.pythonhosted.org/packages/bd/e6/db28a28c7b6c676addce89136de3d8db49ea825a8c863472e36e42ead4ad/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_aarch64.whl", hash = "sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2", size = 4716748, upload-time = "2026-09-30T14:44:28.447Z" }, + { url = "https://files.pythonhosted.org/packages/30/96/01546c7f69ea0e2ab790a2e4f0934a4052fb9b388147fbf83c2fd72f1e57/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_ppc64le.whl", hash = "sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1", size = 5285085, upload-time = "2026-09-30T14:44:30.704Z" }, + { url = "https://files.pythonhosted.org/packages/6c/01/03263395f74d50b071e9e66daace3f8bef80493e5d410726f2ba8554736b/cryptography-50.0.2-cp314-cp314t-manylinux_2_34_x86_64.whl", hash = "sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05", size = 4727268, upload-time = "2026-09-30T14:44:32.92Z" }, + { url = "https://files.pythonhosted.org/packages/eb/94/2bfe8f29ec0cc9c0d99359c4161adf32858e4934b72c6d100d2ac0bbe962/cryptography-50.0.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e", size = 4849503, upload-time = "2026-09-30T14:44:34.969Z" }, + { url = "https://files.pythonhosted.org/packages/54/44/e80651ecbf0e42b62e2bb5f5768916e07eea72e1297338956a61df361f88/cryptography-50.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e", size = 5004057, upload-time = "2026-09-30T14:44:37.064Z" }, + { url = "https://files.pythonhosted.org/packages/f8/cc/1d33befb3cd7ea7e77d2d73f43f2066471da1b21f24a6156efcaabf6d2e8/cryptography-50.0.2-cp314-cp314t-win_amd64.whl", hash = "sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45", size = 3795868, upload-time = "2026-09-30T14:44:39.71Z" }, + { url = "https://files.pythonhosted.org/packages/2d/49/93f6a6e7a87c9aa68d44d3e1cdb5fe8f60c90d5d2f46acae9a56892816b8/cryptography-50.0.2-cp315-abi3.abi3t-macosx_11_0_arm64.whl", hash = "sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37", size = 4133708, upload-time = "2026-09-30T14:44:41.807Z" }, + { url = "https://files.pythonhosted.org/packages/8c/75/32ac2a56243d778805c16ca6a32b8f74fb757df7e28d7ecb560afafb59cf/cryptography-50.0.2-cp315-abi3.abi3t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a", size = 4956267, upload-time = "2026-09-30T14:44:43.693Z" }, + { url = "https://files.pythonhosted.org/packages/aa/a4/2c8d734e43d97f0842ee9f1b7b4bfb3d0cf5e19edebf43c2afe6675c2320/cryptography-50.0.2-cp315-abi3.abi3t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67", size = 4966465, upload-time = "2026-09-30T14:44:45.769Z" }, + { url = "https://files.pythonhosted.org/packages/c2/58/ee288c829a6f41f6235ae9dd33d82fd19b45442b65b4c8a3da36963d9f7a/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_aarch64.whl", hash = "sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc", size = 4959356, upload-time = "2026-09-30T14:44:48.211Z" }, + { url = "https://files.pythonhosted.org/packages/92/20/9ded6d51ddd9897f6b6e81fb9ebea7951d7cc5d6c890b0ed8abf77a51a80/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_ppc64le.whl", hash = "sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d", size = 5548822, upload-time = "2026-09-30T14:44:50.86Z" }, + { url = "https://files.pythonhosted.org/packages/02/a8/8df951850d6b31d2a00218f19e2b3f999523437ed7a819df7fa427942fca/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_28_x86_64.whl", hash = "sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7", size = 5001199, upload-time = "2026-09-30T14:44:53.379Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f9/36b3022218ce75b7cdf068fb95f809f9bd0d820e4955ef43b90c255cc7ac/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_31_armv7l.whl", hash = "sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408", size = 4629333, upload-time = "2026-09-30T14:44:55.635Z" }, + { url = "https://files.pythonhosted.org/packages/8c/72/20f99a219f6af47cdd1cbd978c243b92d71496e168a746138af44ded4f29/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_aarch64.whl", hash = "sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b", size = 4958822, upload-time = "2026-09-30T14:44:59.639Z" }, + { url = "https://files.pythonhosted.org/packages/f2/20/196f112617fb08eb4d608a2a6c422373d46f9cc2857f38fc0667033c0899/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_ppc64le.whl", hash = "sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd", size = 5506351, upload-time = "2026-09-30T14:45:02.267Z" }, + { url = "https://files.pythonhosted.org/packages/24/95/83378121ef3eaaaf71d4b781577ff794acb39b9e1b87a3f156898c8497ed/cryptography-50.0.2-cp315-abi3.abi3t-manylinux_2_34_x86_64.whl", hash = "sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c", size = 5000859, upload-time = "2026-09-30T14:45:05.009Z" }, + { url = "https://files.pythonhosted.org/packages/22/f7/70fd7ae4d1dbfa7ba29b02e1b9068771519a86027756510b700ce81086a8/cryptography-50.0.2-cp315-abi3.abi3t-musllinux_1_2_aarch64.whl", hash = "sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be", size = 5092151, upload-time = "2026-09-30T15:29:15.932Z" }, + { url = "https://files.pythonhosted.org/packages/d4/be/688367b74de86984bd58d8efacfc7c9e68b89a6a22ced0fb4f38db50254a/cryptography-50.0.2-cp315-abi3.abi3t-musllinux_1_2_x86_64.whl", hash = "sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020", size = 5286120, upload-time = "2026-09-30T15:29:18.309Z" }, + { url = "https://files.pythonhosted.org/packages/39/d1/55f8a3f2ef5d1529e16835ef10cf0fe3d559ce237b46dddc440c0bba3649/cryptography-50.0.2-cp315-abi3.abi3t-win_amd64.whl", hash = "sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c", size = 4111557, upload-time = "2026-09-30T15:29:20.155Z" }, + { url = "https://files.pythonhosted.org/packages/23/ad/ac987755d00e1e64273760228d2635ae38dae2be83e3c6e0d3289d91dec3/cryptography-50.0.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2", size = 3943588, upload-time = "2026-09-30T15:29:22.265Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8d/6d585339bedf85d45044c85d8412dac53f2bb6f918e8b7777efba1787844/cryptography-50.0.2-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd", size = 4756166, upload-time = "2026-09-30T15:29:24.58Z" }, + { url = "https://files.pythonhosted.org/packages/bf/f1/1c1f6874e8550cfddd4b688ceb38cefb6ed15ceed224d56f133f3d88c214/cryptography-50.0.2-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767", size = 4749145, upload-time = "2026-09-30T15:29:26.807Z" }, + { url = "https://files.pythonhosted.org/packages/c1/63/61b15dc1a8de03fe0adbe3fd7608b3ad5c73bf50993bbcb1faaa930afe33/cryptography-50.0.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454", size = 4763638, upload-time = "2026-09-30T15:29:28.588Z" }, + { url = "https://files.pythonhosted.org/packages/fc/35/b345bdfa40c9126df1a9d33236aa98418367931b8725f84fc3ae2b98dc59/cryptography-50.0.2-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd", size = 5382217, upload-time = "2026-09-30T15:29:30.589Z" }, + { url = "https://files.pythonhosted.org/packages/4f/87/ef344a9e616871f2519c22d6afcda79ddd5d35e9592d95eb6e677608d055/cryptography-50.0.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5", size = 4781387, upload-time = "2026-09-30T15:29:32.605Z" }, + { url = "https://files.pythonhosted.org/packages/90/5b/f2fdb13cd0b96f6f932c8627bb292a45f11c64d21620a8e120aee9a3b848/cryptography-50.0.2-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107", size = 4403790, upload-time = "2026-09-30T15:29:34.374Z" }, + { url = "https://files.pythonhosted.org/packages/bc/ce/7e4f662b1e3c393513569e402cfc85ac7da0bd3d5435e122a3140219eb2d/cryptography-50.0.2-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602", size = 4764319, upload-time = "2026-09-30T15:29:36.149Z" }, + { url = "https://files.pythonhosted.org/packages/3c/3f/86ff33ce34cc0de6847fb96e035a1a760d81652e38643f617c02ad32ef7a/cryptography-50.0.2-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227", size = 5338560, upload-time = "2026-09-30T15:29:39.053Z" }, + { url = "https://files.pythonhosted.org/packages/40/cf/6b5c8e2fd9202d98988ab7cb5cc5c991704c4ad55f492ff408e4969f83f1/cryptography-50.0.2-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c", size = 4780973, upload-time = "2026-09-30T15:29:41.251Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/8d6ebc7dded797bd0f0160d52188021211f011a2b164ef0ae1dac4587465/cryptography-50.0.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e", size = 4897738, upload-time = "2026-09-30T15:29:43.106Z" }, + { url = "https://files.pythonhosted.org/packages/d4/aa/f3f6e0de7e6253b8baa8b2d8fb9d50924fa75cee3d4624bd4bc1208ee923/cryptography-50.0.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94", size = 5058280, upload-time = "2026-09-30T15:29:44.827Z" }, + { url = "https://files.pythonhosted.org/packages/f6/b6/a1faf3a27ae9405fb34b1713cc73b2d8a26b04d5c561578fa2e6ef3e5bb9/cryptography-50.0.2-cp39-abi3-win_amd64.whl", hash = "sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de", size = 3854095, upload-time = "2026-09-30T15:29:46.782Z" }, + { url = "https://files.pythonhosted.org/packages/1d/7a/f08d34ce09d60f89ebd391e2ebc6ba2b995e6dd7552f41820f8085f94e53/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67", size = 4716035, upload-time = "2026-09-30T15:29:48.681Z" }, + { url = "https://files.pythonhosted.org/packages/45/67/e18fb65592451a2acb76e9f2fbe14e0f47a8318b4c5430f1633851d03daa/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a", size = 4726917, upload-time = "2026-09-30T15:29:50.608Z" }, + { url = "https://files.pythonhosted.org/packages/83/28/38fdce17e60f6b825e69fc3b7f75e70a6612759980704697e1de4cbfaf6e/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48", size = 4715341, upload-time = "2026-09-30T15:29:52.522Z" }, + { url = "https://files.pythonhosted.org/packages/b6/b1/d9121a717e0f893c64bd6ca7702614778d7df2a5c309128a002421788516/cryptography-50.0.2-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42", size = 4726322, upload-time = "2026-09-30T15:29:54.263Z" }, + { url = "https://files.pythonhosted.org/packages/36/8b/e6d153808bf353e152abd2fd4d8f09670d956ac78379ac46e60d7efbf04c/cryptography-50.0.2-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81", size = 3873097, upload-time = "2026-09-30T15:29:56.097Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1d/1271f287ff7170ddafc2aad36260c4eec20ccd2fea70f38455e9d56d427b/cryptography-50.0.2-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452", size = 3805376, upload-time = "2026-09-30T15:29:58.729Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "idna" +version = "3.20" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/08/8eea9d4b8302028f3abb2c0813953f7aec26d33b7a8960ed760e65ff29fa/idna-3.20.tar.gz", hash = "sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44", size = 216463, upload-time = "2026-09-17T14:11:04.752Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/58/a2/bb081bab032533a855d44de1d56f8e8426114ff1ba5d1f07a438a0a654f8/idna-3.20-py3-none-any.whl", hash = "sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c", size = 69583, upload-time = "2026-09-17T14:11:03.168Z" }, +] + +[[package]] +name = "joserfc" +version = "1.7.7" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +dependencies = [ + { name = "cryptography" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bd/15/48ff246732232d35ee234228def22b52455fcc55577f06146602399a29b0/joserfc-1.7.7.tar.gz", hash = "sha256:471d0fd12a5a0d1c0942de280f39efe6f597878315033270b504d4d006d25510", size = 237446, upload-time = "2026-10-19T00:30:29.974Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/9f/934db284aa22f37af59708e382903860d4b81329c137b1b0ed2745daeb65/joserfc-1.7.7-py3-none-any.whl", hash = "sha256:06979cfbab78bc802f14c0358f32969826cc26720e13cb38926ffdc86bc0cb2c", size = 71758, upload-time = "2026-10-19T00:30:28.498Z" }, +] + +[[package]] +name = "joserfc" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", +] +dependencies = [ + { name = "cryptography" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/31/5c3f27e82c92a7bbe1f028033ff19e0251540395c9be244c01a50de42bdb/joserfc-1.8.0.tar.gz", hash = "sha256:cbf03cb2c6db8cc5289f1ef8718842e53dba244b4c0de5fefa0c0eaee4bde8db", size = 241023, upload-time = "2026-11-03T10:45:57.948Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5e/7e/7ffaae13415e8f51c8e8d5d1845f2de7a27ebf2717e97a38d7e7446d6030/joserfc-1.8.0-py3-none-any.whl", hash = "sha256:176b836ac7ed9a46a88629e24076314b475f33a75d0bad7f26146e572eed7c79", size = 73147, upload-time = "2026-11-03T10:45:56.531Z" }, +] + +[[package]] +name = "keycardai-oauth" +source = { editable = "../../" } +dependencies = [ + { name = "cryptography" }, + { name = "httpx" }, + { name = "joserfc", version = "1.7.7", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "joserfc", version = "1.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, + { name = "pydantic" }, +] + +[package.metadata] +requires-dist = [ + { name = "blockbuster", marker = "extra == 'test'", specifier = ">=1.5.27" }, + { name = "cryptography", specifier = ">=50.0.0" }, + { name = "httpx", specifier = ">=0.28.1" }, + { name = "joserfc", specifier = ">=1.7.6" }, + { name = "pydantic", specifier = ">=2.11.7" }, + { name = "pytest", marker = "extra == 'test'", specifier = ">=8.4.1" }, + { name = "pytest-asyncio", marker = "extra == 'test'", specifier = ">=1.1.0" }, + { name = "starlette", marker = "extra == 'test'", specifier = ">=1.0.1" }, + { name = "uvicorn", marker = "extra == 'test'", specifier = ">=0.32.0" }, +] +provides-extras = ["test"] + +[package.metadata.requires-dev] +dev = [{ name = "pytest-cov", specifier = ">=6.2.1" }] + +[[package]] +name = "pycparser" +version = "3.11" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/da/a8/c5fdbeee588bb8ada9458774f43adf1bdd30bd59157055142183e769a024/pycparser-3.11.tar.gz", hash = "sha256:d875f09c3507d00e1aba0eecc6dcadc1352f30fff09dc6bff2f1c2935e97c2bc", size = 113796, upload-time = "2026-10-09T12:56:59.539Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/90/11/0e6f11117525ff0eec40ebac3d313376f102df93ca44ad9e893ee85e4f89/pycparser-3.11-py3-none-any.whl", hash = "sha256:51d5a8ba2be0bbe440b99d2112604c95bbbc3c2748a64260186c541e1729cd80", size = 51178, upload-time = "2026-10-09T12:56:58.131Z" }, +] + +[[package]] +name = "pycparser" +version = "3.12" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/27/eeb9f307bf07060f3d9f9aa0fb8c15b01bdfded0a941e4b2719c7f94cacd/pycparser-3.12.tar.gz", hash = "sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6", size = 158785, upload-time = "2026-10-22T13:40:03.56Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/ae/315bbeee126a769cbde43cf4908acb4b40408d8bf8bbf334dd7368d8dadf/pycparser-3.12-py3-none-any.whl", hash = "sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e", size = 62600, upload-time = "2026-10-22T13:40:02.021Z" }, +] + +[[package]] +name = "pydantic" +version = "2.14.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b4/fc/1203d011145c98ddce3cd2f505bb54375ef8d43223053df6bfcf3c746f46/pydantic-2.14.3.tar.gz", hash = "sha256:1054f237f4d4733e5a30e1e2333bd33a2004ab9ab1510bd053a9a31bb48e232d", size = 925636, upload-time = "2026-11-05T09:17:04.686Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/72/b8/b864503789ef5c58597d2a7b4adbee62c26440ab1e682581fc6838df8947/pydantic-2.14.3-py3-none-any.whl", hash = "sha256:3f7b347782ab7e4cf4c798496ae3a82787d9f21ec12676a9c564355eeef8daa8", size = 494071, upload-time = "2026-11-05T09:17:02.426Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.50.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/9c/0f/34f9ce4ba701dd0b815033ef94d99b56f66200e578ee6052aa3ac26f064e/pydantic_core-2.50.4.tar.gz", hash = "sha256:aead3b74b68396bf0feab5d57e050b730ded7df55853c1e048a87e00aaf033c6", size = 522249, upload-time = "2026-11-05T09:15:26.774Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/06/82/047d1c7dc4ec15130bbb3299d9e3cb85be945bb14db54e5ad5f1c91b5e75/pydantic_core-2.50.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:83d2beac85b757bfc404c5c0612df51c4ef33bbb7be65cf4a96b4da7cbc4ff4f", size = 2172546, upload-time = "2026-11-05T09:11:15.221Z" }, + { url = "https://files.pythonhosted.org/packages/95/ad/36732c76b5ad87647725681c8259376dddae8db9c3558e7cd99c25c7a9e1/pydantic_core-2.50.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:76e0065998159244ff4c097a6c05ff08019c6fbb6e597a85846e73044f0215b3", size = 2131205, upload-time = "2026-11-05T09:11:18.084Z" }, + { url = "https://files.pythonhosted.org/packages/d8/ac/8550a2ac336d3063759a73802f5c045d073125aea44927ba0fa790c55b0d/pydantic_core-2.50.4-cp310-cp310-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:25e7e1080f9f7ce7cd9d114b31470ce912771bd02f38c824721d3c35d312abff", size = 2284431, upload-time = "2026-11-05T09:11:20.005Z" }, + { url = "https://files.pythonhosted.org/packages/f2/d6/1a14b5da27def1db17274c215d4ab62c380b600689c4e54c4dc02c1b0cba/pydantic_core-2.50.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:c4c5a1770ecfe8bdb6c6f09f8d81ea4de04f7efb012fac1efa4ad315dccc1fd1", size = 2131058, upload-time = "2026-11-05T09:11:21.561Z" }, + { url = "https://files.pythonhosted.org/packages/01/de/075e68a5dcf8fc64ffad92740512dd9cb81ca7c29c5ca32de89cfbe0447d/pydantic_core-2.50.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:2f6767122b37c780bb756a720a4eef2bc6a050a0a1143428834b3cbc89448bd2", size = 2216460, upload-time = "2026-11-05T09:11:23.546Z" }, + { url = "https://files.pythonhosted.org/packages/0e/ad/b04b1b589495c0678e2a721ad07f95be47dbeb789fb50babc0e8ea7ed964/pydantic_core-2.50.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:86c7c4615634b5c57a79770f5b738354e45ae219a89949aeae84f19169a05283", size = 2403715, upload-time = "2026-11-05T09:11:25.105Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c1/9c8a9f6b42bd6080cde7143b9c3685cfa0859cea4e4860bd126df22602e2/pydantic_core-2.50.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:6c7d7b0b596319e9ce79ef96ce57a14054a2eac629c0588a0539187a218be799", size = 2454737, upload-time = "2026-11-05T09:11:26.787Z" }, + { url = "https://files.pythonhosted.org/packages/e3/df/cddc0729c366460763831e6087e88fc0197c78f34fc79ac993a41b5d0242/pydantic_core-2.50.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ed9c0b6f236648dbf30d57e9f57e1f74878caafa04833a19f529b5ba5164b7a8", size = 2257210, upload-time = "2026-11-05T09:11:28.805Z" }, + { url = "https://files.pythonhosted.org/packages/7a/54/4526352e8b6a849f661f55f025615eaa0b90c6eccd7588a5eff344c498ae/pydantic_core-2.50.4-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:dfcf6e51000b34f7026322cd9ea9bc340d745637e27e0bbc22f504b4f6b967ee", size = 2282013, upload-time = "2026-11-05T09:11:30.463Z" }, + { url = "https://files.pythonhosted.org/packages/64/df/6d70c52df400d5af3ccab490a3a3810f6419d99a7a34552dfb2c544de29d/pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:bd46bcc28ed85d3cf71581b42d90b4ebd1f2062f81879519fed209f8a4d1cfc6", size = 2322022, upload-time = "2026-11-05T09:11:32.344Z" }, + { url = "https://files.pythonhosted.org/packages/8b/f5/4ea1184eb9fe6b5f76e18195b10ab73e9d23f896144773d21bf6938442a8/pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:696613a0c0e7b2b35356e389ba4195ce20cfe7a2fc2e992c87d974d973eabec7", size = 2493416, upload-time = "2026-11-05T09:11:34.204Z" }, + { url = "https://files.pythonhosted.org/packages/6f/dd/918b33fd36c3a27139fb08cfb778b2392ab9e3f091948b4e4b2a325b0913/pydantic_core-2.50.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2980a701be88f9128a7470189fa3bcda5387f76c298a6f8e000fc29eb2a6f4e7", size = 2499741, upload-time = "2026-11-05T09:11:36.054Z" }, + { url = "https://files.pythonhosted.org/packages/7a/9f/dcde466c089e54cb0067a469f54cc8d00a51dd36c6c75eb664a2f1ed07f4/pydantic_core-2.50.4-cp310-cp310-win32.whl", hash = "sha256:dd8bed00731a21e3106e5dd6bbffb6c775a2c0bbc7c0c9face534d830057bdc9", size = 2134504, upload-time = "2026-11-05T09:11:37.693Z" }, + { url = "https://files.pythonhosted.org/packages/ee/d4/d1da421fe867903d5ddffb4d4b4928fd08af99de3e6ec21e758f9990337b/pydantic_core-2.50.4-cp310-cp310-win_amd64.whl", hash = "sha256:e512c75ec5cf4475c1aa50ad975ecdf253f4963b06e152e1a11edd6de4010753", size = 2259729, upload-time = "2026-11-05T09:11:39.567Z" }, + { url = "https://files.pythonhosted.org/packages/df/00/85e80811834d7cbd9bc228f9b5cdf8ec0edd69b55351ad720aac8c412d8c/pydantic_core-2.50.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:3e547ceec1da7382f01f9e13963023e53367a71802c88778b21b9645a077cbdf", size = 2170584, upload-time = "2026-11-05T09:11:41.139Z" }, + { url = "https://files.pythonhosted.org/packages/a3/f1/438de1fb99d717dcc6521922478dc16ef7b757302d4fc1f7faba3aaeac09/pydantic_core-2.50.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c813ada7a651193acda85b6bc1cf12abd4b37cd25c7c6a75d7183512cc374969", size = 2128471, upload-time = "2026-11-05T09:11:42.65Z" }, + { url = "https://files.pythonhosted.org/packages/b7/74/f21ab568c6d3f315988b40e53f809c95b63fafc5403332963aa6dfc2c054/pydantic_core-2.50.4-cp311-cp311-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:57fa0a9490785139f1a4e4f43891830d55dfe4408845c0c9cb5eff4aeaf75f69", size = 2281509, upload-time = "2026-11-05T09:11:44.359Z" }, + { url = "https://files.pythonhosted.org/packages/a1/42/24ed3ea8e2fb6463c9ba5b8b1f089e69040905c7fd81dcfa6f52fcc692d5/pydantic_core-2.50.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:30d4dc35bc0eea52202a90b3820445ee0072c820241bfa710a623a078c9b267b", size = 2128064, upload-time = "2026-11-05T09:11:46.01Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d1/44f541b2c18a46df6f18281a557acefeb5bbf0733a0b80b0a5e835e10ee4/pydantic_core-2.50.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:789f88dea57841cdebef392b5d6e90444d767117e9ff2e0d9172df5c9de6690c", size = 2214472, upload-time = "2026-11-05T09:11:47.503Z" }, + { url = "https://files.pythonhosted.org/packages/bd/1b/e9a9ad8733e8051abca9e4acce37ba3ddd13930fd3b8730f4c7816fa979a/pydantic_core-2.50.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:d690121e80ab16e623415351ab24713534d4e500b3cadff216409cb6826063d4", size = 2401153, upload-time = "2026-11-05T09:11:49.403Z" }, + { url = "https://files.pythonhosted.org/packages/79/84/d88e8e6aa42d4d677666d6625db9177ad6851be9e7564a25aeb0b0cbcaf2/pydantic_core-2.50.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b42f64825f5d750228f08318a9bf4d723b7ecb4c472aedcb3013c3ec2dc1f949", size = 2453307, upload-time = "2026-11-05T09:11:51.118Z" }, + { url = "https://files.pythonhosted.org/packages/56/51/cbb7a1bc0196ff94d3478d265eed7449f811759988eb760d41f4edd0893b/pydantic_core-2.50.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0574866e05f6adeecc520d87e87dd06210c0a51706341f6ef8421572f5a64444", size = 2253434, upload-time = "2026-11-05T09:11:52.997Z" }, + { url = "https://files.pythonhosted.org/packages/9e/04/206b4881d631033ae88f005da6e11bd610c850e1850217342c03053d253b/pydantic_core-2.50.4-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:dcf2c7eaaa4cafe8e49b017e5bb49e76e084ab6f0cd712ee4019c812b5cf68b8", size = 2279365, upload-time = "2026-11-05T09:11:54.822Z" }, + { url = "https://files.pythonhosted.org/packages/a1/7c/d815b5a3f83069b283d3b6a2e61de6e14baac3b20c6cd3418e9e629551cf/pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3b8ee2589a082739c522c1fe4be227412fcf108b903abb6672ae2f5570558882", size = 2319407, upload-time = "2026-11-05T09:11:56.46Z" }, + { url = "https://files.pythonhosted.org/packages/ee/00/c9a483276d1052d5142e1e01eccac97d939f83a3a3fd94c4766495a9b807/pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:aec3c2d741a8e3ee993de7f95f37afb51e31b169c95dbd29da4cf6688f340914", size = 2489900, upload-time = "2026-11-05T09:11:58.102Z" }, + { url = "https://files.pythonhosted.org/packages/2d/b5/8cd8ee29a1d63ad47f95593384df92476cef6896c644f280db0748b8e76b/pydantic_core-2.50.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8923fcd49f875e8a0448d7223d1fdf1a9973ae2d1f20d4158753ceb8909facd2", size = 2497732, upload-time = "2026-11-05T09:11:59.928Z" }, + { url = "https://files.pythonhosted.org/packages/60/31/050a48c0c373df16442ac07f3fa167414bb0e22f54a3e886f6d6cb7ad1d4/pydantic_core-2.50.4-cp311-cp311-win32.whl", hash = "sha256:fc04affef30be98c1f36f0c422a4061ef618fdc1dde79f5ad5458dd496fecffa", size = 2132347, upload-time = "2026-11-05T09:12:01.928Z" }, + { url = "https://files.pythonhosted.org/packages/c6/06/cebeeb7a8e87b42a3d8bc189d0d400e47df5d1736cb326764bae8a74c433/pydantic_core-2.50.4-cp311-cp311-win_amd64.whl", hash = "sha256:15bece43a02ad543c621c8305e67dedb5f27d378c5ba741e5a2c36523f8ef37f", size = 2255970, upload-time = "2026-11-05T09:12:03.888Z" }, + { url = "https://files.pythonhosted.org/packages/46/db/5b4bf14347da658c994483043fbabffedcab98929c41c261ec168c3c1f87/pydantic_core-2.50.4-cp311-cp311-win_arm64.whl", hash = "sha256:e498900bfbf7ddddd862f810440c09e9b81674739e8a11d619b40906dccd4a9a", size = 2196799, upload-time = "2026-11-05T09:12:05.389Z" }, + { url = "https://files.pythonhosted.org/packages/10/bf/d1f6b81709538f831ebe1c42f50fb89db3dfda06f9e9b1ea24e90fc69209/pydantic_core-2.50.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:32a991aebd165f227b7c7c60bb9d66c2c7de9c24308552da264c9938fde0f8d6", size = 2231444, upload-time = "2026-11-05T09:12:06.969Z" }, + { url = "https://files.pythonhosted.org/packages/c1/39/6618e541658d5a687a8d4962fc304350073a8f322bc4c62e8ed4c2d514d6/pydantic_core-2.50.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e20cbde2b6deb33a51d08cd168454dd9044ec7d4474056f4d98d63f51578783", size = 2108048, upload-time = "2026-11-05T09:12:08.85Z" }, + { url = "https://files.pythonhosted.org/packages/d9/54/1c941fffa4e14bfc9ab0cd4977075f0e03201447856130d08a33cd45e47b/pydantic_core-2.50.4-cp312-cp312-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:8cceae48ae7f94990c2f4e36291e9ec9868735e8b0f19e4489a17b0422338466", size = 2256866, upload-time = "2026-11-05T09:12:10.495Z" }, + { url = "https://files.pythonhosted.org/packages/61/a0/8028ef3e014be522ce43060aeac82a5be2288215e660866f5e6260acc123/pydantic_core-2.50.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:16902a147b3da4840612164a5e67947104d63e978f7a57c395877a5e26690b9c", size = 2125682, upload-time = "2026-11-05T09:12:12.278Z" }, + { url = "https://files.pythonhosted.org/packages/c3/f2/b98bb73b1734ec4e42e786a766abc24f3c89620a0ddbaf8aa14e4b4c628c/pydantic_core-2.50.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d6e3485a5e5c01fb5339c1ee3d4b9e21e2135a2a9d44caafb71acd994487ee7c", size = 2197108, upload-time = "2026-11-05T09:12:13.873Z" }, + { url = "https://files.pythonhosted.org/packages/f1/d1/7a7142786781400143e8806633fe5b65e2d407c311041fc9494490f05b18/pydantic_core-2.50.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:629eae995185540406e3635df5d5cf1d44f19ea240840b835d3f44541ff694d8", size = 2380521, upload-time = "2026-11-05T09:12:15.539Z" }, + { url = "https://files.pythonhosted.org/packages/b5/34/cf710ca48d4498b04a3ea605d45892675dc2b14a94a25121a8d03f56d3e9/pydantic_core-2.50.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:41b2cd8b29dbb5a4c9828a70f50d1abfc92011115c813213d3a91205c6f731b3", size = 2457436, upload-time = "2026-11-05T09:12:17.447Z" }, + { url = "https://files.pythonhosted.org/packages/91/23/e0c6e3cd09a0ac809953fea698c816b9f03bf0b35b6820c9553e4f5d85a8/pydantic_core-2.50.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c81d98e27d9d9261909dcccab1ba5d6ea1c98b0bb9470e368604614fd1d36ddd", size = 2261727, upload-time = "2026-11-05T09:12:19.097Z" }, + { url = "https://files.pythonhosted.org/packages/f9/00/292a0ed96d5d2d6edb49468ef481336e5b7e54f13435d73b7c912c891c23/pydantic_core-2.50.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:ca83a32b2b41653d89f09a3d22b770bca96da72273bef8f7a68136bdd1e8b823", size = 2262071, upload-time = "2026-11-05T09:12:20.78Z" }, + { url = "https://files.pythonhosted.org/packages/f8/36/d4690faf8c082eacf7754e52ab6bebe1bc73b167272e28699c00480ee908/pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:817953730e4a73a09008b010c4a42396cefe799616a22df2ac21d3927b3080cf", size = 2298931, upload-time = "2026-11-05T09:12:22.614Z" }, + { url = "https://files.pythonhosted.org/packages/21/17/b180af6d17cf6c8e0d3d2661fc501a4a40959744ca4947d6ad0db81b1416/pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:664e74848c2f5fc27db8505fe24e1ecd3ac669412913bf73d176916f86cc08e2", size = 2474285, upload-time = "2026-11-05T09:12:24.842Z" }, + { url = "https://files.pythonhosted.org/packages/6e/bb/7e44d4ac6e1292f1859384c688713045bdf5448e0635c49c003d2be3bb6c/pydantic_core-2.50.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:219114f8dcdcbe4720d82ef016b1287ce5a0a67d7c69ca61524eb72e82aac344", size = 2498172, upload-time = "2026-11-05T09:12:26.434Z" }, + { url = "https://files.pythonhosted.org/packages/d8/84/5101f35294579c4bef7dc32fd4f097d91eedac2e195894266bdabc1e6dfd/pydantic_core-2.50.4-cp312-cp312-win32.whl", hash = "sha256:67f7cc397e1d5556a801d1cba74de0d27d827eb242e6c036c0ca273c745414f1", size = 2119592, upload-time = "2026-11-05T09:12:27.971Z" }, + { url = "https://files.pythonhosted.org/packages/82/88/d438a8fcf3738e9ff2670f724047ca3893ec899bcd5cdfc077a2aab133c6/pydantic_core-2.50.4-cp312-cp312-win_amd64.whl", hash = "sha256:ea2f61b0bc12f3592288503961b764579dea0658852d96a0b3d823614d808821", size = 2264064, upload-time = "2026-11-05T09:12:29.538Z" }, + { url = "https://files.pythonhosted.org/packages/77/d4/4a0c73dc3ef9e50b122b8c3527afcded15a44838f1c9668d2d4b72cc09f0/pydantic_core-2.50.4-cp312-cp312-win_arm64.whl", hash = "sha256:32d6dda86383645ec428ea64dfc277036f5cbc60a72238eab28b91a3fdb9a113", size = 2167792, upload-time = "2026-11-05T09:12:31.103Z" }, + { url = "https://files.pythonhosted.org/packages/1b/21/39f8d97e7ea8e3083606ee9bb1d7f3ec70ded780bb6a872aad76c7eb08b2/pydantic_core-2.50.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0f87ae9db5ba8d8de40dcb93982cf8dd544e6552a80d3345af51941cc2146b80", size = 2232841, upload-time = "2026-11-05T09:12:32.617Z" }, + { url = "https://files.pythonhosted.org/packages/90/a9/fc89a632331882c4cb91b949003418e6f5085ddcf2c9b875d499682bca91/pydantic_core-2.50.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1239daaf063e62213ca1f34d96663900bd7510c42a786e843fd328af70e46445", size = 2108326, upload-time = "2026-11-05T09:12:34.419Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6d/4f6d00e9e4ba2a7bfb206ae49cb32a3ea90c4d658e62f8775277d75e8291/pydantic_core-2.50.4-cp313-cp313-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:1afefe44ec042fbabfb4483ea258c04cf75ff4ff328d754f09b321fdaa232aca", size = 2256276, upload-time = "2026-11-05T09:12:36.212Z" }, + { url = "https://files.pythonhosted.org/packages/b3/b8/936cb0d85a4082e902c7397db0f05c4372eac08372c8bd2d0b43088fcf17/pydantic_core-2.50.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:a9ee990bf2cfbd81574c5d4f9f6c9d480a14b5b43d2c4f2ca13f4c6f48089394", size = 2125469, upload-time = "2026-11-05T09:12:37.913Z" }, + { url = "https://files.pythonhosted.org/packages/66/a1/f3b551ce233dcac73286b8b2ae45c23232a9f41c68663e2dcce4bb2dbcfa/pydantic_core-2.50.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:ab2822bcdcefb54d1e8ca29f5e3ec3afe160fb794bb3a3a73b09d11ed2671104", size = 2196397, upload-time = "2026-11-05T09:12:39.725Z" }, + { url = "https://files.pythonhosted.org/packages/3d/93/a8a6e7e20826567a73e6f52416667698aa3de704804d7a49d25272246af4/pydantic_core-2.50.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:0001d6920e3a5d92758cda460d6dc9f918a78ad6d5d092f1c8b5395e6b775356", size = 2380442, upload-time = "2026-11-05T09:12:41.196Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ba/921d90c9d8ddfa653a35a92f2bbdcd650a9493f5c43f39cdfe4c56659cfa/pydantic_core-2.50.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:ad92d255a165cde5f9882ff69699eaf5495e0a1f32e97566bbbb80f11e46781f", size = 2457747, upload-time = "2026-11-05T09:12:42.723Z" }, + { url = "https://files.pythonhosted.org/packages/2b/c0/1c8f2c8f1b03d3fe2fdd7962df8f5a744fe48c90b4c49615e4eb77d04141/pydantic_core-2.50.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fb2bb5b557080da398b866408117d98fe9731a12334afd0cdff221b458cdc5dc", size = 2260946, upload-time = "2026-11-05T09:12:44.185Z" }, + { url = "https://files.pythonhosted.org/packages/07/ab/5b78a78f0c0f11c8b54fac214ed49cbb4795c34881aa5e5a15715917936f/pydantic_core-2.50.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:92f8f63df729061bb14558ed740e7a222f6e2aa6c2e6a5bcfb4e706676562049", size = 2261921, upload-time = "2026-11-05T09:12:45.706Z" }, + { url = "https://files.pythonhosted.org/packages/b3/e8/dd5d154cf3401f836d8754fdc1b82ecadd37944e4355d855e5b54c7d8ae5/pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:2a60ec2a57ac3ef3767e526e9bf706ec75aa3d79c4ea134d9d4fcf7c62a297a7", size = 2298475, upload-time = "2026-11-05T09:12:47.183Z" }, + { url = "https://files.pythonhosted.org/packages/b7/49/af059d9c4483cba168b17e5f84f1090a3e4547a02fc7698ebc231d48298a/pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a2f8716344bbbd10443391be0b1f2003b34949e3c4e6883005c2bc498ab6b64b", size = 2473226, upload-time = "2026-11-05T09:12:48.785Z" }, + { url = "https://files.pythonhosted.org/packages/71/ba/4e8cc3064e8bc2ea272cf80dfc57fa4e455f6835c1def21609a9b4f94135/pydantic_core-2.50.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:b300a30304c4c6aeab03ed06809819d9eceacdd58441d3c7dffe41edfd006091", size = 2498764, upload-time = "2026-11-05T09:12:50.316Z" }, + { url = "https://files.pythonhosted.org/packages/bf/96/0878499cfa88eb0b07762b488d3cc1b64cb156a4905db99a0d12096b2e17/pydantic_core-2.50.4-cp313-cp313-win32.whl", hash = "sha256:ef8a9ddb2e2a4eae4abb72dc0710eca6c2726779b0664bd10c3ce9fcfaed8c4e", size = 2119158, upload-time = "2026-11-05T09:12:51.834Z" }, + { url = "https://files.pythonhosted.org/packages/e7/e0/95b651213e79ffe0cbee855590bf5cfdf8e3a0d90a7fc73a080e63f7cc38/pydantic_core-2.50.4-cp313-cp313-win_amd64.whl", hash = "sha256:4c29b8f2d6417069bb1f257e6b9113f5d64dc2f554cc200ea90b4fe2c5cdb733", size = 2262887, upload-time = "2026-11-05T09:12:53.282Z" }, + { url = "https://files.pythonhosted.org/packages/08/d3/c3801dc75844a0b13d000bd575bf1b3b3a8aca9f63d19e1809f69c9c5121/pydantic_core-2.50.4-cp313-cp313-win_arm64.whl", hash = "sha256:a0c5210d038418a115e7cf8706bfa611bd14add2f5787274dba45aadca3155e0", size = 2167878, upload-time = "2026-11-05T09:12:54.677Z" }, + { url = "https://files.pythonhosted.org/packages/ee/ed/c9a4982ac3bbc78f27498d9efb85b3dabd739a1724db53c35cc4c018e1de/pydantic_core-2.50.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:5c074454dc6d4f6f4ba6561a56bf33a14db7651d882a5a5321ba3ae8868e082d", size = 2236841, upload-time = "2026-11-05T09:12:56.111Z" }, + { url = "https://files.pythonhosted.org/packages/56/32/92c174c17bfc5fc52d0c064e6a7969a727731e25829ede752fba8bacce0f/pydantic_core-2.50.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a4bb174bd65f795c39ad6642d9d5bdc43351b306b7d0a654ab0d0abb38be245f", size = 2108348, upload-time = "2026-11-05T09:12:57.638Z" }, + { url = "https://files.pythonhosted.org/packages/cb/cb/9f637d424a04d3edce7dd527da941950cce05a74b025eef3d54427b86c8e/pydantic_core-2.50.4-cp314-cp314-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:0ec20aca2b067369913716847f7dfe5f4dddf16a46965b7a70bbad5defaaba86", size = 2261331, upload-time = "2026-11-05T09:12:59.154Z" }, + { url = "https://files.pythonhosted.org/packages/91/ff/1117a3cccabb67305bd98d992a84eaf275939a9a043b4f14126ed7252e4f/pydantic_core-2.50.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:70dbc9f83c41f37a4faa62dae5203853847223a891da446f48ef2efcfd5df806", size = 2128667, upload-time = "2026-11-05T09:13:00.614Z" }, + { url = "https://files.pythonhosted.org/packages/93/45/6de1b4a6e8c415cd547f90d1408a711e7975116423e3eb3046061c62d7c7/pydantic_core-2.50.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:3de6c2a4df2af0ac9ab4dc1488746fe8b1a90e27955d870d9edda3187d20092b", size = 2198183, upload-time = "2026-11-05T09:13:02.259Z" }, + { url = "https://files.pythonhosted.org/packages/d0/bd/c6e64c315d35cc0783a0ea033a3dca062bc368905d0217eab6f6f63007de/pydantic_core-2.50.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:3a48a5254d15a0ad050318bfc7a9566d4ec740118187e8f303e47a6840287eb7", size = 2386279, upload-time = "2026-11-05T09:13:03.988Z" }, + { url = "https://files.pythonhosted.org/packages/33/ab/0d56280c89d3841381e9c699c3fa80e3dd3288edf5e7fe4d149136835dca/pydantic_core-2.50.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:0af56dbf8822ba9f4efcbbfdc15478f8b6fb08f1609860cb50aa2cc8476b3c34", size = 2464343, upload-time = "2026-11-05T09:13:05.98Z" }, + { url = "https://files.pythonhosted.org/packages/56/9c/621ad8f88590a92a086b1168dce09369d9c5e079e2e635e6646d248af55b/pydantic_core-2.50.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f1d62fb172db35c6478c9323da34ff37d1f3d37d7d44337a9d94ba8c583e5730", size = 2265388, upload-time = "2026-11-05T09:13:07.808Z" }, + { url = "https://files.pythonhosted.org/packages/f3/7b/cef68a667bf29b86e293a80a601d488a84c8f45508915ad6201fcfe1a798/pydantic_core-2.50.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:5c1013647be741647895c102831dcf79c34209662dbb683df9efb864417ed7d5", size = 2267012, upload-time = "2026-11-05T09:13:09.273Z" }, + { url = "https://files.pythonhosted.org/packages/4b/9f/3ae4d163d8feda2b52de88b5cd96b1c40f79d11503003b061136d2ece6ab/pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:aeb2e123cbf978a905e9f55155c1b8316fbbfa7cf64d04521fe174bab302d100", size = 2300478, upload-time = "2026-11-05T09:13:10.758Z" }, + { url = "https://files.pythonhosted.org/packages/e8/72/41881d31f6452430ed6792679c5391795910f0a27a6aebd424683e504ed6/pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:523466eba8ee10f7480f3c2057563145978011c583130d2cc01fb1e7af808e25", size = 2474874, upload-time = "2026-11-05T09:13:12.188Z" }, + { url = "https://files.pythonhosted.org/packages/05/ef/099874dd6d5ca1e49987dea87eecc05610183249450b1fff883d87f1e8eb/pydantic_core-2.50.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:c9e70012926e97069cdd09221861aff412aa94e4cac2e019055cdb79485b150c", size = 2502771, upload-time = "2026-11-05T09:13:13.981Z" }, + { url = "https://files.pythonhosted.org/packages/c6/07/a7d8615b8677bf69e24666bbce431299850c95a7b084649342582a1c3210/pydantic_core-2.50.4-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:e6da138a1ecc1341c8b788a5ee822670b03788e1f5decf7af9d461de6e508b8e", size = 1496509, upload-time = "2026-11-05T09:13:15.704Z" }, + { url = "https://files.pythonhosted.org/packages/ab/71/fdf2c25c3a4f89968263c1d896c933809ca8d2fb13443626648a17b2e296/pydantic_core-2.50.4-cp314-cp314-win32.whl", hash = "sha256:13b6dd62b5279f5b9d72f3bf918a35443ee8bd549241d9dc52d79a2c3b6d7016", size = 2122015, upload-time = "2026-11-05T09:13:17.09Z" }, + { url = "https://files.pythonhosted.org/packages/3a/9f/3554f0148b01ddaa5e678bf5fbce4679873534e5c0985cdf6c59c41dc9a9/pydantic_core-2.50.4-cp314-cp314-win_amd64.whl", hash = "sha256:b0cdb655fbd1562c2dfc9986f9103a106f7058cd0915afc6e656d4b1d73f3387", size = 2265109, upload-time = "2026-11-05T09:13:18.702Z" }, + { url = "https://files.pythonhosted.org/packages/ed/3c/196ef237d9ec5cca5ea9b773911dee1a387b9b1d4bfea05625b3e191a338/pydantic_core-2.50.4-cp314-cp314-win_arm64.whl", hash = "sha256:df1c174796cd63eb6b139f7daf783affe1f3ed659605850e843b24764c21bfc5", size = 2165745, upload-time = "2026-11-05T09:13:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/36/12/0ee82a41a3995f0b531cf14e0b823dc2365ba4a22330670fccaa72753f12/pydantic_core-2.50.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:edbca8789fd10f0de534b660a6b4c71f1fd18039679c918dad392ab044bb37e4", size = 2223917, upload-time = "2026-11-05T09:13:21.623Z" }, + { url = "https://files.pythonhosted.org/packages/90/2c/592f8404abbcc65a70e6a802d1dc8f11412af44913e5146cf5c345370074/pydantic_core-2.50.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:33b21f69540a12c2053cd1d95766d8bd9667a3897f7c712a642de8aa37eb0865", size = 2087372, upload-time = "2026-11-05T09:13:23.16Z" }, + { url = "https://files.pythonhosted.org/packages/ea/1d/c7111757c84b5b8c19b1e39ceb5e131e6e48e14169ec6004e0f8f28f43f3/pydantic_core-2.50.4-cp314-cp314t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:ffb616d8d55965839670301dc3bae3abacff560a7e137a89056058a8a9da4d96", size = 2275190, upload-time = "2026-11-05T09:13:24.634Z" }, + { url = "https://files.pythonhosted.org/packages/3d/ae/6c49cc9b8e66e61adee782d1763894bf64a357cddae82f725059b85bdc98/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6c5687b59b6ba0f663c4f2f15470f68507d6b45ccd3a19ee6d224f95cbee70d8", size = 2110343, upload-time = "2026-11-05T09:13:26.168Z" }, + { url = "https://files.pythonhosted.org/packages/ed/39/0ee5261d1daa9ad526371181c13696add0565251b2823f6e00a9a9af397d/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:c733087ecf7dde06b1d071679bfd5f3ba03266ba77814c1c7253bc48c9adedd9", size = 2207887, upload-time = "2026-11-05T09:13:27.681Z" }, + { url = "https://files.pythonhosted.org/packages/ac/b5/a0652c0e99590107e111088b6d059044380a787da9ffdd0b458ab4cd9453/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:94733cb447c37b0ce6f71b39ca1288d5f966a084023a5617b4cc35a852586859", size = 2404171, upload-time = "2026-11-05T09:13:29.864Z" }, + { url = "https://files.pythonhosted.org/packages/a3/85/d49f0b8e09a0ffc40dcefb604f9e6020e0d61b51a5f64a504f382fa84c39/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b26f39a5be3cd91a2035818be3d0ffdf5282c3e1f5f53d3b80b7024021acee52", size = 2466049, upload-time = "2026-11-05T09:13:31.658Z" }, + { url = "https://files.pythonhosted.org/packages/e6/76/f2b04d7c53edfd8136053c812ea49914fbf4091196cb7baf9ea326fa2ff8/pydantic_core-2.50.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:c856e439a9d54d514e81a7131229ba151cdf81df7c408e0f6c89340e5003dfe2", size = 2262062, upload-time = "2026-11-05T09:13:33.806Z" }, + { url = "https://files.pythonhosted.org/packages/24/60/016f14cea883adc33df90b8df220df934de49ded9640f45c8e92bb298494/pydantic_core-2.50.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:cbf0777d54672990b10cb8ca9b0523499e182d7e2ea39f86b138519a902aa601", size = 2263713, upload-time = "2026-11-05T09:13:35.337Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3f/b05828e978512973e7e215bab69e65e70d223d6309a17bf48084a50692f4/pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:edc17549ab592e33cfcaf285f047bb75fcd98f608aa9309af1187fd736ce9641", size = 2305044, upload-time = "2026-11-05T09:13:37.043Z" }, + { url = "https://files.pythonhosted.org/packages/91/c1/fca6c5f623ac45ba284713c614b30173aa0794899a0a457f866fa6f5e886/pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:23a9ba564b2db709ff16eca990992ba95a19069972b34bff87c81d4b473cd755", size = 2483506, upload-time = "2026-11-05T09:13:40.524Z" }, + { url = "https://files.pythonhosted.org/packages/94/c2/ec41f68d1208e53e1a73ead940c050c4316bbb555ba42676a5e949fd529e/pydantic_core-2.50.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:41f4f8ae714e4fea1d635880f8a1af715ecf080eed4d13c5b04a0f3210f9c61a", size = 2512832, upload-time = "2026-11-05T09:13:43.361Z" }, + { url = "https://files.pythonhosted.org/packages/43/22/58583b86309f70cce854e0e77c412839a56ac6c682d6060f5794afeff315/pydantic_core-2.50.4-cp314-cp314t-win32.whl", hash = "sha256:601fce6cea9ddeaa85329e12e7f351def38d233075f42a3012b9c48071b02941", size = 2101977, upload-time = "2026-11-05T09:13:45.735Z" }, + { url = "https://files.pythonhosted.org/packages/6b/28/193bc0994f7fe15f2874c1dfe2f3bc7872aed8283ffda2cf05fb9a5a06b4/pydantic_core-2.50.4-cp314-cp314t-win_amd64.whl", hash = "sha256:22e874666bdbd96d6bf629d32cd8ab376fedf1fd62585b52a42b9fa9fa6c20b6", size = 2240461, upload-time = "2026-11-05T09:13:48.38Z" }, + { url = "https://files.pythonhosted.org/packages/00/ed/5615cfdd5620a4926440eb1a2b73db0dc895824ba565ccaa8d9eb3a8e974/pydantic_core-2.50.4-cp314-cp314t-win_arm64.whl", hash = "sha256:71395a43da5584bb70556f380387e15f845c0dcf76373c1afbfa0025737576ac", size = 2168505, upload-time = "2026-11-05T09:13:50.762Z" }, + { url = "https://files.pythonhosted.org/packages/6d/9f/e6673535165d965a11c1d5339f53995f90234019827eaecb41a57e6e463d/pydantic_core-2.50.4-cp315-cp315-macosx_10_12_x86_64.whl", hash = "sha256:7ac2769a7ddd661e07e26c12220adc31b17014c48234b2a5a88993b8d4109e09", size = 2241950, upload-time = "2026-11-05T09:13:53.055Z" }, + { url = "https://files.pythonhosted.org/packages/6f/02/65951efadbf7826e6a270843f97e3da2ef726de2b6d9cd7c5dfa4c48807e/pydantic_core-2.50.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:930ad463d3fb7a340d323bcc496ec32dae469ec9974c29ff569f19806b6b03b4", size = 2112412, upload-time = "2026-11-05T09:13:55.309Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d3/4fb6e2e4a9e4951f1e05b198366ed5330e0874e83d52077e8b985350fe0e/pydantic_core-2.50.4-cp315-cp315-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:b867f9fd183d76977f810c626d539265183c25b2284762893a31e8d6cacc81c0", size = 2263220, upload-time = "2026-11-05T09:13:57.555Z" }, + { url = "https://files.pythonhosted.org/packages/63/83/42e70436c523357b49393b73f161f2741acf36003c8efd2f941d2be56bae/pydantic_core-2.50.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:49eb1241a969a5994db6880c18c012b6cbe2340343d8f529721571806583e500", size = 2134716, upload-time = "2026-11-05T09:13:59.413Z" }, + { url = "https://files.pythonhosted.org/packages/36/66/ed9b87f4751fd07e472c62cfe151f575abdf4c452fab943d35ba8efdc6c4/pydantic_core-2.50.4-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:477af785d1846e4e96bf56983b92ea7553aaeccdeb8acdaa55c7cee9eda0ae32", size = 2201901, upload-time = "2026-11-05T09:14:01.472Z" }, + { url = "https://files.pythonhosted.org/packages/2b/21/ff2e6ac7202b6d326e9f007c6082f6e6f3aaa063790ea2a355bdc985addc/pydantic_core-2.50.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:29358a8ca74e7d81158d14e2b10c904bd18773293ae3788716c0626fe0342347", size = 2389670, upload-time = "2026-11-05T09:14:03.431Z" }, + { url = "https://files.pythonhosted.org/packages/b9/34/e9348bc13d549641791a51843ed140fbb311d9066628e27477343412d5ad/pydantic_core-2.50.4-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:300753f71c73302e218124baf995f00058e085cd01869bd9610bcbd0bd4500c1", size = 2468951, upload-time = "2026-11-05T09:14:05.028Z" }, + { url = "https://files.pythonhosted.org/packages/ac/5e/145a02bf2b9f66981108caf6cc9e78917e31e4caca14d1e3ccd3ff2c7293/pydantic_core-2.50.4-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:26cb012c4b8ca9f847bd0ac15978bd3d0f55b050bfbe6c47355edfc7e945029b", size = 2272957, upload-time = "2026-11-05T09:14:06.587Z" }, + { url = "https://files.pythonhosted.org/packages/fd/38/b71c5b245e923f6cf144e948ed2a9d6b7fb97d8905784db8d860f5176b8b/pydantic_core-2.50.4-cp315-cp315-manylinux_2_31_riscv64.whl", hash = "sha256:9be1cfe715ecaa060ffd5d599ef410b94ef2697a0eed4cee562f788a2aa2175b", size = 2275028, upload-time = "2026-11-05T09:14:08.219Z" }, + { url = "https://files.pythonhosted.org/packages/ba/71/2504dacdc5cd3ea3ec5e68c9b6e097c979500bcff220b97046cc8ea3c1ad/pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_aarch64.whl", hash = "sha256:c81e35862aced259177a537ce1a6264c3a97bae1ced184ca9dc10ea754563688", size = 2305447, upload-time = "2026-11-05T09:14:09.795Z" }, + { url = "https://files.pythonhosted.org/packages/2c/90/904233a6c148bcac9f30bb96a2761e5fb52682d0d6de31a40c74a3714ceb/pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_armv7l.whl", hash = "sha256:b2f2d13239487cecaae98c9f4d5904ad0737643cdf8873c88ec6a78b12214f20", size = 2477852, upload-time = "2026-11-05T09:14:11.443Z" }, + { url = "https://files.pythonhosted.org/packages/72/33/1cbdcbf343ca23b507e967b21dddc4c8bf17a74c8b5cad59228c85ba4efc/pydantic_core-2.50.4-cp315-cp315-musllinux_1_1_x86_64.whl", hash = "sha256:e6b4b08d09054310a4dc389fa61ee22a7a5a292cb23ab8a985136ca8828bf924", size = 2506352, upload-time = "2026-11-05T09:14:13.165Z" }, + { url = "https://files.pythonhosted.org/packages/91/24/3ad9ea0876e6624c90967e5f1446e751b275cfdfaaf798a0d8e0b30025bc/pydantic_core-2.50.4-cp315-cp315-win32.whl", hash = "sha256:6619d49a89a15cd04334f76fec530c155923bfc60da74ff5d815a52629e1aa6c", size = 2127780, upload-time = "2026-11-05T09:14:17.52Z" }, + { url = "https://files.pythonhosted.org/packages/c0/3c/0582532b90a12492471977bdbca1317eca5144f6342ea581d2cee73ccd35/pydantic_core-2.50.4-cp315-cp315-win_amd64.whl", hash = "sha256:e5bd109d095aaae989a0463d5ef0fcc43e9ddd5de125e656d3c119a79e466380", size = 2270596, upload-time = "2026-11-05T09:14:20.955Z" }, + { url = "https://files.pythonhosted.org/packages/6c/50/967cfe4f7043a993c0c80cd3563c598b5281d2276aa775d0f6ff7f714271/pydantic_core-2.50.4-cp315-cp315-win_arm64.whl", hash = "sha256:6118e5a5550e36582e19bac1a403711a748f9f18251b054c326d3db02aaa7a18", size = 2170880, upload-time = "2026-11-05T09:14:24.822Z" }, + { url = "https://files.pythonhosted.org/packages/9e/71/3ec5bd8a82f792482f16d79fdbe8ce85aa71bf7147e556c5fc5f8546818d/pydantic_core-2.50.4-cp315-cp315t-macosx_10_12_x86_64.whl", hash = "sha256:d8201c9f9035520cdcc7dcad383b039ec8123969b87e01cf27c3dd883c02313b", size = 2233053, upload-time = "2026-11-05T09:14:27.942Z" }, + { url = "https://files.pythonhosted.org/packages/6e/2e/614dc37aedf8e9f811c1f2eedaf8eb09a7c196e2d137fe82bcc9d5662ca2/pydantic_core-2.50.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:1de7be9a66fc8536770481ab64a05aae5067c725f2b29a09543af00e6a417b97", size = 2090776, upload-time = "2026-11-05T09:14:30.281Z" }, + { url = "https://files.pythonhosted.org/packages/f9/14/aefc14e3e05013070ee959fc0b8703f6860a2776ed6e75b9c748f61aced0/pydantic_core-2.50.4-cp315-cp315t-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:789a6453e5ffd18a7ab6b8c3a0dd8403053829197ec258ecb90c604c21ffcc99", size = 2272481, upload-time = "2026-11-05T09:14:32.578Z" }, + { url = "https://files.pythonhosted.org/packages/13/c9/d56999aa7236dc9303091db2b1ef7303f0b022baf25ebf33cd200c0cb933/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:6348ad12fa741bcc9c2f173e99fbf27cbc038826d8c31a4a7d836eca27878ba2", size = 2113069, upload-time = "2026-11-05T09:14:34.69Z" }, + { url = "https://files.pythonhosted.org/packages/b7/d5/a62da9e72f272f198f6118c5457332bbd4b9fdc4b77858448120569756de/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.whl", hash = "sha256:d49127f137f871cde3c5650af33bbbdcee02679dae76e020902fa106f522b8ae", size = 2202754, upload-time = "2026-11-05T09:14:36.49Z" }, + { url = "https://files.pythonhosted.org/packages/37/4a/e7f21577f96e42ac3082cd014df398c1c913d482afac1c8ef17b9e039198/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:2f5cc5bcb94063fbbdfd285a2b302da34af07491337c10bb35de1d5220fa1583", size = 2411472, upload-time = "2026-11-05T09:14:38.63Z" }, + { url = "https://files.pythonhosted.org/packages/38/ad/c57c5e13bbfd3404ec1af519764aadbc52ee01e39f9f9ae9d28317f982f2/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:b99bed995ed7c41515c11fe2beb86f8a6cc298e5537cae2f736de2f982f74ef0", size = 2475330, upload-time = "2026-11-05T09:14:40.519Z" }, + { url = "https://files.pythonhosted.org/packages/6e/63/65cf0e1f1fd8cfaafee3c005712b8020e063b0f3e3571493ea68db5ec44f/pydantic_core-2.50.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:faa4e96385c820ce9d7f7a623486e23d4134ae3c9ba2071e44e0ab5a5a5002c4", size = 2265718, upload-time = "2026-11-05T09:14:42.379Z" }, + { url = "https://files.pythonhosted.org/packages/72/5d/fd9fdec9b25e2ef1f788970a84f749f0e28f166573c87654fd5387d8e5ce/pydantic_core-2.50.4-cp315-cp315t-manylinux_2_31_riscv64.whl", hash = "sha256:d6a166978f22f10cb91413f70519861605219346decf65bc79008f9257c94afe", size = 2273454, upload-time = "2026-11-05T09:14:44.286Z" }, + { url = "https://files.pythonhosted.org/packages/34/8c/19705c6d5eb72ff8c25006df8a375da7466176a5968781789e5415384f65/pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_aarch64.whl", hash = "sha256:a70d5effebd81ebd8e15a8aabdc7980832367b2b00c36543bac378977004cc80", size = 2314862, upload-time = "2026-11-05T09:14:45.97Z" }, + { url = "https://files.pythonhosted.org/packages/b8/fb/acefa27031aba2646b0d3026c4a1602e526489d39395ab17bc47f03234e3/pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_armv7l.whl", hash = "sha256:f8fd23653a252cefabea11cd041efd7b80bdf403e43a36dea53f9cb0aaa21f0f", size = 2479073, upload-time = "2026-11-05T09:14:47.526Z" }, + { url = "https://files.pythonhosted.org/packages/ef/e1/db08fa1e5edf1779fa0612f8d09f9030bdc513f593687c883cb781b86caa/pydantic_core-2.50.4-cp315-cp315t-musllinux_1_1_x86_64.whl", hash = "sha256:7646353a5a7c553c04167aca628e2550b538f492765b03ccf34321a560acc43c", size = 2521328, upload-time = "2026-11-05T09:14:49.042Z" }, + { url = "https://files.pythonhosted.org/packages/0d/51/bf1ec5b96c076d8d514b08f3bcffb3397df7a0fcc729eb960838a8bbe27f/pydantic_core-2.50.4-cp315-cp315t-win32.whl", hash = "sha256:65376dbe1ab4dbc768ca2b72b7c13993562c035f5925fd3bc7ff9c8c585c515d", size = 2107629, upload-time = "2026-11-05T09:14:50.891Z" }, + { url = "https://files.pythonhosted.org/packages/18/32/43d5db1824ec2314f737ff8d9962ff59954a74616d8656a8cc78790e45f1/pydantic_core-2.50.4-cp315-cp315t-win_amd64.whl", hash = "sha256:f08ee8248aad2d054e5bc4c73554d4505464698f6d754f16198dbc5764e9821d", size = 2244906, upload-time = "2026-11-05T09:14:53.056Z" }, + { url = "https://files.pythonhosted.org/packages/3a/c0/38c505004969c4641c3a077a8e72e354f02d5c06d8f51d7a103699704772/pydantic_core-2.50.4-cp315-cp315t-win_arm64.whl", hash = "sha256:da779ae50b46f3f7d1e1b5f362fdc0ad376a49fd55f6f3122dc2b6149936cdf7", size = 2179018, upload-time = "2026-11-05T09:14:54.448Z" }, + { url = "https://files.pythonhosted.org/packages/9a/18/2f6a25e9104d5af713d16671711927601da1f0db74e785be67bd590385c9/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:c04e9d920e2674f54651fd260a15c5d2843526c73d5242ee4311325ddc9573b3", size = 2212591, upload-time = "2026-11-05T09:14:56.262Z" }, + { url = "https://files.pythonhosted.org/packages/4c/1b/ba8b721af10a7659e7fbbef320ff8eb55462557a72607858af5a9bd22cb1/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:5bc1811ef2b4d4ba63e8e452f6e332b6374bd1d2cbbfdf66826c8cb1f71dd10d", size = 2048167, upload-time = "2026-11-05T09:14:57.681Z" }, + { url = "https://files.pythonhosted.org/packages/48/42/3f8638e7d90bdd9a7c7f3e5084723af59e7f43f15a292e242d35624073ce/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:0b059a7968b1911be5a2d9a8234827ab0bef9d1e465d4b42da525894143550e8", size = 2119548, upload-time = "2026-11-05T09:14:59.317Z" }, + { url = "https://files.pythonhosted.org/packages/e0/8d/4bfbacaf191f7939893d165e18eb301731fa3366c59a6e57336c4f168fbd/pydantic_core-2.50.4-graalpy312-graalpy250_312_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bee28aab5a580eec673f7b68dfa8dece3dd37bd207ef8d22fafe23a8e9837296", size = 2279952, upload-time = "2026-11-05T09:15:00.907Z" }, + { url = "https://files.pythonhosted.org/packages/9e/3a/d405a50e02ea81cd95e93fc97f43d351eeaa1707c28aa6fb58a9f1c1efa9/pydantic_core-2.50.4-graalpy313-graalpy253_313_native-macosx_11_0_arm64.whl", hash = "sha256:71e03d2ea1a221d020cfc5b6cc8bbbedef23a06704c70fcf4d0afb42965b22d1", size = 2049324, upload-time = "2026-11-05T09:15:02.379Z" }, + { url = "https://files.pythonhosted.org/packages/8f/3b/03e7992115e17cae4131ecd71aadb8fd5e4a04cc2aead72c3c27e9b453d1/pydantic_core-2.50.4-graalpy313-graalpy253_313_native-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:09450778e3ab58d3f565899fcfbf6c82926e31af29e28e799d1d50941316e0cb", size = 2119802, upload-time = "2026-11-05T09:15:03.901Z" }, + { url = "https://files.pythonhosted.org/packages/e3/d5/b76fc647e473377ca6e693c21549ee3a4a7677e4962c28ae4659337c5114/pydantic_core-2.50.4-graalpy313-graalpy253_313_native-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:4eb15be588407148ef5937dc8d9256a71f6b115e6cddadb7aa20b6ee384680dc", size = 2280639, upload-time = "2026-11-05T09:15:05.374Z" }, + { url = "https://files.pythonhosted.org/packages/d8/18/3ca5b3b8ce7a540305e6856d013e9c6b9c0fef93258fef6038db0beb233a/pydantic_core-2.50.4-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:39f489ce31272073e6e146f6781690f9c1ee8c126836e6403361ef91154d89fe", size = 2166960, upload-time = "2026-11-05T09:15:06.902Z" }, + { url = "https://files.pythonhosted.org/packages/a3/60/65d725001bffcde0170f6d37ae8bccce715e5311122eb6127f698115957e/pydantic_core-2.50.4-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:5b26e5f1793b96cdc60242bf38da86ff24a27a708aa396214cac9b534bf571c7", size = 2085636, upload-time = "2026-11-05T09:15:08.395Z" }, + { url = "https://files.pythonhosted.org/packages/ac/12/934cf1d44a3fee3c47231d4690dddee19264150c3aa59a3ddf66fa43454d/pydantic_core-2.50.4-pp311-pypy311_pp73-manylinux1_i686.manylinux_2_5_i686.whl", hash = "sha256:7210398a1607ad607dc73196e575b3148b00a333cbb602ddbe1b60ba54554f43", size = 2284621, upload-time = "2026-11-05T09:15:09.82Z" }, + { url = "https://files.pythonhosted.org/packages/c4/91/52248eee98d76f8d9239166d24928f805292df16729109f4f189cdb59be4/pydantic_core-2.50.4-pp311-pypy311_pp73-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2f42584e5785385f681163a42506cab0d51295e17599a648396c52a7046c1372", size = 2277673, upload-time = "2026-11-05T09:15:11.236Z" }, + { url = "https://files.pythonhosted.org/packages/9f/89/900a7970ef19843aa79522a95b461e9c365b7fedd7ee80ef28a84dae9a41/pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:2039e323acee9abfec1fb5f661776e8965fe5928f3b7f8431900a774cba5c317", size = 2297354, upload-time = "2026-11-05T09:15:12.798Z" }, + { url = "https://files.pythonhosted.org/packages/de/ec/053d829437f70070cdd7116a0257cc0da651103328ff1e9e82954c45efd6/pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:71ade6d2e445839350d589ff99bbddfde16f3f32db28da5c894a09f99c8b2a03", size = 2469913, upload-time = "2026-11-05T09:15:14.319Z" }, + { url = "https://files.pythonhosted.org/packages/80/af/207c821cb0813e16d630660e0073491e3ab07370efaa6fa0b8b10fffb7b6/pydantic_core-2.50.4-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:d7d406709ae924cf0b08b8282ca2f0e1c90526911d93bc040557cbc83b74c55f", size = 2503746, upload-time = "2026-11-05T09:15:15.736Z" }, + { url = "https://files.pythonhosted.org/packages/e7/ca/8a053f24e22d8150349cabaecb2f35c89dcf07fbaadb5e48295184dd0e5b/pydantic_core-2.50.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:7472c39480ccc11dda69a196d1b7c7a6b48eb6594b77f05d945599d3e47f731c", size = 2333540, upload-time = "2026-11-05T09:15:17.883Z" }, + { url = "https://files.pythonhosted.org/packages/ac/9d/41b374c62cdb87f84081e2ef2963a115eacc6284a26dbc96bb83568e83ec/pydantic_core-2.50.4-pp311-pypy311_pp80-macosx_10_12_x86_64.whl", hash = "sha256:b67d38e8bb0ade7e6e84575e4bb153fab35b122458077273aeb08fdf12be9d2c", size = 2166962, upload-time = "2026-11-05T09:15:20.276Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4f/51ef440ee346d4388a2c4a3ac4b271fcc7b1d3ff68be8da2ed2be4d488b0/pydantic_core-2.50.4-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:4eda7e3fdef382b7d4492745988a5baaf6953923a337f8b9dde5f76fa8afde20", size = 2085634, upload-time = "2026-11-05T09:15:21.953Z" }, + { url = "https://files.pythonhosted.org/packages/4b/5f/c9ed62b96beb9050db221d29e81856b6e28f277db601f8b0c3a08f8cf913/pydantic_core-2.50.4-pp311-pypy311_pp80-manylinux_2_28_x86_64.whl", hash = "sha256:474f7e598c7902165662a5d5160d3fce31037890a2975a9871ebf7c05862300b", size = 2277804, upload-time = "2026-11-05T09:15:23.836Z" }, + { url = "https://files.pythonhosted.org/packages/63/bd/b912a5e251ef10ed7be5e543a2bfbeebb0c79bf6302bee786f8dc3bf4341/pydantic_core-2.50.4-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:3e0b395648c6cb871bceb2906907f255dc876ec425f2d5b024e129985cea8519", size = 2333539, upload-time = "2026-11-05T09:15:25.354Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ff/50/0195198eb1d75bab716bb0a813abea4cc394bfa17a92a189f021a34859af/typing_inspection-0.4.5.tar.gz", hash = "sha256:7f16c411e7930dc79596d42ab44672a3fe5f60eb34b781a1647e7872363120c7", size = 81194, upload-time = "2026-11-04T14:13:23.774Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/0c/ea2544850a7c135e15033a5c7a8e7211136184b7ae63e2239d557c2b3019/typing_inspection-0.4.5-py3-none-any.whl", hash = "sha256:bc210535442b39e1bf2805e0c7a17dfd6a4ace760c84c7f7d16245d23a6b1c39", size = 14874, upload-time = "2026-11-04T14:13:22.616Z" }, +] diff --git a/packages/oauth/pyproject.toml b/packages/oauth/pyproject.toml index 7f5dfb30..d4ea8e37 100644 --- a/packages/oauth/pyproject.toml +++ b/packages/oauth/pyproject.toml @@ -35,6 +35,8 @@ test = [ "pytest>=8.4.1", "pytest-asyncio>=1.1.0", "blockbuster>=1.5.27", + "starlette>=1.0.1", + "uvicorn>=0.32.0", ] [project.urls] diff --git a/packages/oauth/src/keycardai/oauth/__init__.py b/packages/oauth/src/keycardai/oauth/__init__.py index a0fc6d36..3659345d 100644 --- a/packages/oauth/src/keycardai/oauth/__init__.py +++ b/packages/oauth/src/keycardai/oauth/__init__.py @@ -31,6 +31,21 @@ ) """ +from .agent import ( + AGENT_SOCKET_ENV, + AgentCode, + AgentError, + AgentResponseError, + AgentTokenSource, + ResourceAuth, + ResourceTokenSource, + is_application_not_found, + is_authorization_required, + is_declined, + is_prompter_unavailable, + is_rate_limited, + is_unavailable, +) from .client import AsyncClient, Client from .exceptions import ( PERMANENT_ERROR_CODES, @@ -125,6 +140,20 @@ "BearerAuth", "NoneAuth", "MultiZoneBasicAuth", + # === Local Keycard Agent === + "AGENT_SOCKET_ENV", + "AgentCode", + "AgentError", + "AgentResponseError", + "AgentTokenSource", + "ResourceAuth", + "ResourceTokenSource", + "is_application_not_found", + "is_authorization_required", + "is_declined", + "is_prompter_unavailable", + "is_rate_limited", + "is_unavailable", # === Utility Functions === "extract_bearer_token", "validate_bearer_format", diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py new file mode 100644 index 00000000..36ed9abc --- /dev/null +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -0,0 +1,493 @@ +"""Resource tokens from the local Keycard agent. + +An application running beside the Keycard CLI, under ``keycard run`` or +reaching the ``keycard agent`` daemon, obtains an access token for a named +third-party resource with no application credential of its own: it asks the +agent over a Unix socket, and the agent mints the token with the developer's +zone session once a human approves the request. + +The agent speaks Connect, addressed by URL path. Its generated stubs are not +published, so the unary JSON encoding is spoken directly over httpx; the +procedure path is the wire contract. + +Spec: keycard-sdk-spec, specs/delegated-access/local-agent-token-source.md. +""" + +from __future__ import annotations + +import json +import math +import os +import re +import sys +import time +from collections.abc import AsyncGenerator, Callable, Generator, Mapping, Sequence +from dataclasses import dataclass +from datetime import datetime, timedelta, timezone +from enum import Enum +from typing import Protocol, runtime_checkable + +import httpx + +from .exceptions import ConfigError, NetworkError, OAuthError, OAuthHttpError +from .types.models import TokenResponse +from .types.oauth import TokenType + +AGENT_SOCKET_ENV = "KEYCARD_SOCKET" + +ISSUE_TOKEN_PATH = "/keycard.agent.v1.AgentService/IssueToken" + +# The host is a placeholder; the transport dials the Unix socket. +_ISSUE_TOKEN_URL = "http://keycard-agent" + ISSUE_TOKEN_PATH + +_OPERATION = "keycard agent IssueToken" + +_ERROR_BODY_LIMIT = 64 * 1024 + + +class AgentCode(str, Enum): + """Connect error codes the Keycard agent refuses a request with. + + ``AgentError.code`` is the code as received, so it may be one this + enumeration does not list; compare against these members to branch on a + code that has no predicate. + """ + + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + UNAUTHENTICATED = "unauthenticated" + NOT_FOUND = "not_found" + UNAVAILABLE = "unavailable" + INVALID_ARGUMENT = "invalid_argument" + + +_RETRYABLE_CODES = frozenset({AgentCode.RESOURCE_EXHAUSTED, AgentCode.UNAVAILABLE}) + + +class AgentError(OAuthError): + """The local Keycard agent refused to issue a token. + + ``code`` is the Connect error code and ``message`` the agent's + explanation, which names the remedy where there is one. Prefer the + ``is_*`` predicates to matching on the message. + """ + + def __init__(self, code: str, message: str = ""): + super().__init__( + f"keycard agent: {code}: {message}" if message else f"keycard agent: {code}" + ) + self.code = code + self.message = message + + @property + def retryable(self) -> bool: + """True for ``resource_exhausted`` and ``unavailable`` only.""" + return self.code in _RETRYABLE_CODES + + +class AgentResponseError(OAuthError): + """The agent answered 200 with a response that cannot be used. + + Distinct from AgentError, which is the agent refusing. ``message`` says + what was wrong and never includes the token. Never retryable. + """ + + def __init__(self, message: str): + super().__init__(f"keycard agent: {message}") + self.message = message + + +def _agent_code(err: BaseException | None) -> str | None: + seen: set[int] = set() + while err is not None and id(err) not in seen: + if isinstance(err, AgentError): + return err.code + seen.add(id(err)) + err = err.__cause__ + return None + + +def is_declined(err: BaseException | None) -> bool: + """Issuance was refused (``permission_denied``). + + Wider than the name: besides a human declining, this covers an expired or + failed prompt, an authorization server that rejected the exchange, and a + daemon holding no session for the requested ``org`` and ``zone``. Do not + retry automatically: the agent remembers approvals but not declines, so a + retry puts the same prompt in front of the human again. + """ + return _agent_code(err) == AgentCode.PERMISSION_DENIED + + +def is_rate_limited(err: BaseException | None) -> bool: + """The agent is bounding how often it prompts (``resource_exhausted``). Back off.""" + return _agent_code(err) == AgentCode.RESOURCE_EXHAUSTED + + +def is_prompter_unavailable(err: BaseException | None) -> bool: + """The host has no way to ask a human (``failed_precondition``). + + Retrying will not help; a caller with another credential falls back to it. + """ + return _agent_code(err) == AgentCode.FAILED_PRECONDITION + + +def is_authorization_required(err: BaseException | None) -> bool: + """The developer must act first (``unauthenticated``). + + Sign in, authorize the resource interactively, or repair an unusable zone + session or device key. ``AgentError.message`` names the command. + """ + return _agent_code(err) == AgentCode.UNAUTHENTICATED + + +def is_application_not_found(err: BaseException | None) -> bool: + """The declared ``app_id`` names no application in the zone (``not_found``).""" + return _agent_code(err) == AgentCode.NOT_FOUND + + +def is_unavailable(err: BaseException | None) -> bool: + """A service behind the agent could not be reached (``unavailable``). Transient.""" + return _agent_code(err) == AgentCode.UNAVAILABLE + + +@runtime_checkable +class ResourceTokenSource(Protocol): + """Supplies an access token for a named resource. + + ``resource`` is an RFC 8707 resource indicator. + """ + + async def resource_token( + self, resource: str, scopes: Sequence[str] | None = None + ) -> TokenResponse: ... + + +class _SocketRule(str, Enum): + OPTION = "option" + ENV = "env" + DEFAULT = "default" + + +@dataclass(frozen=True) +class _Socket: + path: str + rule: _SocketRule + + def describe(self) -> str: + if self.rule is _SocketRule.OPTION: + return f"{_OPERATION} on {self.path} (the socket option)" + if self.rule is _SocketRule.ENV: + return f"{_OPERATION} on {self.path} (from {AGENT_SOCKET_ENV})" + return ( + f"{_OPERATION} on {self.path} (the keycard agent daemon's default " + f"socket, since {AGENT_SOCKET_ENV} is not set; start the daemon with " + "`keycard agent start`, or run this process under `keycard run`)" + ) + + +def _resolve_socket(socket: str | None, env: Mapping[str, str]) -> _Socket: + """Choose the agent socket by the spec's three ordered rules. + + Transcribes the Keycard CLI's ``Config.AgentSocketPath``, the canonical + source for the daemon's socket, except that only the environment is read, + never ``keycard.toml``. Computes a path and touches nothing on disk. + """ + if socket: + return _Socket(socket, _SocketRule.OPTION) + + def var(name: str) -> str | None: + return env.get(name) or None + + if path := var(AGENT_SOCKET_ENV): + return _Socket(path, _SocketRule.ENV) + + if sys.platform == "win32": + raise ConfigError( + f"{AGENT_SOCKET_ENV} is not set, and the keycard agent daemon's " + "default socket is a Unix socket, unavailable on Windows; pass " + f"socket= or set {AGENT_SOCKET_ENV}" + ) + + if agent_dir := var("KEYCARD_AGENT_DIR"): + return _Socket(os.path.join(agent_dir, "agent.sock"), _SocketRule.DEFAULT) + + if runtime := var("XDG_RUNTIME_DIR"): + run_dir = os.path.join(runtime, "keycard") + else: + if xdg_state := var("XDG_STATE_HOME"): + state_dir = os.path.join(xdg_state, "keycard") + else: + home = var("KEYCARD_HOME") or var("HOME") + if home is None: + raise ConfigError( + f"cannot locate the keycard agent socket: {AGENT_SOCKET_ENV} " + "is not set, and neither KEYCARD_HOME nor HOME is set; pass " + f"socket= or set {AGENT_SOCKET_ENV}" + ) + state_dir = os.path.join(home, ".local", "state", "keycard") + run_dir = os.path.join(state_dir, "run") + return _Socket(os.path.join(run_dir, "agent.sock"), _SocketRule.DEFAULT) + + +class AgentTokenSource: + """A ResourceTokenSource backed by the local Keycard agent. + + Construction opens no connection and does not resolve the socket; both + happen on each ``resource_token`` call, so a changed environment takes + effect on the next call. The first request for an approval blocks for as + long as a human takes to answer the prompt, so no timeout is applied: + bound the call with ``asyncio.timeout`` or cancellation. Tokens are not + cached here; the agent caches them, and each call is one request to it. + + Args: + socket: Path of the agent's Unix socket. Defaults to + ``KEYCARD_SOCKET`` in ``env``, else the ``keycard agent`` daemon's + default socket, located the way the Keycard CLI locates it from + ``KEYCARD_AGENT_DIR``, ``XDG_RUNTIME_DIR``, ``XDG_STATE_HOME``, + ``KEYCARD_HOME`` and ``HOME``. The socket's owner is not checked: + pass it explicitly when its directory may be shared with other + users. + env: Where the socket variables are read from. Defaults to + ``os.environ``, read on every call. + workload: Name shown to the human in the approval prompt. + Self-declared and unauthenticated. + app_id: Identifier of the Keycard application the caller says it acts + for, as set on the application, not its public id. Matched + exactly. Self-declared and unauthenticated. + org: Organization id. Needed by the multi-zone ``keycard agent`` + daemon; ignored by the per-session ``keycard run`` server. + zone: Zone id, set alongside ``org``. + clock: Wall-clock seconds since the epoch, for computing + ``expires_in``. + """ + + def __init__( + self, + *, + socket: str | None = None, + env: Mapping[str, str] | None = None, + workload: str = "", + app_id: str = "", + org: str = "", + zone: str = "", + clock: Callable[[], float] = time.time, + _transport: httpx.AsyncBaseTransport | None = None, + ): + self.socket = socket + self.workload = workload + self.app_id = app_id + self.org = org + self.zone = zone + self._env = env + self._clock = clock + self._transport = _transport + + async def resource_token( + self, resource: str, scopes: Sequence[str] | None = None + ) -> TokenResponse: + """Ask the agent for a token for ``resource`` carrying ``scopes``. + + ``resource`` and each scope are sent exactly as given. + + Raises: + ConfigError: ``resource`` is empty, or the default socket cannot + be located. + NetworkError: The socket cannot be reached, or the connection + failed mid-request. The message names the socket and how it + was chosen. + AgentError: The agent refused. + OAuthHttpError: A non-200 response that is not a Connect error. + AgentResponseError: A 200 response that cannot be used. + """ + if not resource: + raise ConfigError("resource is required") + if isinstance(scopes, str): + raise ConfigError("scopes must be a list of strings, not a string") + + socket = _resolve_socket( + self.socket, os.environ if self._env is None else self._env + ) + + fields: dict[str, object] = { + "resource": resource, + "scopes": list(scopes or ()), + "workload": self.workload, + } + # An agent predating the field drops it, and an empty value is not a + # declaration, so it is omitted rather than sent empty. + if self.app_id: + fields["appId"] = self.app_id + headers = {"Connect-Protocol-Version": "1"} + if self.org: + headers["Keycard-Org"] = self.org + if self.zone: + headers["Keycard-Zone"] = self.zone + + transport = self._transport or httpx.AsyncHTTPTransport(uds=socket.path) + try: + async with ( + httpx.AsyncClient(transport=transport, timeout=None) as client, + client.stream( + "POST", _ISSUE_TOKEN_URL, json=fields, headers=headers + ) as response, + ): + if response.status_code != 200: + raise _refusal(response.status_code, await _read_prefix(response)) + content = await response.aread() + except httpx.TransportError as err: + raise NetworkError(err, operation=socket.describe()) from err + + return self._token(content) + + def _token(self, content: bytes) -> TokenResponse: + try: + body = json.loads(content) + except ValueError: + # Not chained: the decode error holds the whole document, which + # may contain the token. + raise AgentResponseError("response is not JSON") from None + if not isinstance(body, dict): + raise AgentResponseError("response is not a JSON object") + + token = body.get("token") + if not isinstance(token, str) or not token: + raise AgentResponseError("response has no token") + # The token may be an opaque third-party secret headed for an + # Authorization header, where a control character splits or ends it. + if any(c < " " or c == "\x7f" for c in token): + raise AgentResponseError("token contains a control character") + + expires_in = None + expires_at = body.get("expiresAt") + if expires_at is not None: + seconds, nanos = _parse_rfc3339(expires_at) + # Whole seconds are subtracted before the fraction is added: an + # epoch timestamp as a float has no room for nanoseconds. + expires_in = max(0, math.floor(seconds - self._clock() + nanos / 1e9)) + + granted = body.get("scopes") + if granted is not None and not ( + isinstance(granted, list) and all(isinstance(s, str) for s in granted) + ): + raise AgentResponseError("scopes is not a list of strings") + + return TokenResponse( + access_token=token, + token_type=TokenType.BEARER, + expires_in=expires_in, + # Absent or empty means the grant is unknown, so it is never + # filled in from the request. + scope=list(granted) if granted else None, + ) + + +async def _read_prefix(response: httpx.Response) -> bytes: + prefix = bytearray() + async for chunk in response.aiter_bytes(): + prefix += chunk + if len(prefix) >= _ERROR_BODY_LIMIT: + break + return bytes(prefix[:_ERROR_BODY_LIMIT]) + + +def _refusal(status: int, prefix: bytes) -> OAuthError: + try: + body = json.loads(prefix) + except ValueError: + body = None + if not isinstance(body, dict): + return OAuthHttpError(status, operation=_OPERATION) + code = body.get("code") + if not isinstance(code, str) or not code: + return OAuthHttpError(status, operation=_OPERATION) + message = body.get("message") + return AgentError(code, message if isinstance(message, str) else "") + + +# protojson renders a Timestamp with up to nine fractional digits, beyond +# datetime's microseconds, and before Python 3.11 fromisoformat accepts +# neither a "Z" suffix nor a fraction of other than three or six digits. +_RFC3339 = re.compile( + r"(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?" + r"(?:([Zz])|([+-])(\d{2}):(\d{2}))" +) + + +def _parse_rfc3339(value: object) -> tuple[int, int]: + """Parse ``value`` into whole epoch seconds and nanoseconds.""" + match = _RFC3339.fullmatch(value) if isinstance(value, str) else None + if match is None: + raise AgentResponseError(f"expiresAt {value!r} is not an RFC 3339 timestamp") + year, month, day, hour, minute, second, fraction, z, sign, off_h, off_m = ( + match.groups() + ) + try: + offset = timedelta(0) + if not z: + offset = timedelta(hours=int(off_h), minutes=int(off_m)) + if sign == "-": + offset = -offset + when = datetime( + int(year), + int(month), + int(day), + int(hour), + int(minute), + int(second), + tzinfo=timezone(offset), + ) + except ValueError: + raise AgentResponseError( + f"expiresAt {value!r} is not an RFC 3339 timestamp" + ) from None + epoch = datetime(1970, 1, 1, tzinfo=timezone.utc) + return (when - epoch) // timedelta(seconds=1), int((fraction or "0").ljust(9, "0")) + + +class ResourceAuth(httpx.Auth): + """Attaches a resource token to each request an ``httpx.AsyncClient`` sends. + + The spec's resource transport. It binds one source to one resource and + its scopes and never derives a resource from the request URL; a client + calling several resources uses one instance per resource. Each request + gets ``Authorization: Bearer ``, replacing any existing value. + Errors from the source propagate unwrapped, so the ``is_*`` predicates + apply, and the request is not sent. No timeout is added: obtaining the + token can block on a human. + + Works with ``httpx.AsyncClient`` only. A synchronous ``httpx.Client`` + raises ConfigError rather than sending the request unauthenticated. + """ + + def __init__( + self, + source: ResourceTokenSource, + resource: str, + scopes: Sequence[str] | None = None, + ): + if source is None: + raise ConfigError("ResourceAuth requires a source") + if not resource: + raise ConfigError("ResourceAuth requires a resource") + if isinstance(scopes, str): + raise ConfigError("scopes must be a list of strings, not a string") + self.source = source + self.resource = resource + self.scopes = list(scopes or ()) + + async def async_auth_flow( + self, request: httpx.Request + ) -> AsyncGenerator[httpx.Request, httpx.Response]: + token = await self.source.resource_token(self.resource, self.scopes) + request.headers["Authorization"] = f"Bearer {token.access_token}" + yield request + + def sync_auth_flow( + self, request: httpx.Request + ) -> Generator[httpx.Request, httpx.Response, None]: + # httpx.Auth's default sync flow passes the request through untouched, + # which would send it unauthenticated. + raise ConfigError("ResourceAuth requires httpx.AsyncClient") + yield request # pragma: no cover diff --git a/packages/oauth/tests/keycardai/oauth/conftest.py b/packages/oauth/tests/keycardai/oauth/conftest.py new file mode 100644 index 00000000..d9b48c03 --- /dev/null +++ b/packages/oauth/tests/keycardai/oauth/conftest.py @@ -0,0 +1,112 @@ +"""Fixtures shared by the oauth package's tests. + +``agent_server`` serves a fake Keycard agent, a Starlette app under uvicorn, +on a real Unix socket, so the local agent token source's dialer is exercised +without the ``keycard`` binary. +""" + +import asyncio +import json +import os +import shutil +import tempfile +from collections.abc import AsyncIterator, Awaitable, Callable, Iterator +from dataclasses import dataclass, field + +import pytest +import pytest_asyncio +import uvicorn +from starlette.applications import Starlette +from starlette.requests import Request +from starlette.responses import JSONResponse, Response +from starlette.routing import Route + +ISSUE_TOKEN_PATH = "/keycard.agent.v1.AgentService/IssueToken" + + +@dataclass +class AgentCall: + """One IssueToken request as the fake agent received it.""" + + headers: dict[str, str] + body: dict + + +def issued(_: AgentCall) -> Response: + return JSONResponse({"token": "agent-token"}) + + +@dataclass +class FakeAgent: + """A stand-in for the Keycard agent serving IssueToken on ``path``. + + ``respond`` decides each answer from the recorded call; it defaults to + issuing ``agent-token``. + """ + + path: str + respond: Callable[[AgentCall], Response] = issued + calls: list[AgentCall] = field(default_factory=list) + _server: uvicorn.Server | None = None + _task: asyncio.Task | None = None + + async def _issue_token(self, request: Request) -> Response: + call = AgentCall( + headers={k.lower(): v for k, v in request.headers.items()}, + body=json.loads(await request.body()), + ) + self.calls.append(call) + return self.respond(call) + + async def start(self) -> None: + app = Starlette( + routes=[Route(ISSUE_TOKEN_PATH, self._issue_token, methods=["POST"])] + ) + config = uvicorn.Config(app, uds=self.path, log_level="warning", lifespan="off") + self._server = uvicorn.Server(config) + self._task = asyncio.create_task(self._server.serve()) + while not self._server.started: + if self._task.done(): + self._task.result() + await asyncio.sleep(0.01) + + async def stop(self) -> None: + if self._server is not None: + self._server.should_exit = True + if self._task is not None: + await self._task + + +@pytest.fixture +def short_tmp() -> Iterator[str]: + """A fresh empty directory with a short path. + + pytest's tmp_path can exceed the platform's Unix socket path limit (104 + bytes on macOS) once a socket name is appended. + """ + path = tempfile.mkdtemp(prefix="kc") + try: + yield path + finally: + shutil.rmtree(path, ignore_errors=True) + + +@pytest_asyncio.fixture +async def agent_server() -> AsyncIterator[Callable[..., Awaitable[FakeAgent]]]: + """Start fake agents on demand: ``await agent_server(path, respond=...)``. + + Creates the socket's parent directory, as the Keycard CLI does, and stops + every agent it started at teardown. + """ + started: list[FakeAgent] = [] + + async def start(path: str, respond: Callable[[AgentCall], Response] | None = None) -> FakeAgent: + os.makedirs(os.path.dirname(path), mode=0o700, exist_ok=True) + agent = FakeAgent(path) if respond is None else FakeAgent(path, respond) + await agent.start() + started.append(agent) + return agent + + yield start + for agent in started: + await agent.stop() diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py new file mode 100644 index 00000000..fde2fa31 --- /dev/null +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -0,0 +1,669 @@ +"""Unit tests for the local Keycard agent token source. + +Each test is named for its row in the Unit Tests table of the spec +(keycard-sdk-spec, specs/delegated-access/local-agent-token-source.md), so +``test_row_09_...`` is row 9. This SDK does not cache tokens, so the +caching-only rows 19 to 23 have no test, and row 18 expects two requests. +""" + +import json +import os +import sys +from datetime import datetime, timezone + +import httpx +import pytest + +from keycardai.oauth import ( + AgentCode, + AgentError, + AgentResponseError, + AgentTokenSource, + ConfigError, + NetworkError, + OAuthError, + OAuthHttpError, + ResourceAuth, + ResourceTokenSource, + TokenResponse, + TokenType, + is_application_not_found, + is_authorization_required, + is_declined, + is_prompter_unavailable, + is_rate_limited, + is_unavailable, +) + +ISSUE_TOKEN_PATH = "/keycard.agent.v1.AgentService/IssueToken" + +unix_only = pytest.mark.skipif( + sys.platform == "win32", reason="the default agent socket is Unix-only" +) + + +class _Agent: + """A stub agent behind an injected transport, recording each request.""" + + def __init__(self, *responses: httpx.Response): + self.requests: list[httpx.Request] = [] + self._responses = list(responses) or [httpx.Response(200, json={"token": "tok"})] + + def _handle(self, request: httpx.Request) -> httpx.Response: + self.requests.append(request) + if len(self._responses) > 1: + return self._responses.pop(0) + return self._responses[0] + + def source(self, **kwargs) -> AgentTokenSource: + kwargs.setdefault("socket", "/unused.sock") + return AgentTokenSource(_transport=httpx.MockTransport(self._handle), **kwargs) + + def body(self, i: int = 0) -> dict: + return json.loads(self.requests[i].content) + + +def _never_dialled() -> httpx.MockTransport: + def handle(request: httpx.Request) -> httpx.Response: + raise AssertionError("no request may be sent") + + return httpx.MockTransport(handle) + + +RESOURCE = "https://api.example.com" + + +@pytest.mark.asyncio +async def test_row_01_request_shape(): + agent = _Agent() + + await agent.source(workload="unit-test").resource_token(RESOURCE, ["read", "write"]) + + assert len(agent.requests) == 1 + request = agent.requests[0] + assert request.method == "POST" + assert request.url.path == ISSUE_TOKEN_PATH + assert request.headers["Content-Type"] == "application/json" + assert request.headers["Connect-Protocol-Version"] == "1" + assert agent.body() == { + "resource": RESOURCE, + "scopes": ["read", "write"], + "workload": "unit-test", + } + + +@pytest.mark.asyncio +async def test_row_01_unset_scopes_and_workload_are_sent_empty(): + agent = _Agent() + + await agent.source().resource_token(RESOURCE) + + assert agent.body() == {"resource": RESOURCE, "scopes": [], "workload": ""} + + +@pytest.mark.asyncio +async def test_row_02_tenant_headers(): + agent = _Agent() + + await agent.source(org="org-1", zone="zone-a").resource_token(RESOURCE) + await agent.source().resource_token(RESOURCE) + + assert agent.requests[0].headers["Keycard-Org"] == "org-1" + assert agent.requests[0].headers["Keycard-Zone"] == "zone-a" + assert "Keycard-Org" not in agent.requests[1].headers + assert "Keycard-Zone" not in agent.requests[1].headers + + +@pytest.mark.asyncio +async def test_row_03_app_id(): + agent = _Agent() + + await agent.source(app_id="incident-digest").resource_token(RESOURCE) + await agent.source().resource_token(RESOURCE) + + assert agent.body(0)["appId"] == "incident-digest" + assert "appId" not in agent.body(1) + assert "app_id" not in agent.body(0) + + +@pytest.mark.asyncio +async def test_row_04_resource_is_not_normalized(): + messy = "https://API.Example.com:443/a/./b/../c" + agent = _Agent() + + await agent.source().resource_token(messy, ["Scope:B", "a"]) + + assert agent.body()["resource"] == messy + assert agent.body()["scopes"] == ["Scope:B", "a"] + + +@pytest.mark.asyncio +async def test_row_05_empty_resource(): + source = AgentTokenSource(env={}, _transport=_never_dialled()) + + with pytest.raises(ConfigError): + await source.resource_token("") + + +@pytest.mark.asyncio +async def test_row_06_socket_option_wins(short_tmp, agent_server): + chosen = await agent_server(os.path.join(short_tmp, "chosen.sock")) + other = await agent_server(os.path.join(short_tmp, "other.sock")) + source = AgentTokenSource(socket=chosen.path, env={"KEYCARD_SOCKET": other.path}) + + await source.resource_token(RESOURCE) + + assert len(chosen.calls) == 1 + assert other.calls == [] + + +@pytest.mark.asyncio +async def test_row_07_socket_from_env_mapping(short_tmp, agent_server, monkeypatch): + named = await agent_server(os.path.join(short_tmp, "named.sock")) + process = await agent_server(os.path.join(short_tmp, "process.sock")) + monkeypatch.setenv("KEYCARD_SOCKET", process.path) + + await AgentTokenSource(env={"KEYCARD_SOCKET": named.path}).resource_token(RESOURCE) + + assert len(named.calls) == 1 + assert process.calls == [] + + +async def _dialled(env: dict[str, str]) -> str: + """The socket path a mint resolved from ``env``, read from the network + error that dialling a path with nothing behind it produces.""" + with pytest.raises(NetworkError) as exc_info: + await AgentTokenSource(env=env).resource_token(RESOURCE) + return str(exc_info.value) + + +@unix_only +@pytest.mark.asyncio +async def test_row_08_empty_keycard_socket_is_unset(): + message = await _dialled({"KEYCARD_SOCKET": "", "HOME": "/h"}) + assert " /h/.local/state/keycard/run/agent.sock " in message + + +@unix_only +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("row", "env", "want"), + [ + (9, {"HOME": "/h"}, "/h/.local/state/keycard/run/agent.sock"), + ( + 10, + {"HOME": "/h", "KEYCARD_HOME": "/k"}, + "/k/.local/state/keycard/run/agent.sock", + ), + ( + 11, + {"HOME": "/h", "XDG_STATE_HOME": "/s"}, + "/s/keycard/run/agent.sock", + ), + ( + 12, + {"HOME": "/h", "XDG_STATE_HOME": "/s", "XDG_RUNTIME_DIR": "/r"}, + "/r/keycard/agent.sock", + ), + ( + 13, + { + "HOME": "/h", + "XDG_STATE_HOME": "/s", + "XDG_RUNTIME_DIR": "/r", + "KEYCARD_AGENT_DIR": "/a", + }, + "/a/agent.sock", + ), + ], + ids=lambda v: f"row-{v:02d}" if isinstance(v, int) else None, +) +async def test_rows_09_to_13_default_socket(row, env, want): + assert f" {want} " in await _dialled(env) + + +@unix_only +@pytest.mark.asyncio +async def test_row_14_keycard_toml_is_not_read(short_tmp, monkeypatch): + with open(os.path.join(short_tmp, "keycard.toml"), "w") as f: + f.write('[home]\ndir = "/elsewhere"\n\n[agent]\nDir = "/agent-dir"\n') + monkeypatch.chdir(short_tmp) + + message = await _dialled({"HOME": "/h"}) + + assert " /h/.local/state/keycard/run/agent.sock " in message + + +@unix_only +@pytest.mark.asyncio +async def test_row_15_no_home(): + source = AgentTokenSource(env={}, _transport=_never_dialled()) + + with pytest.raises(ConfigError) as exc_info: + await source.resource_token(RESOURCE) + + assert "KEYCARD_SOCKET" in str(exc_info.value) + assert "HOME" in str(exc_info.value) + + +@pytest.mark.asyncio +async def test_windows_default_socket_is_a_configuration_error(monkeypatch): + monkeypatch.setattr(sys, "platform", "win32") + source = AgentTokenSource(env={"HOME": "/h"}, _transport=_never_dialled()) + + with pytest.raises(ConfigError, match="KEYCARD_SOCKET"): + await source.resource_token(RESOURCE) + + +@unix_only +@pytest.mark.asyncio +async def test_row_16_unreachable_default_socket(short_tmp): + with pytest.raises(NetworkError) as exc_info: + await AgentTokenSource(env={"HOME": short_tmp}).resource_token(RESOURCE) + + message = str(exc_info.value) + assert os.path.join(short_tmp, ".local/state/keycard/run/agent.sock") in message + assert "`keycard agent start`" in message + assert "`keycard run`" in message + assert exc_info.value.retryable + assert isinstance(exc_info.value.cause, httpx.TransportError) + assert os.listdir(short_tmp) == [] + + +@pytest.mark.asyncio +async def test_network_error_from_keycard_socket_does_not_suggest_the_daemon(short_tmp): + path = os.path.join(short_tmp, "missing.sock") + + with pytest.raises(NetworkError) as exc_info: + await AgentTokenSource(env={"KEYCARD_SOCKET": path}).resource_token(RESOURCE) + + message = str(exc_info.value) + assert path in message + assert "KEYCARD_SOCKET" in message + assert "keycard agent start" not in message + + +@pytest.mark.asyncio +async def test_row_17_real_unix_socket(short_tmp, agent_server): + agent = await agent_server(os.path.join(short_tmp, "agent.sock")) + + token = await AgentTokenSource(socket=agent.path).resource_token(RESOURCE, ["read"]) + + assert token.access_token == "agent-token" + assert agent.calls[0].body == {"resource": RESOURCE, "scopes": ["read"], "workload": ""} + assert agent.calls[0].headers["connect-protocol-version"] == "1" + + +@pytest.mark.asyncio +async def test_row_18_no_sdk_cache(): + agent = _Agent() + source = agent.source() + + first = await source.resource_token(RESOURCE, ["read"]) + second = await source.resource_token(RESOURCE, ["read"]) + + assert len(agent.requests) == 2 + assert first.access_token == second.access_token == "tok" + + +def _issued(**body) -> httpx.Response: + return httpx.Response(200, json={"token": "tok", **body}) + + +@pytest.mark.asyncio +async def test_row_24_no_expiry(): + token = await _Agent(_issued()).source().resource_token(RESOURCE) + + assert token.expires_in is None + assert token.token_type == TokenType.BEARER + + +@pytest.mark.asyncio +async def test_row_25_expiry_in_the_past(): + agent = _Agent(_issued(expiresAt="2020-01-01T00:00:00Z")) + + token = await agent.source().resource_token(RESOURCE) + + assert token.expires_in == 0 + + +@pytest.mark.asyncio +async def test_row_26_nanosecond_expiry_against_injected_clock(): + now = datetime(2030, 6, 1, 12, 0, 0, tzinfo=timezone.utc).timestamp() + agent = _Agent(_issued(expiresAt="2030-06-01T13:00:00.999999999Z")) + + token = await agent.source(clock=lambda: now).resource_token(RESOURCE) + + assert token.expires_in == 3600 + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("stamp", "want"), + [ + ("2030-06-01T13:00:00.5Z", 3600), + ("2030-06-01T14:00:00+01:00", 3600), + ("2030-06-01t13:00:00z", 3600), + ("2030-06-01T12:59:59.999-00:00", 3599), + ], +) +async def test_rfc3339_forms(stamp, want): + now = datetime(2030, 6, 1, 12, 0, 0, tzinfo=timezone.utc).timestamp() + + token = await _Agent(_issued(expiresAt=stamp)).source( + clock=lambda: now + ).resource_token(RESOURCE) + + assert token.expires_in == want + + +@pytest.mark.asyncio +async def test_row_27_granted_scopes_as_reported(): + agent = _Agent(_issued(scopes=["a", "b"])) + + token = await agent.source().resource_token(RESOURCE, ["a"]) + + assert token.scope == ["a", "b"] + + +@pytest.mark.asyncio +@pytest.mark.parametrize("reported", [None, []], ids=["absent", "empty"]) +async def test_row_28_scope_never_derived_from_request(reported): + body = {} if reported is None else {"scopes": reported} + + token = await _Agent(_issued(**body)).source().resource_token(RESOURCE, ["a"]) + + assert token.scope is None + + +PREDICATES = { + AgentCode.PERMISSION_DENIED: is_declined, + AgentCode.RESOURCE_EXHAUSTED: is_rate_limited, + AgentCode.FAILED_PRECONDITION: is_prompter_unavailable, + AgentCode.UNAUTHENTICATED: is_authorization_required, + AgentCode.NOT_FOUND: is_application_not_found, + AgentCode.UNAVAILABLE: is_unavailable, +} + +CODES = [ + (AgentCode.PERMISSION_DENIED, 403), + (AgentCode.RESOURCE_EXHAUSTED, 429), + (AgentCode.FAILED_PRECONDITION, 400), + (AgentCode.UNAUTHENTICATED, 401), + (AgentCode.NOT_FOUND, 404), + (AgentCode.UNAVAILABLE, 503), + (AgentCode.INVALID_ARGUMENT, 400), +] + + +@pytest.mark.asyncio +@pytest.mark.parametrize(("code", "status"), CODES, ids=[c.value for c, _ in CODES]) +async def test_row_29_connect_error_per_code(code, status): + agent = _Agent( + httpx.Response(status, json={"code": code.value, "message": "the remedy"}) + ) + + with pytest.raises(AgentError) as exc_info: + await agent.source().resource_token(RESOURCE) + + err = exc_info.value + assert err.code == code.value + assert err.message == "the remedy" + assert isinstance(err, OAuthError) + for other, predicate in PREDICATES.items(): + assert predicate(err) == (other == code), other.value + + +def test_row_30_predicates_follow_the_cause_chain(): + try: + try: + raise AgentError(AgentCode.PERMISSION_DENIED.value, "declined") + except AgentError as inner: + raise RuntimeError("caller wrapped it") from inner + except RuntimeError as outer: + assert is_declined(outer) + assert not is_unavailable(outer) + assert not is_declined(RuntimeError("unrelated")) + assert not is_declined(None) + + +@pytest.mark.asyncio +async def test_row_31_non_json_error_body_is_an_http_error(): + agent = _Agent(httpx.Response(502, text="bad gateway")) + + with pytest.raises(OAuthHttpError) as exc_info: + await agent.source().resource_token(RESOURCE) + + assert exc_info.value.status_code == 502 + assert not isinstance(exc_info.value, AgentError) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "body", + [{"message": "no code"}, {"code": "", "message": "empty"}, {"code": 7}, ["x"]], + ids=["no-code", "empty-code", "non-string-code", "not-an-object"], +) +async def test_row_31_json_error_without_a_code_is_an_http_error(body): + agent = _Agent(httpx.Response(500, json=body)) + + with pytest.raises(OAuthHttpError) as exc_info: + await agent.source().resource_token(RESOURCE) + + assert exc_info.value.status_code == 500 + + +@pytest.mark.asyncio +async def test_error_body_is_read_to_a_bounded_prefix(): + # A Connect error whose JSON closes only after the bound reads as a + # truncated, unparseable prefix. + padded = json.dumps({"code": "unavailable", "message": "x" * (128 * 1024)}) + agent = _Agent(httpx.Response(503, content=padded.encode())) + + with pytest.raises(OAuthHttpError) as exc_info: + await agent.source().resource_token(RESOURCE) + + assert exc_info.value.status_code == 503 + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "response", + [ + httpx.Response(200, json={"token": ""}), + httpx.Response(200, json={"expiresAt": "2030-01-01T00:00:00Z"}), + httpx.Response(200, json={"token": 42}), + httpx.Response(200, text="not json"), + httpx.Response(200, json=["tok"]), + ], + ids=["empty-token", "missing-token", "non-string-token", "not-json", "not-object"], +) +async def test_row_32_unusable_success(response): + with pytest.raises(AgentResponseError) as exc_info: + await _Agent(response).source().resource_token(RESOURCE) + + assert not exc_info.value.retryable + assert exc_info.value.__cause__ is None + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "expires_at", + ["tomorrow", "2030-01-01", "2030-01-01T00:00:00", "2030-13-01T00:00:00Z", 1893456000], +) +async def test_unparseable_expiry_is_an_agent_response_error(expires_at): + with pytest.raises(AgentResponseError, match="expiresAt"): + await _Agent(_issued(expiresAt=expires_at)).source().resource_token(RESOURCE) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("scopes", ["a b", [1], {"a": 1}]) +async def test_malformed_scopes_is_an_agent_response_error(scopes): + with pytest.raises(AgentResponseError, match="scopes"): + await _Agent(_issued(scopes=scopes)).source().resource_token(RESOURCE) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("bad", ["\r\n", "\n", "\x00", "\t", "\x1f", "\x7f"], ids=repr) +async def test_row_33_control_character_in_token(bad): + secret = f"secret{bad}value" + agent = _Agent(httpx.Response(200, json={"token": secret})) + + with pytest.raises(AgentResponseError) as exc_info: + await agent.source().resource_token(RESOURCE) + + assert "secret" not in str(exc_info.value) + + +@pytest.mark.parametrize(("code", "status"), CODES, ids=[c.value for c, _ in CODES]) +def test_row_34_retryable(code, status): + err = AgentError(code.value, "") + assert err.retryable == ( + code in (AgentCode.RESOURCE_EXHAUSTED, AgentCode.UNAVAILABLE) + ) + with pytest.raises(AttributeError): + err.retryable = True # type: ignore[misc] + + +class _StubSource: + def __init__(self, token: str = "tok-123", error: Exception | None = None): + self.token = token + self.error = error + self.asked: list[tuple[str, list[str] | None]] = [] + + async def resource_token( + self, resource: str, scopes: list[str] | None = None + ) -> TokenResponse: + self.asked.append((resource, scopes)) + if self.error is not None: + raise self.error + return TokenResponse(access_token=self.token) + + +class _Resource: + """A stub resource server echoing the Authorization header it received.""" + + def __init__(self): + self.requests: list[httpx.Request] = [] + + def transport(self) -> httpx.MockTransport: + def handle(request: httpx.Request) -> httpx.Response: + self.requests.append(request) + return httpx.Response(200, json={"authorization": request.headers.get("Authorization")}) + + return httpx.MockTransport(handle) + + +def test_stub_source_satisfies_protocol(): + assert isinstance(_StubSource(), ResourceTokenSource) + assert isinstance(AgentTokenSource(), ResourceTokenSource) + + +@pytest.mark.asyncio +async def test_row_35_resource_auth_attaches_bearer(): + source = _StubSource() + server = _Resource() + auth = ResourceAuth(source, RESOURCE, ["read"]) + + async with httpx.AsyncClient(transport=server.transport(), auth=auth) as client: + response = await client.get("https://elsewhere.example.net/items") + + assert response.json() == {"authorization": "Bearer tok-123"} + # The bound resource, not one derived from the request URL. + assert source.asked == [(RESOURCE, ["read"])] + + +@pytest.mark.asyncio +async def test_row_36_source_error_propagates_and_nothing_is_sent(): + declined = AgentError(AgentCode.PERMISSION_DENIED.value, "the human declined") + server = _Resource() + auth = ResourceAuth(_StubSource(error=declined), RESOURCE) + + async with httpx.AsyncClient(transport=server.transport(), auth=auth) as client: + with pytest.raises(AgentError) as exc_info: + await client.get("https://api.example.com/items") + + assert exc_info.value is declined + assert is_declined(exc_info.value) + assert server.requests == [] + + +def test_row_37_resource_auth_requires_source_and_resource(): + with pytest.raises(ConfigError): + ResourceAuth(None, RESOURCE) # type: ignore[arg-type] + with pytest.raises(ConfigError): + ResourceAuth(_StubSource(), "") + + +@pytest.mark.asyncio +async def test_row_38_existing_authorization_is_replaced_and_caller_headers_untouched(): + server = _Resource() + caller_headers = {"Authorization": "Bearer stale"} + auth = ResourceAuth(_StubSource(), RESOURCE) + + async with httpx.AsyncClient(transport=server.transport(), auth=auth) as client: + response = await client.get("https://api.example.com/items", headers=caller_headers) + + assert response.json() == {"authorization": "Bearer tok-123"} + assert server.requests[0].headers.get_list("Authorization") == ["Bearer tok-123"] + assert caller_headers == {"Authorization": "Bearer stale"} + + +def test_resource_auth_refuses_a_sync_client(): + server = _Resource() + auth = ResourceAuth(_StubSource(), RESOURCE) + + with httpx.Client(transport=server.transport(), auth=auth) as client: + with pytest.raises(ConfigError, match="AsyncClient"): + client.get("https://api.example.com/items") + + assert server.requests == [] + + +@pytest.mark.asyncio +async def test_scopes_given_as_a_string_are_refused(): + source = AgentTokenSource(socket="/unused.sock", _transport=_never_dialled()) + + with pytest.raises(ConfigError): + await source.resource_token(RESOURCE, "read") # type: ignore[arg-type] + with pytest.raises(ConfigError): + ResourceAuth(source, RESOURCE, "read") # type: ignore[arg-type] + + +@pytest.mark.asyncio +async def test_construction_is_inert(): + # No socket can be resolved from an empty env, yet construction succeeds: + # resolution, and its error, wait for the first mint. + source = AgentTokenSource(env={}, _transport=_never_dialled()) + + with pytest.raises(ConfigError, match="KEYCARD_SOCKET"): + await source.resource_token(RESOURCE) + + +@pytest.mark.asyncio +async def test_resolution_runs_on_every_call(short_tmp, agent_server): + first = await agent_server(os.path.join(short_tmp, "first.sock")) + second = await agent_server(os.path.join(short_tmp, "second.sock")) + env = {"KEYCARD_SOCKET": first.path} + source = AgentTokenSource(env=env) + + await source.resource_token(RESOURCE) + env["KEYCARD_SOCKET"] = second.path + await source.resource_token(RESOURCE) + + assert len(first.calls) == 1 + assert len(second.calls) == 1 + + +@pytest.mark.asyncio +async def test_connection_failure_mid_request_is_a_network_error(): + def drop(request: httpx.Request) -> httpx.Response: + raise httpx.ReadError("connection reset", request=request) + + source = AgentTokenSource(socket="/s/agent.sock", _transport=httpx.MockTransport(drop)) + + with pytest.raises(NetworkError) as exc_info: + await source.resource_token(RESOURCE) + + assert "/s/agent.sock (the socket option)" in str(exc_info.value) + assert isinstance(exc_info.value.__cause__, httpx.ReadError) diff --git a/packages/oauth/tests/keycardai/oauth/test_agent_integration.py b/packages/oauth/tests/keycardai/oauth/test_agent_integration.py new file mode 100644 index 00000000..5ff71a2f --- /dev/null +++ b/packages/oauth/tests/keycardai/oauth/test_agent_integration.py @@ -0,0 +1,223 @@ +"""Integration tests for the local Keycard agent token source, against a fake agent. + +Each test is named for its row in the Integration Tests table of the spec +(keycard-sdk-spec, specs/delegated-access/local-agent-token-source.md). The +spec runs those rows against a live ``keycard agent`` daemon; here a fake +agent on a real Unix socket stands in for it, so each test covers the part of +its row the SDK can observe: what reaches the agent, and what the caller gets +back. Token signatures, prompts and the agent's cache are the agent's and the +authorization server's to test. The resource server is served on a Unix +socket too, so nothing here touches the network. +""" + +import asyncio +import os +import sys + +import httpx +import pytest +import pytest_asyncio +import uvicorn +from starlette.applications import Starlette +from starlette.requests import Request +from starlette.responses import JSONResponse, Response +from starlette.routing import Route + +from keycardai.oauth import ( + AgentCode, + AgentError, + AgentTokenSource, + NetworkError, + ResourceAuth, + is_application_not_found, + is_declined, +) + +RESOURCE = "https://api.example.com" +ORG = "org-1" +ZONE = "zone-a" +KNOWN_APPS = {"incident-digest"} + + +def _daemon(call) -> Response: + """Answers the way the multi-zone daemon does for a test zone. + + Refuses a request naming no tenant, an ``app_id`` naming no application, + and the scope ``write`` (standing in for the human declining a new + scope's prompt); otherwise issues a token bound to the resource. + """ + body = call.body + if call.headers.get("keycard-org") != ORG or call.headers.get("keycard-zone") != ZONE: + return JSONResponse( + {"code": AgentCode.PERMISSION_DENIED.value, "message": "no session for org/zone"}, + status_code=403, + ) + if "appId" in body and body["appId"] not in KNOWN_APPS: + return JSONResponse( + {"code": AgentCode.NOT_FOUND.value, "message": f"no application {body['appId']}"}, + status_code=404, + ) + if "write" in body["scopes"]: + return JSONResponse( + {"code": AgentCode.PERMISSION_DENIED.value, "message": "declined"}, + status_code=403, + ) + token = f"token-for:{body['resource']}" + if "appId" in body: + token += f":declared:{body['appId']}" + return JSONResponse({"token": token, "expiresAt": "2099-01-01T00:00:00Z"}) + + +class _ResourceServer: + """A resource server on a Unix socket that records each Authorization header.""" + + def __init__(self, path: str): + self.path = path + self.authorizations: list[str | None] = [] + + async def _items(self, request: Request) -> Response: + auth = request.headers.get("authorization") + self.authorizations.append(auth) + if auth is None or not auth.startswith("Bearer token-for:"): + return Response(status_code=401) + return JSONResponse({"items": []}) + + async def __aenter__(self) -> "_ResourceServer": + app = Starlette(routes=[Route("/items", self._items)]) + self._server = uvicorn.Server( + uvicorn.Config(app, uds=self.path, log_level="warning", lifespan="off") + ) + self._task = asyncio.create_task(self._server.serve()) + while not self._server.started: + await asyncio.sleep(0.01) + return self + + async def __aexit__(self, *exc) -> None: + self._server.should_exit = True + await self._task + + def client(self, auth: httpx.Auth) -> httpx.AsyncClient: + return httpx.AsyncClient( + transport=httpx.AsyncHTTPTransport(uds=self.path), + base_url="http://resource", + auth=auth, + ) + + +@pytest_asyncio.fixture +async def daemon(short_tmp, agent_server): + return await agent_server(os.path.join(short_tmp, "agent.sock"), respond=_daemon) + + +def _source(daemon, **kwargs) -> AgentTokenSource: + return AgentTokenSource( + socket=daemon.path, org=ORG, zone=ZONE, workload="integration", **kwargs + ) + + +@pytest.mark.asyncio +async def test_row_1_mint_with_no_application_credential(daemon): + token = await _source(daemon).resource_token(RESOURCE, ["read"]) + + assert token.access_token == f"token-for:{RESOURCE}" + assert token.expires_in is not None and token.expires_in > 0 + assert daemon.calls[0].body == { + "resource": RESOURCE, + "scopes": ["read"], + "workload": "integration", + } + + +@pytest.mark.asyncio +async def test_row_2_request_through_resource_transport(daemon, short_tmp): + async with _ResourceServer(os.path.join(short_tmp, "resource.sock")) as server: + async with server.client(ResourceAuth(_source(daemon), RESOURCE, ["read"])) as client: + response = await client.get("/items") + + assert response.status_code == 200 + assert server.authorizations == [f"Bearer token-for:{RESOURCE}"] + + +@pytest.mark.asyncio +async def test_row_3_every_call_reaches_the_agent(daemon, short_tmp): + source = _source(daemon) + await source.resource_token(RESOURCE, ["read"]) + await source.resource_token(RESOURCE, ["read"]) + + async with _ResourceServer(os.path.join(short_tmp, "resource.sock")) as server: + async with server.client(ResourceAuth(source, RESOURCE, ["read"])) as client: + response = await client.get("/items") + + assert response.status_code == 200 + assert len(daemon.calls) == 3 + + +@pytest.mark.asyncio +async def test_row_4_declined_new_scope(daemon): + with pytest.raises(AgentError) as exc_info: + await _source(daemon).resource_token(RESOURCE, ["read", "write"]) + + assert is_declined(exc_info.value) + + +@pytest.mark.asyncio +async def test_row_5_unknown_app_id(daemon): + with pytest.raises(AgentError) as exc_info: + await _source(daemon, app_id="no-such-app").resource_token(RESOURCE) + + assert is_application_not_found(exc_info.value) + assert not is_declined(exc_info.value) + + +@pytest.mark.asyncio +async def test_row_6_declared_app_id_reaches_the_agent(daemon): + token = await _source(daemon, app_id="incident-digest").resource_token(RESOURCE) + + assert daemon.calls[0].body["appId"] == "incident-digest" + assert token.access_token.endswith(":declared:incident-digest") + + +def _isolate_environment(monkeypatch, home: str) -> None: + for name in ( + "KEYCARD_SOCKET", + "KEYCARD_HOME", + "KEYCARD_AGENT_DIR", + "XDG_RUNTIME_DIR", + "XDG_STATE_HOME", + ): + monkeypatch.delenv(name, raising=False) + monkeypatch.setenv("HOME", home) + + +unix_only = pytest.mark.skipif( + sys.platform == "win32", reason="the default agent socket is Unix-only" +) + + +@unix_only +@pytest.mark.asyncio +async def test_row_7_default_socket_reaches_the_daemon(short_tmp, agent_server, monkeypatch): + # The path `keycard agent start` binds under this HOME with no XDG + # variables set; the fixture creates its directories, as the CLI does. + default = os.path.join(short_tmp, ".local", "state", "keycard", "run", "agent.sock") + daemon = await agent_server(default, respond=_daemon) + _isolate_environment(monkeypatch, short_tmp) + + token = await AgentTokenSource(org=ORG, zone=ZONE).resource_token(RESOURCE) + + assert token.access_token == f"token-for:{RESOURCE}" + assert daemon.calls[0].headers["keycard-org"] == ORG + assert daemon.calls[0].headers["keycard-zone"] == ZONE + + +@unix_only +@pytest.mark.asyncio +async def test_row_8_default_socket_with_the_daemon_stopped(short_tmp, monkeypatch): + _isolate_environment(monkeypatch, short_tmp) + + with pytest.raises(NetworkError) as exc_info: + await AgentTokenSource(org=ORG, zone=ZONE).resource_token(RESOURCE) + + message = str(exc_info.value) + assert os.path.join(short_tmp, ".local/state/keycard/run/agent.sock") in message + assert "`keycard agent start`" in message diff --git a/packages/oauth/tests/test_examples.py b/packages/oauth/tests/test_examples.py index ebdbc773..4c842b3a 100644 --- a/packages/oauth/tests/test_examples.py +++ b/packages/oauth/tests/test_examples.py @@ -38,3 +38,10 @@ def test_dynamic_client_registration_example_loads(): mod = _load_example("dynamic_client_registration") assert hasattr(mod, "main") assert callable(mod.main) + + +def test_agent_token_source_example_loads(): + """The agent_token_source example imports and exposes a main coroutine.""" + mod = _load_example("agent_token_source") + assert hasattr(mod, "main") + assert callable(mod.main) diff --git a/uv.lock b/uv.lock index 88dfb621..695500af 100644 --- a/uv.lock +++ b/uv.lock @@ -1889,6 +1889,8 @@ test = [ { name = "blockbuster" }, { name = "pytest" }, { name = "pytest-asyncio" }, + { name = "starlette" }, + { name = "uvicorn" }, ] [package.dev-dependencies] @@ -1905,6 +1907,8 @@ requires-dist = [ { name = "pydantic", specifier = ">=2.11.7" }, { name = "pytest", marker = "extra == 'test'", specifier = ">=8.4.1" }, { name = "pytest-asyncio", marker = "extra == 'test'", specifier = ">=1.1.0" }, + { name = "starlette", marker = "extra == 'test'", specifier = ">=1.0.1" }, + { name = "uvicorn", marker = "extra == 'test'", specifier = ">=0.32.0" }, ] provides-extras = ["test"] From 196d3afa2861edabcc2a0ccce76963c4cd0809fd Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:26:26 -0500 Subject: [PATCH 02/12] fix(keycardai-oauth): agent predicates follow OAuthError.cause OAuthError(message, cause) stores the wrapped error in .cause without setting __cause__, so an AgentError wrapped the way this SDK wraps errors was invisible to is_declined and the other predicates. The spec requires them to see through the language's wrapping chain. __context__ stays unfollowed: raising inside `except AgentError` is a new failure. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 8 ++++- .../oauth/tests/keycardai/oauth/test_agent.py | 34 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index 36ed9abc..f1e8d8c6 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -99,12 +99,18 @@ def __init__(self, message: str): def _agent_code(err: BaseException | None) -> str | None: + # Follows explicit wrapping only: ``raise ... from`` and OAuthError's + # ``cause``, which does not set ``__cause__``. ``__context__`` is not + # followed, since raising inside ``except AgentError`` is a new failure. seen: set[int] = set() while err is not None and id(err) not in seen: if isinstance(err, AgentError): return err.code seen.add(id(err)) - err = err.__cause__ + cause = err.__cause__ + if cause is None and isinstance(err, OAuthError): + cause = err.cause + err = cause return None diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index fde2fa31..38054cc7 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -427,6 +427,40 @@ def test_row_30_predicates_follow_the_cause_chain(): assert not is_declined(None) +def test_predicates_follow_oauth_error_cause(): + # OAuthError(message, cause) is this SDK's wrapping idiom, and it sets + # .cause without setting __cause__. + declined = AgentError(AgentCode.PERMISSION_DENIED.value, "declined") + wrapped = OAuthError("token exchange failed", cause=declined) + + assert is_declined(wrapped) + deep = RuntimeError("outer") + deep.__cause__ = OAuthError("middle", cause=declined) + assert is_declined(deep) + + +def test_predicates_stop_on_a_cause_cycle(): + a, b = RuntimeError("a"), RuntimeError("b") + a.__cause__, b.__cause__ = b, a + c = OAuthError("c") + c.cause = c + + assert not is_declined(a) + assert not is_declined(c) + + +def test_predicates_ignore_implicit_context(): + # Raising inside an `except AgentError:` block is a new failure, not a + # wrapped refusal. + try: + try: + raise AgentError(AgentCode.PERMISSION_DENIED.value, "declined") + except AgentError: + raise RuntimeError("fallback failed") # noqa: B904 + except RuntimeError as err: + assert not is_declined(err) + + @pytest.mark.asyncio async def test_row_31_non_json_error_body_is_an_http_error(): agent = _Agent(httpx.Response(502, text="bad gateway")) From 7c10996a3d4154aac56343d7d3a2d63bcdda3871 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:27:00 -0500 Subject: [PATCH 03/12] test(keycardai-oauth): make the empty-resource row fail without its check With env={} socket resolution raised ConfigError on its own, so row 5 passed with the empty-resource check deleted. Resolution now fails the test if it runs, and the error must name the resource. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/tests/keycardai/oauth/test_agent.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index 38054cc7..97946cf7 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -14,6 +14,7 @@ import httpx import pytest +from keycardai.oauth import agent as agent_module from keycardai.oauth import ( AgentCode, AgentError, @@ -138,10 +139,16 @@ async def test_row_04_resource_is_not_normalized(): @pytest.mark.asyncio -async def test_row_05_empty_resource(): +async def test_row_05_empty_resource(monkeypatch): + # An unresolvable env would raise ConfigError too, so resolution itself + # must be shown not to run. + def unreachable(*args): + raise AssertionError("the socket must not be resolved") + + monkeypatch.setattr(agent_module, "_resolve_socket", unreachable) source = AgentTokenSource(env={}, _transport=_never_dialled()) - with pytest.raises(ConfigError): + with pytest.raises(ConfigError, match="resource"): await source.resource_token("") From aec475f63176e860d0ff779deda3566b28a3ea61 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:27:19 -0500 Subject: [PATCH 04/12] perf(keycardai-oauth): skip the CA bundle on the agent's Unix socket httpx.AsyncHTTPTransport builds an SSL context in its constructor even for a uds transport, loading certifi each time: 9.09 ms per construction against 0.08 ms with verify=False (httpx 0.28.1). The transport is built per call because the socket is resolved per call, and ResourceAuth calls once per request, so every authenticated request paid it. TLS never applies on the plain-HTTP socket. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index f1e8d8c6..cbc3e501 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -331,7 +331,11 @@ async def resource_token( if self.zone: headers["Keycard-Zone"] = self.zone - transport = self._transport or httpx.AsyncHTTPTransport(uds=socket.path) + # verify=False skips loading the CA bundle, about 9 ms per call, for + # a plain-HTTP Unix socket on which TLS never applies. + transport = self._transport or httpx.AsyncHTTPTransport( + uds=socket.path, verify=False + ) try: async with ( httpx.AsyncClient(transport=transport, timeout=None) as client, From 459607c921f141de9e2fd882a03844f07f9373d6 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:27:50 -0500 Subject: [PATCH 05/12] fix(keycardai-oauth): keep the agent's response body off __context__ `raise ... from None` suppresses the JSONDecodeError in tracebacks but leaves it on __context__, and its .doc is the whole response body, token included, for any code that walks the chain. The error is now raised outside the except block, and row 32 asserts __context__ is None, with a malformed body that carries a token. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 11 ++++++++--- packages/oauth/tests/keycardai/oauth/test_agent.py | 13 ++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index cbc3e501..93649f5a 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -44,6 +44,8 @@ _ERROR_BODY_LIMIT = 64 * 1024 +_NOT_JSON = object() + class AgentCode(str, Enum): """Connect error codes the Keycard agent refuses a request with. @@ -352,12 +354,15 @@ async def resource_token( return self._token(content) def _token(self, content: bytes) -> TokenResponse: + # Raised outside the except block: the decode error holds the whole + # document, which may contain the token, and `from None` would still + # leave it reachable as __context__. try: body = json.loads(content) except ValueError: - # Not chained: the decode error holds the whole document, which - # may contain the token. - raise AgentResponseError("response is not JSON") from None + body = _NOT_JSON + if body is _NOT_JSON: + raise AgentResponseError("response is not JSON") if not isinstance(body, dict): raise AgentResponseError("response is not a JSON object") diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index 97946cf7..fee8a399 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -515,16 +515,27 @@ async def test_error_body_is_read_to_a_bounded_prefix(): httpx.Response(200, json={"expiresAt": "2030-01-01T00:00:00Z"}), httpx.Response(200, json={"token": 42}), httpx.Response(200, text="not json"), + httpx.Response(200, text='{"token": "secret-value" trailing'), httpx.Response(200, json=["tok"]), ], - ids=["empty-token", "missing-token", "non-string-token", "not-json", "not-object"], + ids=[ + "empty-token", + "missing-token", + "non-string-token", + "not-json", + "malformed-json-with-token", + "not-object", + ], ) async def test_row_32_unusable_success(response): with pytest.raises(AgentResponseError) as exc_info: await _Agent(response).source().resource_token(RESOURCE) assert not exc_info.value.retryable + # A JSONDecodeError holds the whole document in .doc, so it must be + # neither the cause nor the suppressed context. assert exc_info.value.__cause__ is None + assert exc_info.value.__context__ is None @pytest.mark.asyncio From b7a2c26cc3590973e5df7b8537c34e7b59edccb6 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:28:18 -0500 Subject: [PATCH 06/12] fix(keycardai-oauth): keep the token when the agent's scopes are malformed The spec sets the token's scope to the agent's scopes "when the response carries a non-empty list; absent otherwise", and its error table makes only a bad body, token or expiresAt an agent response error. A scopes value that is not a list of strings now leaves scope absent instead of discarding a usable token. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 15 +++++++++------ .../oauth/tests/keycardai/oauth/test_agent.py | 13 +++++++++---- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index 93649f5a..84bbd1f9 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -383,18 +383,21 @@ def _token(self, content: bytes) -> TokenResponse: expires_in = max(0, math.floor(seconds - self._clock() + nanos / 1e9)) granted = body.get("scopes") - if granted is not None and not ( - isinstance(granted, list) and all(isinstance(s, str) for s in granted) + # Absent, empty, or not a list of strings means the grant is unknown, + # so it is never filled in from the request, and a usable token is + # not discarded over it. + if not ( + isinstance(granted, list) + and granted + and all(isinstance(s, str) for s in granted) ): - raise AgentResponseError("scopes is not a list of strings") + granted = None return TokenResponse( access_token=token, token_type=TokenType.BEARER, expires_in=expires_in, - # Absent or empty means the grant is unknown, so it is never - # filled in from the request. - scope=list(granted) if granted else None, + scope=granted, ) diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index fee8a399..0cfee2f9 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -549,10 +549,15 @@ async def test_unparseable_expiry_is_an_agent_response_error(expires_at): @pytest.mark.asyncio -@pytest.mark.parametrize("scopes", ["a b", [1], {"a": 1}]) -async def test_malformed_scopes_is_an_agent_response_error(scopes): - with pytest.raises(AgentResponseError, match="scopes"): - await _Agent(_issued(scopes=scopes)).source().resource_token(RESOURCE) +@pytest.mark.parametrize("scopes", ["a b", [1], ["a", 1], {"a": 1}]) +async def test_malformed_scopes_is_treated_as_absent(scopes): + # The spec's scope is the agent's list "when the response carries a + # non-empty list; absent otherwise", and its error table does not make + # a malformed one an error, so the token is kept. + token = await _Agent(_issued(scopes=scopes)).source().resource_token(RESOURCE, ["a"]) + + assert token.access_token == "tok" + assert token.scope is None @pytest.mark.asyncio From 74062f38af4577566ea773513a17eaa33284c02e Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:28:46 -0500 Subject: [PATCH 07/12] fix(keycardai-oauth): accept only ASCII digits in the agent's expiresAt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python's \d matches any Unicode decimal digit and int() accepts them, so "٢٠٣٠-01-01T00:00:00Z" parsed as a valid expiry. RFC 3339 allows ASCII digits only. The comment above the pattern also overstated what 3.11's fromisoformat fixes: nine fractional digits exceed datetime on every version. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 9 ++++++--- packages/oauth/tests/keycardai/oauth/test_agent.py | 9 ++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index 84bbd1f9..76d58b44 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -425,11 +425,14 @@ def _refusal(status: int, prefix: bytes) -> OAuthError: # protojson renders a Timestamp with up to nine fractional digits, beyond -# datetime's microseconds, and before Python 3.11 fromisoformat accepts -# neither a "Z" suffix nor a fraction of other than three or six digits. +# datetime's microseconds on every Python version, and before 3.11 +# fromisoformat also rejects a "Z" suffix. The pattern accepts the wider RFC +# 3339 grammar, offsets included; re.ASCII keeps \d to the digits RFC 3339 +# allows, since int() would accept any Unicode decimal. _RFC3339 = re.compile( r"(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,9}))?" - r"(?:([Zz])|([+-])(\d{2}):(\d{2}))" + r"(?:([Zz])|([+-])(\d{2}):(\d{2}))", + re.ASCII, ) diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index 0cfee2f9..1a5cdd0f 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -541,7 +541,14 @@ async def test_row_32_unusable_success(response): @pytest.mark.asyncio @pytest.mark.parametrize( "expires_at", - ["tomorrow", "2030-01-01", "2030-01-01T00:00:00", "2030-13-01T00:00:00Z", 1893456000], + [ + "tomorrow", + "2030-01-01", + "2030-01-01T00:00:00", + "2030-13-01T00:00:00Z", + 1893456000, + "٢٠٣٠-01-01T00:00:00Z", # Arabic-Indic digits, which \d matches + ], ) async def test_unparseable_expiry_is_an_agent_response_error(expires_at): with pytest.raises(AgentResponseError, match="expiresAt"): From d1c5036e9161fd2d6ce568b56272608373fa3cb0 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:32:10 -0500 Subject: [PATCH 08/12] fix(keycardai-oauth): bound the agent's success response at 1 MiB The error body was read to a 64 KiB prefix, but a 200 body was read with aread(), unbounded. The socket's owner is not checked, so a peer on it could stream an endless or decompression-amplified body. A 200 body over 1 MiB is now an AgentResponseError. A new test streams an endless body on both paths, pinning the early break that a fully buffered MockTransport body could not observe. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 19 ++++++--- .../oauth/tests/keycardai/oauth/test_agent.py | 41 +++++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index 76d58b44..b7efb732 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -44,6 +44,10 @@ _ERROR_BODY_LIMIT = 64 * 1024 +# The socket's owner is not checked, so a peer on it may stream an endless or +# decompression-amplified body. +_RESPONSE_BODY_LIMIT = 1024 * 1024 + _NOT_JSON = object() @@ -346,8 +350,13 @@ async def resource_token( ) as response, ): if response.status_code != 200: - raise _refusal(response.status_code, await _read_prefix(response)) - content = await response.aread() + raise _refusal( + response.status_code, + await _read_prefix(response, _ERROR_BODY_LIMIT), + ) + content = await _read_prefix(response, _RESPONSE_BODY_LIMIT + 1) + if len(content) > _RESPONSE_BODY_LIMIT: + raise AgentResponseError("response is too large") except httpx.TransportError as err: raise NetworkError(err, operation=socket.describe()) from err @@ -401,13 +410,13 @@ def _token(self, content: bytes) -> TokenResponse: ) -async def _read_prefix(response: httpx.Response) -> bytes: +async def _read_prefix(response: httpx.Response, limit: int) -> bytes: prefix = bytearray() async for chunk in response.aiter_bytes(): prefix += chunk - if len(prefix) >= _ERROR_BODY_LIMIT: + if len(prefix) >= limit: break - return bytes(prefix[:_ERROR_BODY_LIMIT]) + return bytes(prefix[:limit]) def _refusal(status: int, prefix: bytes) -> OAuthError: diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index 1a5cdd0f..a97bb1b4 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -6,6 +6,7 @@ caching-only rows 19 to 23 have no test, and row 18 expects two requests. """ +import asyncio import json import os import sys @@ -507,6 +508,46 @@ async def test_error_body_is_read_to_a_bounded_prefix(): assert exc_info.value.status_code == 503 +@pytest.mark.asyncio +async def test_success_body_is_bounded(): + padded = {"token": "tok", "padding": "x" * (1024 * 1024)} + agent = _Agent(httpx.Response(200, json=padded)) + + with pytest.raises(AgentResponseError, match="too large") as exc_info: + await agent.source().resource_token(RESOURCE) + + assert "tok" not in str(exc_info.value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + ("status", "error"), [(200, AgentResponseError), (503, OAuthHttpError)] +) +async def test_endless_body_is_not_read_to_the_end(status, error): + async def endless(): + while True: + # Yields to the loop so wait_for can cancel a read that never stops. + await asyncio.sleep(0) + yield b"x" * 4096 + + agent = _Agent(httpx.Response(status, content=endless())) + + with pytest.raises(error): + await asyncio.wait_for(agent.source().resource_token(RESOURCE), timeout=5) + + +@pytest.mark.asyncio +async def test_success_body_just_under_the_bound_is_read(): + body = json.dumps({"token": "tok", "padding": ""}).encode() + padded = body[:-2] + b"x" * (1024 * 1024 - len(body)) + b'"}' + assert len(padded) == 1024 * 1024 + agent = _Agent(httpx.Response(200, content=padded)) + + token = await agent.source().resource_token(RESOURCE) + + assert token.access_token == "tok" + + @pytest.mark.asyncio @pytest.mark.parametrize( "response", From 8558a101264d06472313342ea216bf7fa7b68c93 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:38:44 -0500 Subject: [PATCH 09/12] fix(keycardai-oauth): refuse a control character in the agent's org or zone org and zone become the Keycard-Org and Keycard-Zone headers. A CR, LF or other C0 byte in either was refused by h11 mid-send as a TransportError, which surfaced as a NetworkError: retryable, and blaming the socket for a caller's bad value. It is now a ConfigError before the socket is resolved, using the same control-character rule as the token check. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/src/keycardai/oauth/agent.py | 14 +++++++++++--- packages/oauth/tests/keycardai/oauth/test_agent.py | 12 ++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index b7efb732..bba854e3 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -304,8 +304,8 @@ async def resource_token( ``resource`` and each scope are sent exactly as given. Raises: - ConfigError: ``resource`` is empty, or the default socket cannot - be located. + ConfigError: ``resource`` is empty, ``org`` or ``zone`` contains + a control character, or the default socket cannot be located. NetworkError: The socket cannot be reached, or the connection failed mid-request. The message names the socket and how it was chosen. @@ -317,6 +317,9 @@ async def resource_token( raise ConfigError("resource is required") if isinstance(scopes, str): raise ConfigError("scopes must be a list of strings, not a string") + for name, value in (("org", self.org), ("zone", self.zone)): + if _has_control_character(value): + raise ConfigError(f"{name} contains a control character") socket = _resolve_socket( self.socket, os.environ if self._env is None else self._env @@ -380,7 +383,7 @@ def _token(self, content: bytes) -> TokenResponse: raise AgentResponseError("response has no token") # The token may be an opaque third-party secret headed for an # Authorization header, where a control character splits or ends it. - if any(c < " " or c == "\x7f" for c in token): + if _has_control_character(token): raise AgentResponseError("token contains a control character") expires_in = None @@ -410,6 +413,11 @@ def _token(self, content: bytes) -> TokenResponse: ) +def _has_control_character(value: str) -> bool: + """A C0 control or DEL, any of which splits or ends an HTTP header value.""" + return any(c < " " or c == "\x7f" for c in value) + + async def _read_prefix(response: httpx.Response, limit: int) -> bytes: prefix = bytearray() async for chunk in response.aiter_bytes(): diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index a97bb1b4..18fe600f 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -116,6 +116,18 @@ async def test_row_02_tenant_headers(): assert "Keycard-Zone" not in agent.requests[1].headers +@pytest.mark.asyncio +@pytest.mark.parametrize("field", ["org", "zone"]) +@pytest.mark.parametrize("bad", ["a\r\nX-Injected: 1", "a\x00", "a\x7f"], ids=repr) +async def test_tenant_header_with_a_control_character_is_a_config_error(field, bad): + # Otherwise h11 refuses it mid-send as a TransportError, which surfaces + # as a retryable NetworkError blaming the socket. + source = AgentTokenSource(socket="/unused.sock", _transport=_never_dialled(), **{field: bad}) + + with pytest.raises(ConfigError, match=field): + await source.resource_token(RESOURCE) + + @pytest.mark.asyncio async def test_row_03_app_id(): agent = _Agent() From 68502ad7551d6210e152bd81b8dc22aeb702d32c Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:39:22 -0500 Subject: [PATCH 10/12] docs(keycardai-oauth): correct the agent token source's Windows and timeout notes - On Windows the CLI's default agent endpoint is the named pipe \\.\pipe\keycard-agent (config_windows.go), not "a Unix socket"; the error now says so, and the docstring's transcription claim is scoped to the Unix AgentSocketPath. - asyncio.timeout is 3.11+, and the package supports 3.10, so the README and docstring name asyncio.wait_for first. - Drop the README snippet's unused is_declined import, and have the example smoke test assert main is a coroutine function, as its docstring says. Co-Authored-By: Claude Opus 5.5 (1M context) --- packages/oauth/README.md | 4 ++-- packages/oauth/src/keycardai/oauth/agent.py | 14 ++++++++------ packages/oauth/tests/test_examples.py | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/oauth/README.md b/packages/oauth/README.md index d43ee30f..787da5b0 100644 --- a/packages/oauth/README.md +++ b/packages/oauth/README.md @@ -533,7 +533,7 @@ the request. ```python import httpx -from keycardai.oauth import AgentTokenSource, ResourceAuth, is_declined +from keycardai.oauth import AgentTokenSource, ResourceAuth source = AgentTokenSource(workload="my-agent") @@ -559,7 +559,7 @@ from `keycard.toml`. Construction does no I/O. The first request for a resource and scope set blocks until someone answers the approval prompt, so no timeout is applied; bound the call with -`asyncio.timeout`. The SDK does not cache tokens: each call is one request to +`asyncio.wait_for`, or `asyncio.timeout` on Python 3.11+. The SDK does not cache tokens: each call is one request to the agent, which caches them itself. Options, all keyword-only: diff --git a/packages/oauth/src/keycardai/oauth/agent.py b/packages/oauth/src/keycardai/oauth/agent.py index bba854e3..585aecf1 100644 --- a/packages/oauth/src/keycardai/oauth/agent.py +++ b/packages/oauth/src/keycardai/oauth/agent.py @@ -202,9 +202,10 @@ def describe(self) -> str: def _resolve_socket(socket: str | None, env: Mapping[str, str]) -> _Socket: """Choose the agent socket by the spec's three ordered rules. - Transcribes the Keycard CLI's ``Config.AgentSocketPath``, the canonical - source for the daemon's socket, except that only the environment is read, - never ``keycard.toml``. Computes a path and touches nothing on disk. + Transcribes the Keycard CLI's Unix ``Config.AgentSocketPath``, the + canonical source for the daemon's socket, except that only the + environment is read, never ``keycard.toml``. Computes a path and touches + nothing on disk. """ if socket: return _Socket(socket, _SocketRule.OPTION) @@ -217,8 +218,8 @@ def var(name: str) -> str | None: if sys.platform == "win32": raise ConfigError( - f"{AGENT_SOCKET_ENV} is not set, and the keycard agent daemon's " - "default socket is a Unix socket, unavailable on Windows; pass " + f"{AGENT_SOCKET_ENV} is not set, and on Windows the keycard agent " + "daemon listens on a named pipe, which this SDK cannot dial; pass " f"socket= or set {AGENT_SOCKET_ENV}" ) @@ -250,7 +251,8 @@ class AgentTokenSource: happen on each ``resource_token`` call, so a changed environment takes effect on the next call. The first request for an approval blocks for as long as a human takes to answer the prompt, so no timeout is applied: - bound the call with ``asyncio.timeout`` or cancellation. Tokens are not + bound the call with ``asyncio.wait_for``, ``asyncio.timeout`` (3.11+), + or cancellation. Tokens are not cached here; the agent caches them, and each call is one request to it. Args: diff --git a/packages/oauth/tests/test_examples.py b/packages/oauth/tests/test_examples.py index 4c842b3a..73159905 100644 --- a/packages/oauth/tests/test_examples.py +++ b/packages/oauth/tests/test_examples.py @@ -6,6 +6,7 @@ """ import importlib.util +import inspect import sys from pathlib import Path @@ -43,5 +44,4 @@ def test_dynamic_client_registration_example_loads(): def test_agent_token_source_example_loads(): """The agent_token_source example imports and exposes a main coroutine.""" mod = _load_example("agent_token_source") - assert hasattr(mod, "main") - assert callable(mod.main) + assert inspect.iscoroutinefunction(mod.main) From c416595248684aa6ffef011b5197f82774bbbb31 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:40:45 -0500 Subject: [PATCH 11/12] test(keycardai-oauth): share one Unix-socket server helper, under /tmp - short_tmp honoured TMPDIR, which on macOS leaves 9 bytes of the 104-byte socket path limit for the deepest default socket, and a long TMPDIR failed 11 agent tests. It now uses /tmp where that exists. - The resource server in the integration tests copied FakeAgent's uvicorn start loop without its task.done() check, so a bind failure spun forever. Both now go through serve_on_uds, which surfaces it. - agent_server stopped its agents one at a time, so one failure skipped the rest; an AsyncExitStack now stops every one. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../oauth/tests/keycardai/oauth/conftest.py | 77 +++++++++++-------- .../keycardai/oauth/test_agent_integration.py | 41 ++++------ 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/packages/oauth/tests/keycardai/oauth/conftest.py b/packages/oauth/tests/keycardai/oauth/conftest.py index d9b48c03..1f5cb7f3 100644 --- a/packages/oauth/tests/keycardai/oauth/conftest.py +++ b/packages/oauth/tests/keycardai/oauth/conftest.py @@ -11,6 +11,7 @@ import shutil import tempfile from collections.abc import AsyncIterator, Awaitable, Callable, Iterator +from contextlib import AbstractAsyncContextManager, AsyncExitStack, asynccontextmanager from dataclasses import dataclass, field import pytest @@ -36,6 +37,25 @@ def issued(_: AgentCall) -> Response: return JSONResponse({"token": "agent-token"}) +@asynccontextmanager +async def serve_on_uds(app: Starlette, path: str) -> AsyncIterator[None]: + """Serve ``app`` under uvicorn on the Unix socket ``path`` until exit.""" + server = uvicorn.Server( + uvicorn.Config(app, uds=path, log_level="warning", lifespan="off") + ) + task = asyncio.create_task(server.serve()) + try: + while not server.started: + if task.done(): + task.result() + raise RuntimeError(f"uvicorn stopped before serving {path}") + await asyncio.sleep(0.01) + yield + finally: + server.should_exit = True + await task + + @dataclass class FakeAgent: """A stand-in for the Keycard agent serving IssueToken on ``path``. @@ -47,8 +67,6 @@ class FakeAgent: path: str respond: Callable[[AgentCall], Response] = issued calls: list[AgentCall] = field(default_factory=list) - _server: uvicorn.Server | None = None - _task: asyncio.Task | None = None async def _issue_token(self, request: Request) -> Response: call = AgentCall( @@ -58,55 +76,48 @@ async def _issue_token(self, request: Request) -> Response: self.calls.append(call) return self.respond(call) - async def start(self) -> None: - app = Starlette( + def app(self) -> Starlette: + return Starlette( routes=[Route(ISSUE_TOKEN_PATH, self._issue_token, methods=["POST"])] ) - config = uvicorn.Config(app, uds=self.path, log_level="warning", lifespan="off") - self._server = uvicorn.Server(config) - self._task = asyncio.create_task(self._server.serve()) - while not self._server.started: - if self._task.done(): - self._task.result() - await asyncio.sleep(0.01) - - async def stop(self) -> None: - if self._server is not None: - self._server.should_exit = True - if self._task is not None: - await self._task @pytest.fixture def short_tmp() -> Iterator[str]: """A fresh empty directory with a short path. - pytest's tmp_path can exceed the platform's Unix socket path limit (104 - bytes on macOS) once a socket name is appended. + pytest's tmp_path, and on macOS TMPDIR itself, leave too little of the + Unix socket path limit (104 bytes on macOS) for the deepest default + socket path, so the directory is made under /tmp where that exists. """ - path = tempfile.mkdtemp(prefix="kc") + path = tempfile.mkdtemp(prefix="kc", dir="/tmp" if os.path.isdir("/tmp") else None) try: yield path finally: shutil.rmtree(path, ignore_errors=True) +@pytest.fixture +def uds_server() -> Callable[[Starlette, str], AbstractAsyncContextManager[None]]: + """``async with uds_server(app, path):`` serves ``app`` on ``path``.""" + return serve_on_uds + + @pytest_asyncio.fixture async def agent_server() -> AsyncIterator[Callable[..., Awaitable[FakeAgent]]]: """Start fake agents on demand: ``await agent_server(path, respond=...)``. Creates the socket's parent directory, as the Keycard CLI does, and stops - every agent it started at teardown. + every agent it started at teardown, even when stopping one fails. """ - started: list[FakeAgent] = [] - - async def start(path: str, respond: Callable[[AgentCall], Response] | None = None) -> FakeAgent: - os.makedirs(os.path.dirname(path), mode=0o700, exist_ok=True) - agent = FakeAgent(path) if respond is None else FakeAgent(path, respond) - await agent.start() - started.append(agent) - return agent - - yield start - for agent in started: - await agent.stop() + async with AsyncExitStack() as stack: + + async def start( + path: str, respond: Callable[[AgentCall], Response] | None = None + ) -> FakeAgent: + os.makedirs(os.path.dirname(path), mode=0o700, exist_ok=True) + agent = FakeAgent(path) if respond is None else FakeAgent(path, respond) + await stack.enter_async_context(serve_on_uds(agent.app(), path)) + return agent + + yield start diff --git a/packages/oauth/tests/keycardai/oauth/test_agent_integration.py b/packages/oauth/tests/keycardai/oauth/test_agent_integration.py index 5ff71a2f..313f7356 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent_integration.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent_integration.py @@ -10,14 +10,12 @@ socket too, so nothing here touches the network. """ -import asyncio import os import sys import httpx import pytest import pytest_asyncio -import uvicorn from starlette.applications import Starlette from starlette.requests import Request from starlette.responses import JSONResponse, Response @@ -82,19 +80,8 @@ async def _items(self, request: Request) -> Response: return Response(status_code=401) return JSONResponse({"items": []}) - async def __aenter__(self) -> "_ResourceServer": - app = Starlette(routes=[Route("/items", self._items)]) - self._server = uvicorn.Server( - uvicorn.Config(app, uds=self.path, log_level="warning", lifespan="off") - ) - self._task = asyncio.create_task(self._server.serve()) - while not self._server.started: - await asyncio.sleep(0.01) - return self - - async def __aexit__(self, *exc) -> None: - self._server.should_exit = True - await self._task + def app(self) -> Starlette: + return Starlette(routes=[Route("/items", self._items)]) def client(self, auth: httpx.Auth) -> httpx.AsyncClient: return httpx.AsyncClient( @@ -109,6 +96,13 @@ async def daemon(short_tmp, agent_server): return await agent_server(os.path.join(short_tmp, "agent.sock"), respond=_daemon) +@pytest_asyncio.fixture +async def resource_server(short_tmp, uds_server): + server = _ResourceServer(os.path.join(short_tmp, "resource.sock")) + async with uds_server(server.app(), server.path): + yield server + + def _source(daemon, **kwargs) -> AgentTokenSource: return AgentTokenSource( socket=daemon.path, org=ORG, zone=ZONE, workload="integration", **kwargs @@ -129,24 +123,23 @@ async def test_row_1_mint_with_no_application_credential(daemon): @pytest.mark.asyncio -async def test_row_2_request_through_resource_transport(daemon, short_tmp): - async with _ResourceServer(os.path.join(short_tmp, "resource.sock")) as server: - async with server.client(ResourceAuth(_source(daemon), RESOURCE, ["read"])) as client: - response = await client.get("/items") +async def test_row_2_request_through_resource_transport(daemon, resource_server): + auth = ResourceAuth(_source(daemon), RESOURCE, ["read"]) + async with resource_server.client(auth) as client: + response = await client.get("/items") assert response.status_code == 200 - assert server.authorizations == [f"Bearer token-for:{RESOURCE}"] + assert resource_server.authorizations == [f"Bearer token-for:{RESOURCE}"] @pytest.mark.asyncio -async def test_row_3_every_call_reaches_the_agent(daemon, short_tmp): +async def test_row_3_every_call_reaches_the_agent(daemon, resource_server): source = _source(daemon) await source.resource_token(RESOURCE, ["read"]) await source.resource_token(RESOURCE, ["read"]) - async with _ResourceServer(os.path.join(short_tmp, "resource.sock")) as server: - async with server.client(ResourceAuth(source, RESOURCE, ["read"])) as client: - response = await client.get("/items") + async with resource_server.client(ResourceAuth(source, RESOURCE, ["read"])) as client: + response = await client.get("/items") assert response.status_code == 200 assert len(daemon.calls) == 3 From 8816ea7eff4877f090aa121f4b90642b42a79fb6 Mon Sep 17 00:00:00 2001 From: Ben Burkert Date: Wed, 18 Nov 2026 15:42:21 -0500 Subject: [PATCH 12/12] test(keycardai-oauth): pin agent token source behavior that mutants survived Each test below fails against a mutant that the existing suite let pass: - the expiry's fraction: a fractional clock, and a one-digit fraction (dropping `+ nanos / 1e9`, and ljust turned rjust) - a +05:30 offset (offset minutes dropped) - scopes sent unsorted and with duplicates, as given - a 201, 204 or 302 as an HTTP error (`!= 200` turned `>= 400`) - a non-string Connect message dropped to "" - empty KEYCARD_AGENT_DIR, XDG_RUNTIME_DIR, XDG_STATE_HOME, KEYCARD_HOME, socket= and HOME treated as unset - ResourceAuth copying its scopes, and asking with [] when given none Co-Authored-By: Claude Opus 5.5 (1M context) --- .../oauth/tests/keycardai/oauth/test_agent.py | 90 ++++++++++++++++--- 1 file changed, 80 insertions(+), 10 deletions(-) diff --git a/packages/oauth/tests/keycardai/oauth/test_agent.py b/packages/oauth/tests/keycardai/oauth/test_agent.py index 18fe600f..dce3e62a 100644 --- a/packages/oauth/tests/keycardai/oauth/test_agent.py +++ b/packages/oauth/tests/keycardai/oauth/test_agent.py @@ -15,7 +15,6 @@ import httpx import pytest -from keycardai.oauth import agent as agent_module from keycardai.oauth import ( AgentCode, AgentError, @@ -29,6 +28,7 @@ ResourceTokenSource, TokenResponse, TokenType, + agent as agent_module, is_application_not_found, is_authorization_required, is_declined, @@ -145,10 +145,11 @@ async def test_row_04_resource_is_not_normalized(): messy = "https://API.Example.com:443/a/./b/../c" agent = _Agent() - await agent.source().resource_token(messy, ["Scope:B", "a"]) + await agent.source().resource_token(messy, ["Scope:B", "a", "Scope:B"]) assert agent.body()["resource"] == messy - assert agent.body()["scopes"] == ["Scope:B", "a"] + # Neither sorted nor deduplicated. + assert agent.body()["scopes"] == ["Scope:B", "a", "Scope:B"] @pytest.mark.asyncio @@ -242,6 +243,33 @@ async def test_rows_09_to_13_default_socket(row, env, want): assert f" {want} " in await _dialled(env) +@unix_only +@pytest.mark.asyncio +@pytest.mark.parametrize( + "unset", ["KEYCARD_AGENT_DIR", "XDG_RUNTIME_DIR", "XDG_STATE_HOME", "KEYCARD_HOME"] +) +async def test_empty_socket_variable_is_unset(unset): + env = {"HOME": "/h", unset: ""} + assert " /h/.local/state/keycard/run/agent.sock " in await _dialled(env) + + +@unix_only +@pytest.mark.asyncio +async def test_empty_socket_option_is_unset(): + with pytest.raises(NetworkError) as exc_info: + await AgentTokenSource(socket="", env={"HOME": "/h"}).resource_token(RESOURCE) + assert " /h/.local/state/keycard/run/agent.sock " in str(exc_info.value) + + +@unix_only +@pytest.mark.asyncio +async def test_empty_home_is_unset(): + source = AgentTokenSource(env={"HOME": ""}, _transport=_never_dialled()) + + with pytest.raises(ConfigError, match="HOME"): + await source.resource_token(RESOURCE) + + @unix_only @pytest.mark.asyncio async def test_row_14_keycard_toml_is_not_read(short_tmp, monkeypatch): @@ -359,16 +387,22 @@ async def test_row_26_nanosecond_expiry_against_injected_clock(): @pytest.mark.asyncio @pytest.mark.parametrize( - ("stamp", "want"), + ("stamp", "elapsed", "want"), [ - ("2030-06-01T13:00:00.5Z", 3600), - ("2030-06-01T14:00:00+01:00", 3600), - ("2030-06-01t13:00:00z", 3600), - ("2030-06-01T12:59:59.999-00:00", 3599), + ("2030-06-01T13:00:00.5Z", 0, 3600), + ("2030-06-01T14:00:00+01:00", 0, 3600), + ("2030-06-01T18:30:00+05:30", 0, 3600), + ("2030-06-01t13:00:00z", 0, 3600), + ("2030-06-01T12:59:59.999-00:00", 0, 3599), + # A fractional clock makes the expiry's fraction decide the second: + # 3600.5 - 0.25 floors to 3600, but to 3599 if the fraction is lost. + ("2030-06-01T13:00:00.5Z", 0.25, 3600), + # One digit is a tenth, not a nanosecond: 3600.1 - 0.05 is 3600. + ("2030-06-01T13:00:00.1Z", 0.05, 3600), ], ) -async def test_rfc3339_forms(stamp, want): - now = datetime(2030, 6, 1, 12, 0, 0, tzinfo=timezone.utc).timestamp() +async def test_rfc3339_forms(stamp, elapsed, want): + now = datetime(2030, 6, 1, 12, 0, 0, tzinfo=timezone.utc).timestamp() + elapsed token = await _Agent(_issued(expiresAt=stamp)).source( clock=lambda: now @@ -507,6 +541,27 @@ async def test_row_31_json_error_without_a_code_is_an_http_error(body): assert exc_info.value.status_code == 500 +@pytest.mark.asyncio +async def test_non_string_error_message_is_dropped(): + agent = _Agent(httpx.Response(503, json={"code": "unavailable", "message": 7})) + + with pytest.raises(AgentError) as exc_info: + await agent.source().resource_token(RESOURCE) + + assert exc_info.value.message == "" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("status", [201, 204, 302]) +async def test_success_other_than_200_is_an_http_error(status): + agent = _Agent(httpx.Response(status, json={"token": "tok"})) + + with pytest.raises(OAuthHttpError) as exc_info: + await agent.source().resource_token(RESOURCE) + + assert exc_info.value.status_code == status + + @pytest.mark.asyncio async def test_error_body_is_read_to_a_bounded_prefix(): # A Connect error whose JSON closes only after the bound reads as a @@ -690,6 +745,21 @@ async def test_row_35_resource_auth_attaches_bearer(): assert source.asked == [(RESOURCE, ["read"])] +@pytest.mark.asyncio +async def test_resource_auth_scopes_are_a_copy(): + source = _StubSource() + scopes = ["read"] + auth = ResourceAuth(source, RESOURCE, scopes) + scopes.append("write") + unscoped = ResourceAuth(source, RESOURCE) + + async with httpx.AsyncClient(transport=_Resource().transport()) as client: + await client.get("https://api.example.com/items", auth=auth) + await client.get("https://api.example.com/items", auth=unscoped) + + assert source.asked == [(RESOURCE, ["read"]), (RESOURCE, [])] + + @pytest.mark.asyncio async def test_row_36_source_error_propagates_and_nothing_is_sent(): declined = AgentError(AgentCode.PERMISSION_DENIED.value, "the human declined")