Metadata-Version: 2.4
Name: caracalai-oauth
Version: 0.1.5rc3
Summary: Caracal RFC 8693 token exchange client with safe in-memory caching
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: httpx>=0.28.0
Requires-Dist: idna>=3.15
Description-Content-Type: text/markdown

# Caracal OAuth for Python

Python RFC 8693 token exchange client for Caracal STS.

```python
from caracalai_oauth import ExchangeOptions, OAuthClient

client = OAuthClient("https://sts.example.com", "zone1", "app1")
token = await client.exchange(
    subject_token,
    "resource://api",
    ExchangeOptions(client_secret="client-secret", scopes=["read"]),
)
```

Successful responses are validated before caching. Cache keys isolate subject tokens, actor tokens, session/delegation context, scopes, TTL, and client authentication context. The default cache is in-memory and process-local.

Docs: https://caracal.run/sdks/oauth/
