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