/// Calls provision_from_auth_provider on the supplied account_manager using "dev_auth_provider",
/// mocks out the UI context, returning an error on any non-OK responses, or the account ID on
/// success. This requires the account manager to run the dev_auth_provider. See the
/// `account_manager` package for more information on how that is configured.
Calls provision_from_auth_provider on the supplied account_manager using "dev_auth_provider",
mocks out the UI context, returning an error on any non-OK responses, or the account ID on
success. This requires the account manager to run the dev_auth_provider. See the
`account_manager` package for more information on how that is configured.
Calls provision_from_auth_provider on the supplied account_manager using " dev_auth_provider " mocks out the UI context returning an error on any non - OK responses or the account ID on success . This requires the account manager to run the dev_auth_provider . See the ` account_manager ` package for more information on how that is configured .
async fn provision_account_from_dev_auth_provider(
    account_manager: &AccountManagerProxy,
) -> Result<LocalAccountId, Error> {
    let (acp_client_end, mut acp_request_stream) =
        create_request_stream::<AuthenticationContextProviderMarker>()
            .expect("failed opening channel");
    // This async function mocks out the auth context provider channel, although it supplies no data
    // for the test.
    let serve_fn = async move {
        let request = await!(acp_request_stream.try_next())
            .expect("AuthenticationContextProvider failed receiving message");
        match request {
            Some(AuthenticationContextProviderRequest::GetAuthenticationUiContext { .. }) => Ok(()),
            None => Err(format_err!("AuthenticationContextProvider channel closed unexpectedly")),
        }
    };
    let (serve_result, provision_result) = await!(join(
        serve_fn,
        account_manager.provision_from_auth_provider(acp_client_end, "dev_auth_provider"),
    ));
    serve_result?;
    match provision_result? {
        (Status::Ok, Some(new_account_id)) => Ok(*new_account_id),
        (status, _) => Err(format_err!("ProvisionFromAuthProvider returned status: {:?}", status)),
    }
}
async fn provision_account_from_dev_auth_provider ( account_manager : & AccountManagerProxy , ) -> Result < LocalAccountId , Error > { let ( acp_client_end , mut acp_request_stream ) = create_request_stream :: < AuthenticationContextProviderMarker > ( ) . expect ( " " ) ; // This async function mocks out the auth context provider channel, although it supplies no data // for the test. let serve_fn = async move { let request = await ! ( acp_request_stream try_next ( ) ) . expect ( " " ) ; match request { Some ( AuthenticationContextProviderRequest :: GetAuthenticationUiContext { .. } ) => Ok ( ( ) ) , None => Err ( format_err ! ( " " ) ) , } } ; let ( serve_result , provision_result ) = await ! ( join ( serve_fn account_manager provision_from_auth_provider ( acp_client_end " " ) ) ) ; serve_result ? ; match provision_result ? { ( Status :: Ok , Some ( new_account_id ) ) => Ok ( * new_account_id ) , ( status , _ ) => Err ( format_err ! ( " " status ) ) , } }
Calls provision_from_auth_provider on the supplied account_manager using "dev_auth_provider",
mocks out the UI context, returning an error on any non-OK responses, or the account ID on
success.
Calls provision_from_auth_provider on the supplied account_manager using " dev_auth_provider " mocks out the UI context returning an error on any non - OK responses or the account ID on success .
account_manager
&AccountManagerProxy