pub struct BrokerAuthRequest<'a> {
pub http: &'a Client,
pub client_type: u8,
pub uid: u64,
pub broker_id: u32,
pub auth_code: &'a str,
pub device_id: &'a str,
pub web_tcp_identity: u32,
pub web_tcp_addrs: &'a [(String, u16)],
pub site_config: Option<&'a SharedSiteConfig>,
pub auth_guaranteed_domains: &'a AuthGuaranteedDomainMap,
pub auth_guaranteed_domains_configured: bool,
pub route_cache: Option<&'a BrokerAuthRouteCache>,
}Expand description
向 broker auth 域名发 /broker_auth/client_auth POST 请求,换取
broker_client_sig + broker_client_key。
对齐 C++ auth_impl.cpp:640-674(RefreshBrokerClientSig)+
auth_impl.cpp:3378-3480(ParseBrokerAuthResponse):
- URL:
POST https://{broker_auth_domain}/broker_auth/client_auth - Body:
{"uid", "auth_code", "device_id", "broker_id"} - 响应 result 里的
broker_client_key是 base64 编码 + AES-CBC-MD5 加密过的
⚠️ 解密不是用 rand_key!对齐 auth_impl.cpp:3434 —— 该处调用
DecryptByRandKey(&broker_client_key, nullptr),nullptr 触发
auth_cryptor.cpp:324-332 分支:用固定默认 key 解密(先试 AES-256
AUTH_DEFAULT_KEY_32,失败兜底 AES-128 AUTH_DEFAULT_KEY),不是
Platform client_key 用的 rand_key。
Fields§
§http: &'a Client§client_type: u8§uid: u64§broker_id: u32§auth_code: &'a str§device_id: &'a str§web_tcp_identity: u32§web_tcp_addrs: &'a [(String, u16)]§site_config: Option<&'a SharedSiteConfig>§auth_guaranteed_domains: &'a AuthGuaranteedDomainMap§auth_guaranteed_domains_configured: bool§route_cache: Option<&'a BrokerAuthRouteCache>Auto Trait Implementations§
impl<'a> Freeze for BrokerAuthRequest<'a>
impl<'a> !RefUnwindSafe for BrokerAuthRequest<'a>
impl<'a> Send for BrokerAuthRequest<'a>
impl<'a> Sync for BrokerAuthRequest<'a>
impl<'a> Unpin for BrokerAuthRequest<'a>
impl<'a> UnsafeUnpin for BrokerAuthRequest<'a>
impl<'a> !UnwindSafe for BrokerAuthRequest<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more