Skip to content

Commit

Permalink
Rename hide_ips to hide_user_data
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszklak committed Oct 18, 2024
1 parent 81a0059 commit 28ef3a7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
19 changes: 11 additions & 8 deletions crates/telio-model/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ pub struct Features {
/// Test environment (natlab) requires binding feature disabled
/// TODO: Remove it once mac integration tests support the binding mechanism
pub is_test_env: Option<bool>,
/// Controll if IP addresses should be hidden in logs
/// Controll if IP addresses and domains should be hidden in logs
#[serde(alias = "hide_ips")] // Old name
#[default(true)]
pub hide_ips: bool,
pub hide_user_data: bool,
/// Derp server specific configuration
pub derp: Option<FeatureDerp>,
/// Flag to specify if keys should be validated
Expand Down Expand Up @@ -500,7 +501,7 @@ mod tests {
}
},
"is_test_env": true,
"hide_ips": false,
"hide_user_data": false,
"derp": {
"tcp_keepalive": 13,
"derp_keepalive": 14,
Expand Down Expand Up @@ -583,7 +584,7 @@ mod tests {
),
}),
is_test_env: Some(true),
hide_ips: false,
hide_user_data: false,
derp: Some(FeatureDerp {
tcp_keepalive: Some(13),
derp_keepalive: Some(14),
Expand Down Expand Up @@ -772,10 +773,12 @@ mod tests {
}

#[test]
fn test_hide_ips() {
assert_json!(r#"{}"#, true, hide_ips);
assert_json!(r#"{"hide_ips": false}"#, false, hide_ips);
assert_json!(r#"{"hide_ips": true}"#, true, hide_ips);
fn test_hide_user_data() {
assert_json!(r#"{}"#, true, hide_user_data);
assert_json!(r#"{"hide_ips": false}"#, false, hide_user_data);
assert_json!(r#"{"hide_ips": true}"#, true, hide_user_data);
assert_json!(r#"{"hide_user_data": false}"#, false, hide_user_data);
assert_json!(r#"{"hide_user_data": true}"#, true, hide_user_data);
}
}

Expand Down
2 changes: 1 addition & 1 deletion nat-lab/tests/utils/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def default_features(

features = features_builder.build()
features.is_test_env = True
features.hide_ips = False
features.hide_user_data = False
features.dns.exit_dns = FeatureExitDns(auto_switch_dns_ips=True)
return features

Expand Down
2 changes: 1 addition & 1 deletion src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ impl Device {
event_cb: F,
protect: Option<Arc<dyn Protector>>,
) -> Result<Self> {
LOG_CENSOR.set_enabled(features.hide_ips);
LOG_CENSOR.set_enabled(features.hide_user_data);

let version_tag = version_tag();
let commit_sha = commit_sha();
Expand Down
2 changes: 1 addition & 1 deletion src/device/wg_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,7 +1599,7 @@ mod tests {
} else {
None
},
hide_ips: false,
hide_user_data: false,
derp: None,
validate_keys: Default::default(),
ipv6: true,
Expand Down
2 changes: 1 addition & 1 deletion src/ffi/defaults_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl FeaturesDefaultsBuilder {
paths: None,
direct: None,
is_test_env: None,
hide_ips: true,
hide_user_data: true,
// All inner values of derp are None's or false's
// and as it does not actualy control derp
// builder part is not added
Expand Down
4 changes: 2 additions & 2 deletions src/libtelio.udl
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ dictionary Features {
FeatureDirect? direct;
/// Should only be set for macos sideload
boolean? is_test_env;
/// Controll if IP addresses should be hidden in logs
boolean hide_ips;
/// Controll if IP addresses and domains should be hidden in logs
boolean hide_user_data;
/// Derp server specific configuration
FeatureDerp? derp;
/// Flag to specify if keys should be validated
Expand Down

0 comments on commit 28ef3a7

Please sign in to comment.