get_auth_header

Function get_auth_header 

Source
pub async fn get_auth_header(
    config: &mut Config,
    anon_identity: bool,
    target_server: Option<&str>,
    interactive: bool,
) -> Result<AuthHeader>
Expand description

Gets the auth_header for a request to the server depending on how you want to identify yourself. If you specify anon_identity = true then no auth_header is returned. If you specify an identity this function will try to find the identity in the config file. If no identity can be found, the program will exit(1). If you do not specify an identity this function will either get the default identity if one exists or create and save a new default identity returning the one that was just created.

ยงArguments

  • config - The config file reference
  • anon_identity - Whether or not to just use an anonymous identity (no identity)
  • identity_or_name - The identity to try to lookup, which is typically provided from the command line