Skip to content

Commit 30e466f

Browse files
jchrostek-ddclaude
andcommitted
feat: add DD_ORG_UUID to datadog-agent-config crate
Adds the `DD_ORG_UUID` config field to the shared `datadog-agent-config` crate to support delegated AWS authentication. When set, consumers can use this field to auto-enable AWS credential-based auth instead of a static API key. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent bb2532a commit 30e466f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

crates/datadog-agent-config/env.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,11 @@ pub struct EnvConfig {
478478
/// The delay between two samples of the API Security schema collection, in seconds.
479479
#[serde(deserialize_with = "deserialize_optional_duration_from_seconds")]
480480
pub api_security_sample_delay: Option<Duration>,
481+
/// @env `DD_ORG_UUID`
482+
///
483+
/// The Datadog organization UUID. When set, delegated AWS auth is auto-enabled.
484+
#[serde(deserialize_with = "deserialize_optional_string")]
485+
pub org_uuid: Option<String>,
481486
}
482487

483488
#[allow(clippy::too_many_lines)]
@@ -680,6 +685,7 @@ fn merge_config(config: &mut Config, env_config: &EnvConfig) {
680685
merge_option_to_value!(config, env_config, appsec_waf_timeout);
681686
merge_option_to_value!(config, env_config, api_security_enabled);
682687
merge_option_to_value!(config, env_config, api_security_sample_delay);
688+
merge_string!(config, dd_org_uuid, env_config, org_uuid);
683689
}
684690

685691
#[derive(Debug, PartialEq, Clone, Copy)]
@@ -880,6 +886,7 @@ mod tests {
880886
"arn:aws:ssm:us-east-1:123:parameter/key",
881887
),
882888
("DD_APPSEC_RULES", "/opt/custom-rules.json"),
889+
("DD_ORG_UUID", "test-org-uuid"),
883890
];
884891

885892
// Programmatic guard: count `pub ` fields in the EnvConfig struct from
@@ -955,6 +962,7 @@ mod tests {
955962
Some("keep".to_string());
956963
expected.otlp_config_metrics_summaries_mode = Some("noquantiles".to_string());
957964
expected.appsec_rules = Some("/opt/custom-rules.json".to_string());
965+
expected.dd_org_uuid = "test-org-uuid".to_string();
958966

959967
assert_eq!(config, expected);
960968
Ok(())
@@ -1282,6 +1290,7 @@ mod tests {
12821290
appsec_waf_timeout: Duration::from_secs(1),
12831291
api_security_enabled: false,
12841292
api_security_sample_delay: Duration::from_secs(60),
1293+
dd_org_uuid: String::default(),
12851294
};
12861295

12871296
assert_eq!(config, expected_config);

crates/datadog-agent-config/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ pub struct Config {
368368
pub appsec_waf_timeout: Duration,
369369
pub api_security_enabled: bool,
370370
pub api_security_sample_delay: Duration,
371+
372+
pub dd_org_uuid: String,
371373
}
372374

373375
impl Default for Config {
@@ -483,6 +485,8 @@ impl Default for Config {
483485
appsec_waf_timeout: Duration::from_millis(5),
484486
api_security_enabled: true,
485487
api_security_sample_delay: Duration::from_secs(30),
488+
489+
dd_org_uuid: String::default(),
486490
}
487491
}
488492
}

0 commit comments

Comments
 (0)