Skip to main content

Module login

Module login 

Source

Re-exportsยง

use crate::cli::client::TokenResponseBody; ๐Ÿ”’
use crate::cli::client::fetch_discovery_document; ๐Ÿ”’
use crate::cli::client::unix_now; ๐Ÿ”’
use crate::cli::config::ProfileAuth; ๐Ÿ”’
use crate::cli::secrets::StoredTokens; ๐Ÿ”’
use crate::cli::state::CliState; ๐Ÿ”’
use crate::cli::state::SECRETS_LOCATION; ๐Ÿ”’
use base64::Engine as _; ๐Ÿ”’
use base64::engine::general_purpose::URL_SAFE_NO_PAD; ๐Ÿ”’
use haste_fhir_model::r4::generated::terminology::IssueType; ๐Ÿ”’
use haste_fhir_operation_error::OperationOutcomeError; ๐Ÿ”’
use sha2::Digest; ๐Ÿ”’
use sha2::Sha256; ๐Ÿ”’
use std::io::BufRead; ๐Ÿ”’
use std::io::BufReader; ๐Ÿ”’
use std::io::Write; ๐Ÿ”’
use std::net::TcpListener; ๐Ÿ”’
use std::sync::Arc; ๐Ÿ”’
use tokio::sync::Mutex; ๐Ÿ”’

Functionsยง

bind_callback_listener ๐Ÿ”’
code_challenge_s256 ๐Ÿ”’
open_in_browser ๐Ÿ”’
parse_redirect_port ๐Ÿ”’
random_url_safe_string ๐Ÿ”’
run ๐Ÿ”’
Runs the login command: the browser-based authorization_code + PKCE login flow for the active profile, caching the resulting tokens in the secrets file. With no_browser, prints the authorization URL instead of opening it.
wait_for_callback ๐Ÿ”’
Blocks waiting for the browser to redirect back with ?code=&state=, on a single connection to the loopback listener. Returns (code, state).