32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
from __future__ import annotations
|
||
|
||
import streamlit as st
|
||
|
||
from app.config import SETTINGS_PREFIX, get_missing_settings
|
||
|
||
|
||
def render_env_check() -> None:
|
||
with st.expander("Проверка env окружения"):
|
||
if st.button("Проверить OPENBAO__SETTINGS", use_container_width=True):
|
||
missing = get_missing_settings()
|
||
if missing:
|
||
st.error("Не заданы обязательные переменные:")
|
||
for name in missing:
|
||
st.code(f"{SETTINGS_PREFIX}{name} (резерв: {name})", language="text")
|
||
else:
|
||
st.success("Все обязательные переменные заданы.")
|
||
|
||
|
||
def render_profile(profile: dict) -> None:
|
||
st.success("Аутентификация через Keycloak Raisa выполнена.")
|
||
st.subheader("Профиль пользователя")
|
||
st.json(
|
||
{
|
||
"email": profile.get("email"),
|
||
"preferred_username": profile.get("preferred_username"),
|
||
"name": profile.get("name"),
|
||
"realm_roles": profile.get("realm_access", {}).get("roles", []),
|
||
}
|
||
)
|
||
|