pub struct ServerCommunicationConfigClient<R, P>{
repository: R,
platform_api: P,
}Expand description
Server communication configuration client
Fields§
§repository: R§platform_api: PImplementations§
Source§impl<R, P> ServerCommunicationConfigClient<R, P>
impl<R, P> ServerCommunicationConfigClient<R, P>
Sourcepub fn new(repository: R, platform_api: P) -> Self
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
Sourcepub async fn get_config(
&self,
hostname: String,
) -> Result<ServerCommunicationConfig, R::GetError>
pub async fn get_config( &self, hostname: String, ) -> Result<ServerCommunicationConfig, R::GetError>
Retrieves the server communication configuration for a hostname
Sourcepub async fn needs_bootstrap(&self, hostname: String) -> bool
pub async fn needs_bootstrap(&self, hostname: String) -> bool
Determines if cookie bootstrapping is needed for this hostname
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).
Sourcepub async fn set_communication_type(
&self,
hostname: String,
config: ServerCommunicationConfig,
) -> Result<(), R::SaveError>
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:
- Cookie acquisition was cancelled by the user (
AcquireCookieError::Cancelled) - Server configuration doesn’t support SSO cookies
(
AcquireCookieError::UnsupportedConfiguration) - Acquired cookie name doesn’t match expected name
(
AcquireCookieError::CookieNameMismatch) - Repository operations fail (
AcquireCookieError::RepositoryGetErrororAcquireCookieError::RepositorySaveError)
Auto Trait Implementations§
impl<R, P> Freeze for ServerCommunicationConfigClient<R, P>
impl<R, P> RefUnwindSafe for ServerCommunicationConfigClient<R, P>where
R: RefUnwindSafe,
P: RefUnwindSafe,
impl<R, P> Send for ServerCommunicationConfigClient<R, P>
impl<R, P> Sync for ServerCommunicationConfigClient<R, P>
impl<R, P> Unpin for ServerCommunicationConfigClient<R, P>
impl<R, P> UnsafeUnpin for ServerCommunicationConfigClient<R, P>where
R: UnsafeUnpin,
P: UnsafeUnpin,
impl<R, P> UnwindSafe for ServerCommunicationConfigClient<R, P>where
R: UnwindSafe,
P: UnwindSafe,
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more