garrison 0.9.0

Garrison - 面向 Rust 生态的一站式身份认证鉴权框架
Documentation
// 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()
    }
}