Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /fief-dev_fief /fief /repositories /oauth_account.py
| from pydantic import UUID4 | |
| from sqlalchemy import select | |
| from sqlalchemy.sql import Select | |
| from fief.models import OAuthAccount | |
| from fief.repositories.base import BaseRepository, UUIDRepositoryMixin | |
| class OAuthAccountRepository( | |
| BaseRepository[OAuthAccount], UUIDRepositoryMixin[OAuthAccount] | |
| ): | |
| model = OAuthAccount | |
| async def get_by_provider_and_account_id( | |
| self, provider_id: UUID4, account_id: str | |
| ) -> OAuthAccount | None: | |
| statement = select(OAuthAccount).where( | |
| OAuthAccount.oauth_provider_id == provider_id, | |
| OAuthAccount.account_id == account_id, | |
| ) | |
| return await self.get_one_or_none(statement) | |
| async def get_by_provider_and_user( | |
| self, provider_id: UUID4, user: UUID4 | |
| ) -> OAuthAccount | None: | |
| statement = select(OAuthAccount).where( | |
| OAuthAccount.oauth_provider_id == provider_id, | |
| OAuthAccount.user_id == user, | |
| ) | |
| return await self.get_one_or_none(statement) | |
| def get_by_user_statement(self, user: UUID4) -> Select: | |
| statement = select(OAuthAccount).where(OAuthAccount.user_id == user) | |
| return statement | |
Xet Storage Details
- Size:
- 1.17 kB
- Xet hash:
- 02c22f74e14fed57303fa265ae721a2d8cce09b3e47e638e0c0aefdb53d4b2b7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.