Skip to content

Commit

Permalink
feat: refactor base
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrvlh committed Nov 3, 2024
1 parent cf5fadf commit 5fbce08
Show file tree
Hide file tree
Showing 25 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/how-to-guides/use-with-fastapi-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ from litestar import Litestar, Depends, HTTPException, Security, Request
from litestar.responses import RedirectResponse
from litestar.security import APIKeyCookie # this is the part that puts the lock icon to the docs
from litestar_sso.sso.google import GoogleSSO # pip install litestar-sso
from litestar_sso.sso.base import OpenID
from litestar_sso.base import OpenID

from jose import jwt # pip install python-jose[cryptography]

Expand Down
2 changes: 1 addition & 1 deletion examples/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from litestar import Litestar, Request, get
from litestar.exceptions import HTTPException

from litestar_sso.sso.base import DiscoveryDocument, OpenID
from litestar_sso.base import DiscoveryDocument, OpenID
from litestar_sso.sso.generic import create_provider

app = Litestar()
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(such as Facebook login, Google login and login via Microsoft Office 365 account)
"""

from .sso.base import OpenID, SSOBase, SSOLoginError
from .base import OpenID, SSOBase, SSOLoginError
from .sso.facebook import FacebookSSO
from .sso.fitbit import FitbitSSO
from .sso.generic import create_provider
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion litestar_sso/sso/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/fitbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase, SSOLoginError
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase, SSOLoginError

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Type, Union

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import pydantic

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import httpx

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase, SSOLoginError
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase, SSOLoginError


class GoogleSSO(SSOBase):
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/kakao.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Dict, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/microsoft.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import pydantic

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/naver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, List, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/notion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase, SSOLoginError
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase, SSOLoginError

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/seznam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion litestar_sso/sso/yandex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING, ClassVar, Optional

from litestar_sso.sso.base import DiscoveryDocument, OpenID, SSOBase
from litestar_sso.base import DiscoveryDocument, OpenID, SSOBase

if TYPE_CHECKING:
import httpx # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
from utils import Request

from litestar_sso.sso.base import SecurityWarning, SSOBase, SSOLoginError, UnsetStateWarning
from litestar_sso.base import SecurityWarning, SSOBase, SSOLoginError, UnsetStateWarning


class TestSSOBase:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generic_provider.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from litestar_sso.sso.base import OpenID
from litestar_sso.base import OpenID
from litestar_sso.sso.generic import create_provider

DISCOVERY = {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_openid_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from litestar_sso.sso.base import OpenID, SSOBase
from litestar_sso.base import OpenID, SSOBase
from litestar_sso.sso.facebook import FacebookSSO
from litestar_sso.sso.fitbit import FitbitSSO
from litestar_sso.sso.github import GithubSSO
Expand Down
8 changes: 4 additions & 4 deletions tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from litestar.response import Redirect
from utils import AnythingDict, Request, Response, make_fake_async_client

from litestar_sso.sso.base import OpenID, SSOBase
from litestar_sso.sso.base import OpenID
from litestar_sso.sso.base import SSOBase
from litestar_sso.sso.base import SecurityWarning
from litestar_sso.base import OpenID, SSOBase
from litestar_sso.base import OpenID
from litestar_sso.base import SSOBase
from litestar_sso.base import SecurityWarning
from litestar_sso.sso.facebook import FacebookSSO
from litestar_sso.sso.fitbit import FitbitSSO
from litestar_sso.sso.generic import create_provider
Expand Down
2 changes: 1 addition & 1 deletion tests/test_race_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def get(self, *args, **kwargs):
await asyncio.sleep(0)
return Response(token="")

with patch("litestar_sso.sso.base.httpx") as httpx:
with patch("litestar_sso.base.httpx") as httpx:
httpx.AsyncClient = AsyncClient

first_response = Response(token="first_token") # noqa: S106
Expand Down

0 comments on commit 5fbce08

Please sign in to comment.