MaxKB/apps/common/constants/cache_version.py
shaohuzhang1 04642eb497
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
feat: authentication
2025-04-15 20:37:38 +08:00

26 lines
774 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# coding=utf-8
"""
@project: MaxKB
@Author虎虎
@file cache_version.py
@date2025/4/14 19:09
@desc:
"""
from enum import Enum
class Cache_Version(Enum):
# 令牌
TOKEN = "TOKEN", lambda token: token
# 工作空间列表
WORKSPACE_LIST = "WORKSPACE::LIST", lambda user_id: user_id
# 用户数据
USER = "USER", lambda user_id: user_id
# 当前用户在当前工作空间的角色列表+本身的角色
ROLE_LIST = "ROLE::LIST", lambda user_id, workspace_id: f"{user_id}::{workspace_id}"
# 当前用户在当前工作空间的权限列表+本身的权限列表
PERMISSION_LIST = "PERMISSION::LIST", lambda user_id, workspace_id: f"{user_id}::{workspace_id}"
version, get_key = Cache_Version.TOKEN.value