From a7651bc511ee16a3579856c381ff7a290c19069a Mon Sep 17 00:00:00 2001 From: favonia Date: Mon, 1 Jul 2024 07:25:44 -0500 Subject: [PATCH] feat(pp): WIP: log redaction --- internal/pp/level.go | 6 +++--- internal/pp/redaction.go | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 internal/pp/redaction.go diff --git a/internal/pp/level.go b/internal/pp/level.go index c9baa6d5..94714b30 100644 --- a/internal/pp/level.go +++ b/internal/pp/level.go @@ -9,7 +9,7 @@ const ( Notice // an action (e.g., changing the IP) has happened and it is not an error Warning // non-fatal errors where the updater should continue updating IP addresses Error // fatal errors where the updater should stop - DefaultLevel = Info - Verbose = Info - Quiet = Notice + DefaultLevel Level = Info + Verbose Level = Info + Quiet Level = Notice ) diff --git a/internal/pp/redaction.go b/internal/pp/redaction.go new file mode 100644 index 00000000..13c58633 --- /dev/null +++ b/internal/pp/redaction.go @@ -0,0 +1,19 @@ +package pp + +type RedactionLevel int + +const ( + RedactNone RedactionLevel = iota + // This level reveals everything. + + RedactToken + // This level conceals tokens or token-like information. + + RedactPrivate + // This level conceals information that cannot be easily + // owned by other people at the same time, including + // token-like information, domain names, IP addresses, + // zone IDs, and record IDs. + + RedactDefault RedactionLevel = RedactToken +)