Ensure the current user is an API token.
(current_user)
| 56 | |
| 57 | |
| 58 | def _require_api_token(current_user) -> APITokenUser: |
| 59 | """Ensure the current user is an API token.""" |
| 60 | if not isinstance(current_user, APITokenUser): |
| 61 | raise HTTPException( |
| 62 | status_code=status.HTTP_403_FORBIDDEN, |
| 63 | detail="This endpoint requires API token authentication", |
| 64 | ) |
| 65 | return current_user |
| 66 | |
| 67 | |
| 68 | async def _resolve_org_slug(org_slug: str, token_user: APITokenUser, db_session: AsyncSession) -> Organization: |
no outgoing calls