1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Copyright (c) 2026 Kirky.X. All rights reserved.
//! See LICENSE for full license text.
//! HTTP Basic 认证子模块(RFC 7617)。
//!
//! 对应 Basic 认证能力,
//! 基于 `base64` crate 实现用户名密码的编解码。
//!
//! 所有方法均为关联函数,`HttpBasicAuth` struct 不持有任何状态。
/// Basic 认证凭证,承载解码后的用户名与密码。
/// HTTP Basic 认证工具,封装 RFC 7617 编解码逻辑。
///
/// 所有方法为关联函数,无需实例化即可调用:
///
/// ```
/// #[cfg(feature = "secure-httpbasic")]
/// # {
/// use garrison::secure::httpbasic::HttpBasicAuth;
/// let encoded = HttpBasicAuth::encode("alice", "secret");
/// let cred = HttpBasicAuth::decode(&encoded).unwrap();
/// assert_eq!(cred.user, "alice");
/// assert_eq!(cred.pass, "secret");
/// # }
/// ```
;
/// `HttpBasicAuth` 实现块(encode / decode / parse_authorization_header)。