Metadata-Version: 2.4
Name: fastpluggy-minio-tools
Version: 0.1.9
Summary: MinIO plugin for FastPluggy
Author: FastPluggy Team
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: FastPluggy<1,>=0.4.95
Requires-Dist: loguru
Requires-Dist: minio>=7.0.0
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Requires-Dist: pytest-cov>=4.0; extra == "tests"
Provides-Extra: e2e
Requires-Dist: fastpluggy-cli; extra == "e2e"
Requires-Dist: playwright>=1.40.0; extra == "e2e"
Dynamic: license-file

# fastpluggy-minio-tools

![MinIO Tools](https://img.shields.io/badge/FastPluggy-MinIO%20Tools-blue)
[![Release](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/-/badges/release.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/-/releases)
[![Pipeline Status](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/badges/master/pipeline.svg?key_text=CI)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/-/pipelines?ignore_skipped=true)
[![Coverage](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/badges/master/coverage.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/-/pipelines)

MinIO plugin for FastPluggy: shared MinIO clients for other plugins (a named client registry), and an admin page with the connection status and the bucket list.

## Installation

```bash
pip install fastpluggy-minio-tools
```

## Dependencies

- loguru
- minio >= 7.0.0

## Features

- **Shared MinIO clients for other plugins**: a thread-safe registry of named clients, exposed via GlobalRegistry as `get_minio_client()`, `register_minio_client()`, `unregister_minio_client()` and `list_minio_clients()`. Plugins register per-endpoint clients at runtime.
- `minio_get_stream(bucket, object_name, key_name=None)` via GlobalRegistry: read an object as a stream (default client when `key_name` is `None`). The default client itself is also registered as `minio_client`.
- **Admin page** (`/admin/minio`, "MinIO" in the admin menu): connection status of the default client and the list of buckets with their creation date.

Not available yet: browsing the objects of a bucket, uploading, downloading and deleting files from the admin page ([#1](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/minio_tools/-/work_items/1)).

The default client and the GlobalRegistry functions are registered only when `minio_endpoint` is set.

## Named clients

Other plugins can register additional MinIO clients for different endpoints/credentials:

```python
register = GlobalRegistry.get_global("register_minio_client")
client = register("my-key", "s3.example.com:9000", "access", "secret")
```

**Note:** Per-mount credentials are stored in plaintext by consuming plugins — acceptable for admin-only homelab use. See [docs/README.md](docs/README.md) for details.

## Documentation

See [docs/README.md](docs/README.md) for full API reference and usage examples.
