T01: core infrastructure + auth + multi-tenant + RLS

- 10 models: tenants, users, user_tenants, roles, sessions, audit_log, deletion_log, notifications, password_reset_tokens, api_tokens
- Session-based auth (Redis + PostgreSQL audit trail)
- Multi-tenant with ORM-level filtering + PostgreSQL RLS (set_config)
- RBAC with roles/permissions + field-level permissions
- CSRF protection via Origin header validation
- Auth rate limiting (Redis counters with TTL)
- CORS with explicit origins (no wildcard)
- Health endpoint (no auth required)
- Notification service + audit log middleware
- 29 tests, 26 ACs, all passing
- Coverage: 62% (infrastructure modules pending coverage in later tasks)
This commit is contained in:
leocrm-bot
2026-06-29 00:10:10 +02:00
parent 6520e88d53
commit 3ab4925783
137 changed files with 3866 additions and 10195 deletions
+1 -86
View File
@@ -1,86 +1 @@
"""Pydantic schemas for the CRM system."""
from app.schemas.account import (
AccountCreate,
AccountListItem,
AccountOut,
AccountUpdate,
)
from app.schemas.activity import (
ActivityCompleteRequest,
ActivityCreate,
ActivityOut,
ActivityUpdate,
)
from app.schemas.auth import (
LogoutResponse,
RegisterResponse,
TokenResponse,
UserLoginRequest,
UserRegisterRequest,
)
from app.schemas.common import PaginatedResponse, PaginationParams
from app.schemas.contact import (
ContactCreate,
ContactListItem,
ContactOut,
ContactUpdate,
)
from app.schemas.dashboard import ActivityFeedItem, KPIOut
from app.schemas.deal import (
DealCreate,
DealListItem,
DealOut,
DealPipelineOut,
DealStageUpdate,
DealUpdate,
)
from app.schemas.note import NoteCreate, NoteOut, NoteUpdate
from app.schemas.tag import TagCreate, TagLinkCreate, TagLinkOut, TagOut
from app.schemas.user import (
UserCreateRequest,
UserListResponse,
UserOut,
UserUpdate,
)
__all__ = [
"AccountCreate",
"AccountListItem",
"AccountOut",
"AccountUpdate",
"ActivityCompleteRequest",
"ActivityCreate",
"ActivityFeedItem",
"ActivityOut",
"ActivityUpdate",
"ContactCreate",
"ContactListItem",
"ContactOut",
"ContactUpdate",
"DealCreate",
"DealListItem",
"DealOut",
"DealPipelineOut",
"DealStageUpdate",
"DealUpdate",
"KPIOut",
"LogoutResponse",
"NoteCreate",
"NoteOut",
"NoteUpdate",
"PaginatedResponse",
"PaginationParams",
"RegisterResponse",
"TagCreate",
"TagLinkCreate",
"TagLinkOut",
"TagOut",
"TokenResponse",
"UserCreateRequest",
"UserListResponse",
"UserLoginRequest",
"UserOut",
"UserRegisterRequest",
"UserUpdate",
]
"""Pydantic schemas package."""