Skip to content

Commit d4d6fd8

Browse files
committed
fix(agent-config): use deserialize_optional_string for org_uuid
A UUID is hex + dashes; there is no legitimate numeric form a user would supply. The previous deserializer (deserialize_string_or_int) was a carry-over from the bottlecap copy, where it appears to have been copy-pasted from the env/service/version pattern. Tightening to deserialize_optional_string fail-fasts on misconfiguration instead of silently coercing.
1 parent 1d35f6c commit d4d6fd8

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

crates/datadog-agent-config/src/sources/env.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ pub struct EnvConfig {
3838
/// @env `DD_ORG_UUID`
3939
///
4040
/// The Datadog organization UUID. When set, enables delegated auth so the
41-
/// agent can submit telemetry without a long-lived API key. Accepts a
42-
/// string or numeric form for backwards compatibility.
43-
#[serde(deserialize_with = "deserialize_string_or_int")]
41+
/// agent can submit telemetry without a long-lived API key.
42+
#[serde(deserialize_with = "deserialize_optional_string")]
4443
pub org_uuid: Option<String>,
4544
/// @env `DD_LOG_LEVEL`
4645
///

crates/datadog-agent-config/src/sources/yaml.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ pub struct YamlConfig {
3131
pub api_key: Option<String>,
3232
/// YAML key: `org_uuid`. Datadog organization UUID. When set, enables
3333
/// delegated auth so the agent can submit telemetry without a long-lived
34-
/// API key. Accepts a string or numeric form for backwards compatibility.
35-
/// Merges into the resolved config field `dd_org_uuid`.
36-
#[serde(deserialize_with = "deserialize_string_or_int")]
34+
/// API key. Merges into the resolved config field `dd_org_uuid`.
35+
#[serde(deserialize_with = "deserialize_optional_string")]
3736
pub org_uuid: Option<String>,
3837
#[serde(deserialize_with = "deserialize_with_default")]
3938
pub log_level: Option<LogLevel>,

0 commit comments

Comments
 (0)