100 lines
2.5 KiB
Python
100 lines
2.5 KiB
Python
# Copyright 2026 Umbra Tools (umbratools.com)
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
"""UmbraTrans web account management: phase-1 identity slice.
|
|
|
|
This package implements the first backend slice described in
|
|
``docs/umbratrans-backend-design.md``: accounts, both enrollment modes, Argon2id
|
|
credentials, server-side sessions, administrator lifecycle actions, and
|
|
sanitized audit events, plus a FastAPI application factory.
|
|
|
|
It does not connect to PostgreSQL. The reviewed migration in
|
|
``umbratrans_web/migrations/`` is intentionally unapplied, and the production
|
|
repository adapter is not part of this slice, so the application fails closed
|
|
rather than starting without an audit-reviewed store.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from .config import SERVICE_NAME, SERVICE_VERSION, Environment, Settings, load_settings, suite_settings
|
|
from .errors import (
|
|
AuthenticationRequiredError,
|
|
ConfigurationError,
|
|
ConflictError,
|
|
CsrfError,
|
|
EnrollmentRefusedError,
|
|
ForbiddenError,
|
|
InputError,
|
|
InvalidCredentialsError,
|
|
NotFoundError,
|
|
OperatorRefusalError,
|
|
PasswordChangeRequiredError,
|
|
PasswordPolicyError,
|
|
RepositoryError,
|
|
StateTransitionError,
|
|
UmbraWebError,
|
|
)
|
|
from .models import (
|
|
AccountStatus,
|
|
AccountView,
|
|
AuditEvent,
|
|
AuthenticationResult,
|
|
CredentialRecord,
|
|
CredentialType,
|
|
EnrollmentMode,
|
|
IssuedSession,
|
|
Principal,
|
|
RoleName,
|
|
SessionRecord,
|
|
User,
|
|
)
|
|
from .repository import AccountRepository, InMemoryAccountRepository
|
|
from .security import PasswordPolicy, PasswordService
|
|
from .service import AccountService, OperatorContext
|
|
|
|
__version__ = SERVICE_VERSION
|
|
|
|
__all__ = [
|
|
"SERVICE_NAME",
|
|
"SERVICE_VERSION",
|
|
"AccountRepository",
|
|
"AccountService",
|
|
"AccountStatus",
|
|
"AccountView",
|
|
"AuditEvent",
|
|
"AuthenticationRequiredError",
|
|
"AuthenticationResult",
|
|
"AuditEvent",
|
|
"ConfigurationError",
|
|
"ConflictError",
|
|
"CredentialRecord",
|
|
"CredentialType",
|
|
"CsrfError",
|
|
"EnrollmentMode",
|
|
"EnrollmentRefusedError",
|
|
"Environment",
|
|
"ForbiddenError",
|
|
"InputError",
|
|
"InMemoryAccountRepository",
|
|
"InvalidCredentialsError",
|
|
"IssuedSession",
|
|
"NotFoundError",
|
|
"OperatorContext",
|
|
"OperatorRefusalError",
|
|
"PasswordChangeRequiredError",
|
|
"PasswordPolicy",
|
|
"PasswordPolicyError",
|
|
"PasswordService",
|
|
"Principal",
|
|
"RepositoryError",
|
|
"RoleName",
|
|
"SessionRecord",
|
|
"Settings",
|
|
"StateTransitionError",
|
|
"UmbraWebError",
|
|
"User",
|
|
"__version__",
|
|
"load_settings",
|
|
"suite_settings",
|
|
]
|