Files
dify/api/constants/__init__.py
T
+24
-LAN-GitHubCopilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>Yunlu WenJoelGareArcNFishDavide Delbiancominglu7Pondercrazywoolagemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>heysztAsuka MinatoGuangdong LiuEric GuoNeatGuyCodingXlKsytDhruv Gorasiyacrazywoolagithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>lyzno1hj24GuanMu非法操作CopilotTonloYusuke YamadaNovicekenwoodjwAdemílson Tonatoznnyangzheli
9a5f214623 refactor: replace localStorage with HTTP-only cookies for auth tokens (#24365)
Signed-off-by: NeatGuyCoding <[email protected]>
Signed-off-by: lyzno1 <[email protected]>
Signed-off-by: kenwoodjw <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yunlu Wen <[email protected]>
Co-authored-by: Joel <[email protected]>
Co-authored-by: GareArc <[email protected]>
Co-authored-by: NFish <[email protected]>
Co-authored-by: Davide Delbianco <[email protected]>
Co-authored-by: minglu7 <[email protected]>
Co-authored-by: Ponder <[email protected]>
Co-authored-by: crazywoola <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: heyszt <[email protected]>
Co-authored-by: Asuka Minato <[email protected]>
Co-authored-by: Guangdong Liu <[email protected]>
Co-authored-by: Eric Guo <[email protected]>
Co-authored-by: NeatGuyCoding <[email protected]>
Co-authored-by: XlKsyt <[email protected]>
Co-authored-by: Dhruv Gorasiya <[email protected]>
Co-authored-by: crazywoola <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: lyzno1 <[email protected]>
Co-authored-by: hj24 <[email protected]>
Co-authored-by: GuanMu <[email protected]>
Co-authored-by: 非法操作 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Tonlo <[email protected]>
Co-authored-by: Yusuke Yamada <[email protected]>
Co-authored-by: Novice <[email protected]>
Co-authored-by: kenwoodjw <[email protected]>
Co-authored-by: Ademílson Tonato <[email protected]>
Co-authored-by: znn <[email protected]>
Co-authored-by: yangzheli <[email protected]>
2025-10-19 21:29:04 +08:00

67 lines
1.6 KiB
Python

from configs import dify_config
from libs.collection_utils import convert_to_lower_and_upper_set
HIDDEN_VALUE = "[__HIDDEN__]"
UNKNOWN_VALUE = "[__UNKNOWN__]"
UUID_NIL = "00000000-0000-0000-0000-000000000000"
DEFAULT_FILE_NUMBER_LIMITS = 3
IMAGE_EXTENSIONS = convert_to_lower_and_upper_set({"jpg", "jpeg", "png", "webp", "gif", "svg"})
VIDEO_EXTENSIONS = convert_to_lower_and_upper_set({"mp4", "mov", "mpeg", "webm"})
AUDIO_EXTENSIONS = convert_to_lower_and_upper_set({"mp3", "m4a", "wav", "amr", "mpga"})
_doc_extensions: set[str]
if dify_config.ETL_TYPE == "Unstructured":
_doc_extensions = {
"txt",
"markdown",
"md",
"mdx",
"pdf",
"html",
"htm",
"xlsx",
"xls",
"vtt",
"properties",
"doc",
"docx",
"csv",
"eml",
"msg",
"pptx",
"xml",
"epub",
}
if dify_config.UNSTRUCTURED_API_URL:
_doc_extensions.add("ppt")
else:
_doc_extensions = {
"txt",
"markdown",
"md",
"mdx",
"pdf",
"html",
"htm",
"xlsx",
"xls",
"docx",
"csv",
"vtt",
"properties",
}
DOCUMENT_EXTENSIONS: set[str] = convert_to_lower_and_upper_set(_doc_extensions)
COOKIE_NAME_ACCESS_TOKEN = "access_token"
COOKIE_NAME_REFRESH_TOKEN = "refresh_token"
COOKIE_NAME_PASSPORT = "passport"
COOKIE_NAME_CSRF_TOKEN = "csrf_token"
HEADER_NAME_CSRF_TOKEN = "X-CSRF-Token"
HEADER_NAME_APP_CODE = "X-App-Code"
HEADER_NAME_PASSPORT = "X-App-Passport"