| 5287 | } |
| 5288 | |
| 5289 | pub async fn provider_refresh_config( |
| 5290 | server: &str, |
| 5291 | input: ProviderRefreshConfigInput<'_>, |
| 5292 | tls: &TlsOptions, |
| 5293 | ) -> Result<()> { |
| 5294 | let strategy = provider_refresh_strategy(input.strategy)?; |
| 5295 | let material = parse_key_value_pairs(input.material, "--material")?; |
| 5296 | let mut client = grpc_client(server, tls).await?; |
| 5297 | let status = client |
| 5298 | .configure_provider_refresh(ConfigureProviderRefreshRequest { |
| 5299 | provider: input.name.to_string(), |
| 5300 | credential_key: input.credential_key.to_string(), |
| 5301 | strategy: strategy as i32, |
| 5302 | material, |
| 5303 | secret_material_keys: input.secret_material_keys.to_vec(), |
| 5304 | expires_at_ms: input.credential_expires_at_ms, |
| 5305 | }) |
| 5306 | .await |
| 5307 | .into_diagnostic()? |
| 5308 | .into_inner() |
| 5309 | .status |
| 5310 | .ok_or_else(|| miette!("provider refresh status missing from response"))?; |
| 5311 | |
| 5312 | println!( |
| 5313 | "{} Configured refresh for {} {}", |
| 5314 | "✓".green().bold(), |
| 5315 | status.provider_name, |
| 5316 | status.credential_key |
| 5317 | ); |
| 5318 | Ok(()) |
| 5319 | } |
| 5320 | |
| 5321 | pub async fn provider_rotate( |
| 5322 | server: &str, |