-
Notifications
You must be signed in to change notification settings - Fork 16
priority of decrypt: kms > arn > use dd_api_key #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,10 +13,7 @@ use tracing::debug; | |
| use tracing::error; | ||
|
|
||
| pub async fn resolve_secrets(config: Arc<Config>, aws_config: &AwsConfig) -> Option<String> { | ||
| if !config.api_key.is_empty() { | ||
| debug!("DD_API_KEY found, not trying to resolve secrets"); | ||
| Some(config.api_key.clone()) | ||
| } else if !config.api_key_secret_arn.is_empty() || !config.kms_api_key.is_empty() { | ||
| if !config.api_key_secret_arn.is_empty() || !config.kms_api_key.is_empty() { | ||
| let before_decrypt = Instant::now(); | ||
|
|
||
| let client = match Client::builder().use_rustls_tls().build() { | ||
|
|
@@ -27,10 +24,10 @@ pub async fn resolve_secrets(config: Arc<Config>, aws_config: &AwsConfig) -> Opt | |
| } | ||
| }; | ||
|
|
||
| let decrypted_key = if config.api_key_secret_arn.is_empty() { | ||
| decrypt_aws_kms(&client, config.kms_api_key.clone(), aws_config).await | ||
| let decrypted_key = if config.kms_api_key.is_empty() { | ||
| decrypt_aws_kms(&client, config.api_key_secret_arn.clone(), aws_config).await | ||
| } else { | ||
| decrypt_aws_sm(&client, config.api_key_secret_arn.clone(), aws_config).await | ||
| decrypt_aws_sm(&client, config.kms_api_key.clone(), aws_config).await | ||
alexgallotta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| debug!("Decrypt took {}ms", before_decrypt.elapsed().as_millis()); | ||
|
|
@@ -43,7 +40,7 @@ pub async fn resolve_secrets(config: Arc<Config>, aws_config: &AwsConfig) -> Opt | |
| } | ||
| } | ||
| } else { | ||
| return None; | ||
| Some(config.api_key.clone()) | ||
|
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.