pub struct Config {
pub api_url: Url,
pub client_id: ClientId,
pub tenant_id: String,
pub client_secret: Option<Secret>,
pub scope: Option<String>,
pub ignore_login_cache: bool,
}
Expand description
Freta client Config
Fields§
§api_url: Url
URL for the Freta API.
NOTE: For the public Freta service, this should always be https://freta.microsoft.com
client_id: ClientId
AAD app registration client id
tenant_id: String
Tenant of the AAD app registration for the client
client_secret: Option<Secret>
Client Secrt for custom app registrations to connect to Freta
scope: Option<String>
AAD App registration scope
ignore_login_cache: bool
Do not load or save cached login tokens
Implementations§
source§impl Config
impl Config
sourcepub async fn load() -> Result<Self>
pub async fn load() -> Result<Self>
Load the user’s current configuration from ~/.config/freta/cli.config
or use the default if that does not exist
Errors
This will return an error in the following cases:
- The path loading the configuration file cannot be determined
- Loading the configuration file fails
sourcepub async fn save(&self) -> Result<()>
pub async fn save(&self) -> Result<()>
Save the user’s configuration to ~/.config/freta/cli.config
At the moment, client configuration only includes login configuration information. Therefore, on any change, log the user out and log them back in.
Errors
This will return an error if the configuration file cannot be saved