Skip to main content

ServerCommunicationConfigClient

Struct ServerCommunicationConfigClient 

Source
pub struct ServerCommunicationConfigClient<R, P>{
    repository: R,
    platform_api: P,
}
Expand description

Server communication configuration client

Fields§

§repository: R§platform_api: P

Implementations§

Source§

impl<R, P> ServerCommunicationConfigClient<R, P>

Source

pub fn new(repository: R, platform_api: P) -> Self

Creates a new server communication configuration client

§Arguments
  • repository - Cookie storage implementation (e.g a StateProvider hook)
  • platform_api - Cookie acquistion implementation
Source

pub async fn get_config( &self, hostname: String, ) -> Result<ServerCommunicationConfig, R::GetError>

Retrieves the server communication configuration for a hostname

Source

pub async fn needs_bootstrap(&self, hostname: String) -> bool

Determines if cookie bootstrapping is needed for this hostname

Source

pub async fn cookies(&self, hostname: String) -> Vec<(String, String)>

Returns cookies to include in HTTP requests

Returns the stored cookies as-is. For sharded cookies, each entry includes the full cookie name with its -{N} suffix (e.g., AWSELBAuthSessionCookie-0).

Source

pub async fn set_communication_type( &self, hostname: String, config: ServerCommunicationConfig, ) -> Result<(), R::SaveError>

Sets the server communication configuration for a hostname

This method saves the provided communication configuration to the repository. Typically called when receiving the /api/config response from the server.

§Arguments
  • hostname - The server hostname (e.g., “vault.acme.com”)
  • config - The server communication configuration to store
§Errors

Returns an error if the repository save operation fails

Acquires a cookie from the platform and saves it to the repository

This method calls the platform API to trigger cookie acquisition (e.g., browser redirect to IdP), then validates and stores the acquired cookie in the repository.

§Arguments
  • hostname - The server hostname (e.g., “vault.acme.com”)
§Errors

Returns an error if:

Auto Trait Implementations§

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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
§

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.

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<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