Metadata-Version: 2.5
Name: secret-kernel-provider-in-memory
Version: 0.1.0a10
Summary: In-memory Secret Kernel provider for local development and tests.
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/provider-in-memory
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: secret-kernel-contracts==0.1.0a10
Requires-Dist: secret-kernel-core==0.1.0a10
Description-Content-Type: text/markdown

# secret-kernel-provider-in-memory

In-memory provider for Secret Kernel local development and tests.

```bash
uv add secret-kernel-contracts secret-kernel-provider-in-memory
```

## Usage

In the process environment — exported by the shell, or loaded from a `.env` file by
whatever starts the process:

```bash
SECRET_KERNEL_DEV_APP_DATABASE="user=app;password=secret"
```

```python
from secret_kernel.contracts import (
    GetSecretOptions,
    SecretClientOptions,
    SecretParseMode,
)
from secret_kernel.provider_in_memory import (
    InMemoryProviderOptions,
    create_in_memory_client,
)

client = create_in_memory_client(
    SecretClientOptions(env="dev", prefix="app"),
    InMemoryProviderOptions(env_secrets=True),
)

secret = await client.get_secret(
    "database", GetSecretOptions(parse=SecretParseMode.KEY_VALUE)
)
```

With `env_secrets=True`, the provider maps the resolved full name to an environment variable
key. Example: `/dev/app/database` becomes `SECRET_KERNEL_DEV_APP_DATABASE`.

Explicit values can also be preloaded by resolved full secret name, such as
`/dev/app/database/password`. Explicit `secrets` values take precedence over environment
variables.

The provider delegates name resolution, parsing and cache behavior to `secret-kernel-core`.

## Options

- `secrets`: mapping of resolved full secret names to string values or `SecretProviderValue`
  objects.
- `env_secrets`: enables environment-variable-backed local secrets.

`env_secrets` can be `True` or an `InMemoryEnvSecretsOptions`:

- `prefix`: environment variable prefix. Default: `SECRET_KERNEL`.
- `source`: a mapping to read instead of the environment, for tests. Default: `os.environ`.

## 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
