Metadata-Version: 2.5
Name: ciridae
Version: 0.5.2
Summary: Public Python clients, models, and project utilities for Ciridae
Project-URL: Repository, https://github.com/ciridae-ai/ciridae
Requires-Python: >=3.13
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic>=2.11.7
Requires-Dist: pyyaml>=6.0.3
Requires-Dist: ruamel-yaml>=0.18.16
Provides-Extra: email-preview
Requires-Dist: playwright>=1.55; extra == 'email-preview'
Provides-Extra: fastapi
Requires-Dist: cachetools>=7.1.4; extra == 'fastapi'
Requires-Dist: fastapi>=0.135.2; extra == 'fastapi'
Provides-Extra: openapi-tools
Requires-Dist: jsonschema>=4.26.0; extra == 'openapi-tools'
Requires-Dist: mcp<2,>=1.28.1; extra == 'openapi-tools'
Requires-Dist: openapi-pydantic==0.5.1; extra == 'openapi-tools'
Requires-Dist: referencing>=0.36.2; extra == 'openapi-tools'
Provides-Extra: temporal-sentry
Requires-Dist: sentry-sdk>=2.57.0; extra == 'temporal-sentry'
Requires-Dist: temporalio>=1.27.2; extra == 'temporal-sentry'
Description-Content-Type: text/markdown

# Ciridae

Public Python clients, models, and project utilities. This directory assembles
owned namespaces from the other `libs/` packages; [public-package-files.txt](public-package-files.txt)
is the reviewed public artifact boundary.

```bash
pip install ciridae
ciridae validate-project project.yaml
ciridae format-project project.yaml --check
```

Optional integrations use `ciridae[openapi-tools]` or `ciridae[temporal-sentry]`.
Domain sources and tests live in their owner directories, not a second copy here.

## Releasing

From the repo root, add a `pypi/ciridae` [Sampo changeset](../../.sampo/README.md)
with `pnpm changeset`, then run `pnpm version-packages`. Commit the generated
version, changelog, and root `uv.lock` in the same PR and merge to `main`;
`.github/workflows/ciridae-publish.yml` publishes it through PyPI Trusted
Publishing when a push changes the version, and a rerun uploads only the files
PyPI lacks. Releases are immutable. Before 1.0, patch covers compatible/additive
changes and minor covers breaking changes. After 1.0, use normal SemVer.

## Auth v2 and role types

FastAPI backends can install the verification dependencies, which forward a
caller's `Authorization: Bearer` Firebase token to the Auth Service's
`POST /v2/access`:

```console
pip install "ciridae[fastapi]"
```

```python
from ciridae.auth import get_auth_service_origin
from ciridae.auth.principal_verifier import PrincipalVerifier

verifier = PrincipalVerifier(
    auth_service_origin=get_auth_service_origin(settings.AUTH_SERVICE_API_URL),
    api_key=settings.AUTH_SERVICE_API_KEY,
)
```

The v2 client and verifier take the Auth Service origin and build `/v2/...`
paths from it, so apps keep their existing `AUTH_SERVICE_API_URL` (the v1 root).
`AuthServiceV2Client.from_env()` builds the client from `AUTH_SERVICE_API_URL`
and `AUTH_SERVICE_API_KEY`.

Print the project's Auth roles and the permissions each carries, using the
project's service API key in `AUTH_SERVICE_API_KEY`:

```console
ciridae auth roles --api-url "$AUTH_SERVICE_API_URL"
```

The Service v2 client creates or replaces a member with
`AuthServiceV2Client.put_member(user_id, role=..., metadata=...)`, where omitted
metadata becomes `{}`, and changes an existing member with
`patch_member(user_id, role=..., metadata=...)`, which keeps omitted fields and
never adds a member. `create_invite` requires a `redirect_url` authorized for
the project.
