julee.repositories.minio.policy

Minio implementation of PolicyRepository.

This module provides a Minio-based implementation of the PolicyRepository protocol that follows the Clean Architecture patterns defined in the Fun-Police Framework. It handles policy storage as JSON objects in Minio, ensuring idempotency and proper error handling.

The implementation stores policies as JSON objects in Minio, following the large payload handling pattern from the architectural guidelines. Each policy is stored as a complete JSON document with its validation scores and transformation queries.

Classes

MinioPolicyRepository

Minio implementation of PolicyRepository using Minio for persistence.

Module Contents

class julee.repositories.minio.policy.MinioPolicyRepository(client)[source]

Bases: julee.domain.repositories.policy.PolicyRepository, julee.repositories.minio.client.MinioRepositoryMixin

Minio implementation of PolicyRepository using Minio for persistence.

This implementation stores policies as JSON objects in the “policies” bucket. Each policy includes its complete validation scores and optional transformation queries.

async generate_id()[source]

Generate a unique policy identifier.

async get(policy_id)[source]

Retrieve a policy by ID.

async get_many(policy_ids)[source]

Retrieve multiple policies by ID.

Parameters:

policy_ids (list[str]) – List of unique policy identifiers

Returns:

Dict mapping policy_id to Policy (or None if not found)

Return type:

dict[str, julee.domain.models.policy.Policy | None]

async save(policy)[source]

Save a policy to Minio.

client[source]
logger[source]
policies_bucket = 'policies'[source]