Skip to content
This repository was archived by the owner on Oct 10, 2023. It is now read-only.

Ensure distinct_id can't get leaked on accident#119

Merged
cole-h merged 1 commit intomainfrom
cole/ds-273-fsm-encode-the-obscured-telemetry
Sep 8, 2022
Merged

Ensure distinct_id can't get leaked on accident#119
cole-h merged 1 commit intomainfrom
cole/ds-273-fsm-encode-the-obscured-telemetry

Conversation

@cole-h
Copy link
Copy Markdown
Member

@cole-h cole-h commented Sep 7, 2022

We do this by using the secrecy crate to ensure the fmt::Debug representation of the Telemetry struct redacts the distinct_id field.


Because Uuid is a foreign type, I had to make a newtype around it in order to implement the marker traits that allows secrecy::Secret to do its job.

We do this by using the secrecy crate to ensure the `fmt::Debug`
representation of the Telemetry struct redacts the distinct_id field.
@cole-h cole-h requested a review from Hoverbear September 7, 2022 18:30
@grahamc
Copy link
Copy Markdown
Member

grahamc commented Sep 8, 2022

Looking good:

2022-09-08T12:30:08.850696Z TRACE riff::telemetry: Sending telemetry data to https://registry.riff.determinate.systems/telemetry, data: Telemetry { distinct_id: Some(Secret([REDACTED riff::telemetry::DistinctId])), system_os: "linux", system_arch: "x86_64", os_release_name: Some("NixOS"), os_release_version_id: Some("22.11"), riff_version: "1.0.0", nix_version: Some("nix (Nix) 2.10.3"), is_tty: true, subcommand: None, detected_languages: {}, in_ci: false }

@grahamc
Copy link
Copy Markdown
Member

grahamc commented Sep 8, 2022

Note I also verified that the telemetry events still contain the distinct ID as expected. Nicely done!

@cole-h cole-h merged commit e43165a into main Sep 8, 2022
@cole-h cole-h deleted the cole/ds-273-fsm-encode-the-obscured-telemetry branch September 8, 2022 15:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants