pub struct AisClient { /* private fields */ }Expand description
AIS HTTP client
Encapsulates the logic for sending protobuf requests to the AIS /register endpoint.
All requests use application/x-protobuf encoding.
Implementations§
Source§impl AisClient
impl AisClient
Sourcepub fn new(endpoint: impl Into<String>) -> Self
pub fn new(endpoint: impl Into<String>) -> Self
Create a new AIS client
endpoint is the AIS base URL, e.g. "http://ais.example.com:8080".
Sourcepub fn with_realm_secret(self, secret: impl Into<String>) -> Self
pub fn with_realm_secret(self, secret: impl Into<String>) -> Self
Set the realm secret for authentication
Sourcepub async fn register_with_manifest(
&self,
req: RegisterRequest,
) -> Result<RegisterResponse, HyperError>
pub async fn register_with_manifest( &self, req: RegisterRequest, ) -> Result<RegisterResponse, HyperError>
Initial registration: authenticate with MFR manifest
Sends a RegisterRequest (containing manifest_raw + mfr_signature), receives a RegisterResponse. On initial registration, AIS returns a PSK in the response for subsequent renewals.
Sourcepub async fn register_with_psk(
&self,
req: RegisterRequest,
) -> Result<RegisterResponse, HyperError>
pub async fn register_with_psk( &self, req: RegisterRequest, ) -> Result<RegisterResponse, HyperError>
Renewal registration: authenticate with PSK
Sends a RegisterRequest (containing psk_token), receives a RegisterResponse with a new credential.
Sourcepub async fn register_linked(
&self,
req: RegisterRequest,
) -> Result<RegisterResponse, HyperError>
pub async fn register_linked( &self, req: RegisterRequest, ) -> Result<RegisterResponse, HyperError>
Linked registration: authenticate with realm authorization.
Sends a RegisterRequest marked as linked source mode. AIS authorizes it using the realm secret header instead of MFR package identity.
Auto Trait Implementations§
impl !RefUnwindSafe for AisClient
impl !UnwindSafe for AisClient
impl Freeze for AisClient
impl Send for AisClient
impl Sync for AisClient
impl Unpin for AisClient
impl UnsafeUnpin for AisClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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> ⓘ
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> ⓘ
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