Refactor frontend views
All checks were successful
Build and push image / build-containers (push) Successful in 10m14s

This commit is contained in:
2025-06-14 21:56:17 +02:00
parent b3debd3ed2
commit bce372a1d1
32 changed files with 1230 additions and 458 deletions

View File

@ -16,7 +16,7 @@ from sshecret.backend import (
Operation,
SubSystem,
)
from sshecret.backend.models import DetailedSecrets
from sshecret.backend.models import ClientQueryResult, DetailedSecrets
from sshecret.backend.api import AuditAPI, KeySpec
from sshecret.crypto import encrypt_string, load_public_key
@ -113,6 +113,17 @@ class AdminBackend:
except Exception as e:
raise BackendUnavailableError() from e
async def query_clients(
self, filter: ClientFilter | None = None
) -> ClientQueryResult:
"""Query clients."""
try:
return await self.backend.query_clients(filter)
except ClientManagementError:
raise
except Exception as e:
raise BackendUnavailableError() from e
async def _get_client(self, idname: KeySpec) -> Client | None:
"""Get a client from the backend."""
return await self.backend.get_client(idname)
@ -142,6 +153,10 @@ class AdminBackend:
except Exception as e:
raise BackendUnavailableError() from e
async def get_client_count(self, filter: ClientFilter | None = None) -> int:
"""Count the clients, optionally with filter."""
return await self.backend.get_client_count(filter)
async def _create_client(
self,
name: str,