Skip to main content

Module client

Module client 

Source
Expand description

Builds the authenticated FHIR HTTP client used by commands that talk to a server (api, testscript, hl7v2), based on the active profile’s auth mode.

Re-exportsΒ§

use crate::cli::config::DEFAULT_CLIENT_CREDENTIALS_SCOPE; πŸ”’
use crate::cli::config::ProfileAuth; πŸ”’
use crate::cli::secrets::StoredTokens; πŸ”’
use crate::cli::state::CliState; πŸ”’
use crate::cli::state::SECRETS_LOCATION; πŸ”’
use haste_fhir_client::http::BasicCredentials; πŸ”’
use haste_fhir_client::http::FHIRHttpAuthenticationMethod; πŸ”’
use haste_fhir_client::http::FHIRHttpClient; πŸ”’
use haste_fhir_client::http::FHIRHttpState; πŸ”’
use haste_fhir_client::http::HttpRequestHeaders; πŸ”’
use haste_fhir_model::r4::generated::terminology::IssueType; πŸ”’
use haste_fhir_operation_error::OperationOutcomeError; πŸ”’
use haste_server::auth_n::oidc::routes::discovery::WellKnownDiscoveryDocument; πŸ”’
use serde::Deserialize; πŸ”’
use serde::Deserialize; πŸ”’
use std::sync::Arc; πŸ”’
use std::time::SystemTime; πŸ”’
use std::time::UNIX_EPOCH; πŸ”’
use tokio::sync::Mutex; πŸ”’

StructsΒ§

TokenResponseBody πŸ”’

ConstantsΒ§

TOKEN_EXPIRY_MARGIN_SECS πŸ”’
How long before expiry a cached token stops being handed out.

FunctionsΒ§

cached_access_token πŸ”’
The cached access token, if it is still good.
config_to_fhir_http_state πŸ”’
fetch_discovery_document πŸ”’
Fetches (and caches on CliState) the OIDC discovery document for the active profile.
fhir_client πŸ”’
refresh_access_token πŸ”’
Exchanges a refresh token for a new access token, persisting the refreshed tokens to disk.
unix_now πŸ”’