Metadata-Version: 2.5
Name: secret-kernel-core
Version: 0.1.0a10
Summary: Shared Secret Kernel implementation: name resolution, parsing, caching and the reader-backed client.
Project-URL: Homepage, https://secret-kernel.foggia.zip/?code=py
Project-URL: Documentation, https://secret-kernel.foggia.zip/?code=py
Project-URL: Source, https://github.com/brunnofoggia/secret-kernel-py/tree/main/packages/core
Project-URL: Changelog, https://secret-kernel.foggia.zip/?code=py#changelog
Project-URL: Issues, https://github.com/brunnofoggia/secret-kernel-py/issues
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: cryptography>=50.0.0
Requires-Dist: secret-kernel-contracts==0.1.0a10
Description-Content-Type: text/markdown

# secret-kernel-core

Shared implementation for Secret Kernel: name resolution, parsing, option normalization, the
in-memory cache and the reader-backed client every provider extends.

Install this distribution when you write a provider, or when a provider you install declares
it. Applications normally get it transitively.

```bash
uv add secret-kernel-core
```

## Usage

Most consumers never import it directly. Provider authors do:

```python
from dataclasses import dataclass

from secret_kernel.contracts import SecretClientOptions, SecretProviderValue
from secret_kernel.core import ReaderBackedSecretClient


@dataclass(frozen=True, slots=True)
class MyOptions:
    url: str


class MyReader:
    def __init__(self, options: MyOptions) -> None:
        self._options = options

    async def read_secret(self, full_name: str, secret_name: str) -> SecretProviderValue:
        return SecretProviderValue(value=await my_backend.get(self._options.url, full_name))

    async def close(self) -> None:
        pass


class MySecretClient(ReaderBackedSecretClient):
    provider_name = "my-backend"

    def __init__(
        self, common_options: SecretClientOptions, provider_options: MyOptions
    ) -> None:
        super().__init__(MyReader(provider_options), common_options)
```

The reader answers with a decrypted string. Caching, parsing, name resolution and
observability are kernel behavior and stay in this package, so every provider inherits them
unchanged.

## Documentation

The normative public surface is in
[`docs/secret-kernel-api-reference.md`](https://github.com/brunnofoggia/secret-kernel-py/blob/main/docs/secret-kernel-api-reference.md).

## License

MIT
