Files
ess-helm/scripts/migration/interfaces.py
T
Gaël Goinvic ab0b67674a Migration: Add support for secret discovery
- Each secret can exist either inline or in config
- This discovers secrets and prompt for missing ones
- Secrets are outputed in dedicated files
- Helm Values will refer to the secret data imported in kubernetes
2026-02-20 15:43:03 +01:00

48 lines
1.1 KiB
Python

# Copyright 2026 Element Creations Ltd
#
# SPDX-License-Identifier: AGPL-3.0-only
"""
Interfaces for the migration system.
"""
from typing import Any, Protocol, runtime_checkable
from .models import SecretConfig
@runtime_checkable
class MigrationStrategy(Protocol):
"""Interface for migration strategies."""
@property
def component_root_key(self) -> str:
"""Get the component root key (e.g., 'synapse', 'matrixAuthenticationService')."""
...
@property
def override_configs(self) -> set[str]:
"""Get component-specific override configurations."""
...
@property
def transformations(self) -> list[Any]:
"""Get component-specific transformations."""
...
@runtime_checkable
class SecretDiscoveryStrategy(Protocol):
"""Minimal interface for secret discovery strategies."""
@property
def ess_secret_schema(self) -> dict[str, SecretConfig]:
"""Get the ESS secret schema for this component."""
...
@property
def component_name(self) -> str:
"""Get the component name for user-facing messages."""
...