This commit is contained in:
Raykov-MS 2026-06-04 16:57:08 +03:00
parent 998354293b
commit a2e9b1c65f
7 changed files with 11 additions and 20 deletions

View File

@ -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

View File

@ -1,2 +1 @@
"""Пакет приложения SFM Streamlit."""

View File

@ -1,2 +1 @@
"""Вспомогательные модули аутентификации SFM Streamlit."""

View File

@ -31,4 +31,3 @@ def get_jwt_token() -> dict[str, str] | None:
"realm_access": {"roles": ["local_dev"]},
}
return st.session_state["local_mock_profile"]

View File

@ -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()

View File

@ -38,4 +38,3 @@ class AuthService:
st.session_state["token_data"] = token_data
st.session_state["user_profile"] = token_data
return True

View File

@ -14,4 +14,3 @@ def render_profile(profile: dict) -> None:
"realm_roles": profile.get("realm_access", {}).get("roles", []),
}
)