1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// Copyright (c) 2026 Kirky.X🌠 // SPDX-License-Identifier: Apache-2.0 //! config 模块辅助函数。 use super::*; /// 构造默认 JwtSecret(空字符串),避免 `Default` 实现中重复 cfg 分支。 /// /// ⚠️ 空 secret 仅用于开发/测试默认配置;生产必须经配置文件或环境变量设置非空 secret,否则攻击者可伪造任意 token。 pub(crate) fn default_jwt_secret() -> JwtSecret { #[cfg(feature = "protocol-zeroize")] { String::new().into() } #[cfg(not(feature = "protocol-zeroize"))] { String::new() } }