Metadata-Version: 2.4
Name: kangal-plugin-sdk
Version: 1.0.2
Summary: Public runtime and manifest contract for Kangal plugins
Project-URL: Documentation, https://docs.kangal.dev/sdks/plugin-sdk
Project-URL: Issues, https://github.com/latifv/kangal/issues
Project-URL: Source, https://github.com/latifv/kangal/tree/main/sdk/python
Keywords: api-gateway,kangal,plugin,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=44

# Kangal Plugin SDK

The Kangal Plugin SDK provides the public Python runtime and signed manifest
contract for custom Kangal gateway policies.

## Install

```bash
python -m pip install kangal-plugin-sdk
```

Python 3.11 or newer is required.

## Create a plugin

```python
from typing import Any

from kangal_plugin_sdk import Plugin


class AddRequestHeader(Plugin):
    async def before_request(
        self,
        request: Any,
        headers: dict[str, str],
        tenant_id: str,
    ) -> dict[str, str]:
        return {**headers, "X-Kangal-Plugin": "active"}
```

The package also exposes helpers for canonical manifest hashing, protocol
validation, and Ed25519 manifest signing. Start from the complete
[plugin SDK guide](https://docs.kangal.dev/sdks/plugin-sdk) and the
[header policy example](https://github.com/latifv/kangal/tree/main/sdk/examples/header_policy).

## Verify a release

Every GitHub release includes a wheel, source distribution, and
`SHA256SUMS.txt`. Each package artifact also receives a keyless Sigstore bundle
that binds its digest to the GitHub Actions release identity.
