Skip to main content

BrokerAuthRequest

Struct BrokerAuthRequest 

Source
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-674RefreshBrokerClientSig)+ auth_impl.cpp:3378-3480ParseBrokerAuthResponse):

  • 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more