from __future__ import annotations from typing import TYPE_CHECKING from uuid import UUID from app.schemas.base import OrmBase if TYPE_CHECKING: from app.models.secret import Secret class SecretBase(OrmBase): scope_type: str scope_id: UUID key: str class SecretCreate(SecretBase): value: str class SecretRead(SecretBase): id: UUID value: str = "••••••" @classmethod def from_secret(cls, secret: Secret) -> SecretRead: return cls( id=secret.id, scope_type=secret.scope_type, scope_id=secret.scope_id, key=secret.key, value="••••••", ) class SecretUpdate(OrmBase): key: str | None = None value: str | None = None