Function password_file_environment_variable

Source
pub fn password_file_environment_variable(
    platform: &DshPlatform,
    tenant_name: &str,
) -> String
Expand description

§Create client password file environment variable

This function creates the environment variable used to define the client tenant’s password file from the platform name and the tenant name. The format of the environment variable is DSH_API_PASSWORD_FILE_[platform_name]_[tenant_name], where the platform_name and the tenant_name will be converted to uppercase and - will be replaced by _.

§Parameters

  • platform - target platform
  • tenant_name - client tenant name

§Returns

Client password file environment variable.

§Example

use dsh_api::password_file_environment_variable;
use dsh_api::platform::DshPlatform;

let env_var =
  password_file_environment_variable(&DshPlatform::try_from("np-aws-lz-dsh")?, "my-tenant");
assert_eq!(env_var, "DSH_API_PASSWORD_FILE_NP_AWS_LZ_DSH_MY_TENANT".to_string());