pub struct BrokerAuthRequest<'a> {
pub http: &'a Client,
pub protocol_identity: BackendProtocolIdentity,
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,
失败兜底 AES-128),不是 Platform client_key 用的 rand_key。
具体 response/error/decrypt 逻辑由 sibling broker::response adapter 持有。
Fields§
§http: &'a Client§protocol_identity: BackendProtocolIdentity§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> !RefUnwindSafe for BrokerAuthRequest<'a>
impl<'a> !UnwindSafe for BrokerAuthRequest<'a>
impl<'a> Freeze 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>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more