forked from cardosofelipe/pragma-stack
- introduce custom repository exception hierarchy (DuplicateEntryError, IntegrityConstraintError, InvalidInputError) replacing raw ValueError - eliminate all direct repository imports and raw SQL from route layer - add UserService, SessionService, OrganizationService to service layer - add get_stats/get_org_distribution service methods replacing admin inline SQL - fix timing side-channel in authenticate_user via dummy bcrypt check - replace SHA-256 client secret fallback with explicit InvalidClientError - replace assert with InvalidGrantError in authorization code exchange - replace N+1 token revocation loops with bulk UPDATE statements - rename oauth account token fields (drop misleading 'encrypted' suffix) - add Alembic migration 0003 for token field column rename - add 45 new service/repository tests; 975 passing, 94% coverage
40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
# app/repositories/__init__.py
|
|
"""Repository layer — all database access goes through these classes."""
|
|
|
|
from app.repositories.oauth_account import OAuthAccountRepository, oauth_account_repo
|
|
from app.repositories.oauth_authorization_code import (
|
|
OAuthAuthorizationCodeRepository,
|
|
oauth_authorization_code_repo,
|
|
)
|
|
from app.repositories.oauth_client import OAuthClientRepository, oauth_client_repo
|
|
from app.repositories.oauth_consent import OAuthConsentRepository, oauth_consent_repo
|
|
from app.repositories.oauth_provider_token import (
|
|
OAuthProviderTokenRepository,
|
|
oauth_provider_token_repo,
|
|
)
|
|
from app.repositories.oauth_state import OAuthStateRepository, oauth_state_repo
|
|
from app.repositories.organization import OrganizationRepository, organization_repo
|
|
from app.repositories.session import SessionRepository, session_repo
|
|
from app.repositories.user import UserRepository, user_repo
|
|
|
|
__all__ = [
|
|
"UserRepository",
|
|
"user_repo",
|
|
"OrganizationRepository",
|
|
"organization_repo",
|
|
"SessionRepository",
|
|
"session_repo",
|
|
"OAuthAccountRepository",
|
|
"oauth_account_repo",
|
|
"OAuthAuthorizationCodeRepository",
|
|
"oauth_authorization_code_repo",
|
|
"OAuthClientRepository",
|
|
"oauth_client_repo",
|
|
"OAuthConsentRepository",
|
|
"oauth_consent_repo",
|
|
"OAuthProviderTokenRepository",
|
|
"oauth_provider_token_repo",
|
|
"OAuthStateRepository",
|
|
"oauth_state_repo",
|
|
]
|