fix
This commit is contained in:
parent
998354293b
commit
a2e9b1c65f
@ -1,16 +1,16 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/pycqa/isort
|
||||||
rev: v0.5.2
|
rev: 5.13.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: isort
|
||||||
- id: ruff-format
|
args: ["--profile", "black", "--line-length", "88"]
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 24.4.2
|
rev: 24.4.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/pycqa/isort
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: 5.13.2
|
rev: v0.5.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: ruff
|
||||||
|
|||||||
@ -1,2 +1 @@
|
|||||||
"""Пакет приложения SFM Streamlit."""
|
"""Пакет приложения SFM Streamlit."""
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1 @@
|
|||||||
"""Вспомогательные модули аутентификации SFM Streamlit."""
|
"""Вспомогательные модули аутентификации SFM Streamlit."""
|
||||||
|
|
||||||
|
|||||||
@ -31,4 +31,3 @@ def get_jwt_token() -> dict[str, str] | None:
|
|||||||
"realm_access": {"roles": ["local_dev"]},
|
"realm_access": {"roles": ["local_dev"]},
|
||||||
}
|
}
|
||||||
return st.session_state["local_mock_profile"]
|
return st.session_state["local_mock_profile"]
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any, Protocol
|
from typing import Any, Protocol
|
||||||
|
|
||||||
|
|
||||||
from .mock_provider import get_jwt_token as get_jwt_token_local
|
from .mock_provider import get_jwt_token as get_jwt_token_local
|
||||||
from .mock_provider import protect_application as protect_application_local
|
from .mock_provider import protect_application as protect_application_local
|
||||||
|
|
||||||
@ -19,11 +18,11 @@ class LocalMockProvider:
|
|||||||
|
|
||||||
class RaisaProvider:
|
class RaisaProvider:
|
||||||
def get_token_data(self) -> dict[str, Any] | None:
|
def get_token_data(self) -> dict[str, Any] | None:
|
||||||
from raisa_streamlit_oauth import ( # type: ignore[reportMissingImports]
|
from raisa_streamlit_oauth import (
|
||||||
get_jwt_token as get_jwt_token_raisa,
|
get_jwt_token as get_jwt_token_raisa, # type: ignore[reportMissingImports]
|
||||||
)
|
)
|
||||||
from raisa_streamlit_oauth import ( # type: ignore[reportMissingImports]
|
from raisa_streamlit_oauth import (
|
||||||
protect_application as protect_application_raisa,
|
protect_application as protect_application_raisa, # type: ignore[reportMissingImports]
|
||||||
)
|
)
|
||||||
|
|
||||||
protect_application_raisa(render_exit=False)
|
protect_application_raisa(render_exit=False)
|
||||||
@ -31,7 +30,4 @@ class RaisaProvider:
|
|||||||
|
|
||||||
|
|
||||||
def build_auth_provider() -> AuthProvider:
|
def build_auth_provider() -> AuthProvider:
|
||||||
if get_location() == "local":
|
|
||||||
return LocalMockProvider()
|
|
||||||
return RaisaProvider()
|
return RaisaProvider()
|
||||||
|
|
||||||
|
|||||||
@ -38,4 +38,3 @@ class AuthService:
|
|||||||
st.session_state["token_data"] = token_data
|
st.session_state["token_data"] = token_data
|
||||||
st.session_state["user_profile"] = token_data
|
st.session_state["user_profile"] = token_data
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user