diff --git a/src/go.mod b/src/go.mod index fa4e729e3..9b03cf95b 100644 --- a/src/go.mod +++ b/src/go.mod @@ -6,7 +6,7 @@ replace github.com/kopia/kopia => github.com/alcionai/kopia v0.12.2-0.2023071323 require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 - github.com/alcionai/clues v0.0.0-20230630194723-e24d7940e07a + github.com/alcionai/clues v0.0.0-20230728164842-7dc4795a43e4 github.com/armon/go-metrics v0.4.1 github.com/aws/aws-sdk-go v1.44.311 github.com/aws/aws-xray-sdk-go v1.8.1 diff --git a/src/go.sum b/src/go.sum index 1a2e8345b..74f71dadf 100644 --- a/src/go.sum +++ b/src/go.sum @@ -53,8 +53,8 @@ github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1o github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= -github.com/alcionai/clues v0.0.0-20230630194723-e24d7940e07a h1:mtJyeK/FhArTn06M5Lfgxk/GWnu8yqCGNN1BY16vjaA= -github.com/alcionai/clues v0.0.0-20230630194723-e24d7940e07a/go.mod h1:MLEWSZ0cjEMg6hiGCRvE7AtrOhs7deBcm7ZrJBpfGRM= +github.com/alcionai/clues v0.0.0-20230728164842-7dc4795a43e4 h1:husF7eAYw2HEzgjfAmNy+ZLzyztJV2SyoUngSUo829Y= +github.com/alcionai/clues v0.0.0-20230728164842-7dc4795a43e4/go.mod h1:MLEWSZ0cjEMg6hiGCRvE7AtrOhs7deBcm7ZrJBpfGRM= github.com/alcionai/kopia v0.12.2-0.20230713235606-4c85869e9377 h1:w50/aVU+zRP5lvE86TSSCCYrrEyuXOlJA06R5RdTS8Y= github.com/alcionai/kopia v0.12.2-0.20230713235606-4c85869e9377/go.mod h1:WH725ws0BYpZpTkVh4uqFHHPiiJuirl1Cm73jv5RYyA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/src/internal/common/pii/url.go b/src/internal/common/pii/url.go index 339bee19f..de6e5ed8a 100644 --- a/src/internal/common/pii/url.go +++ b/src/internal/common/pii/url.go @@ -78,6 +78,10 @@ func (u SafeURL) Format(fs fmt.State, _ rune) { fmt.Fprint(fs, u.Conceal()) } +func (u SafeURL) PlainString() string { + return u.URL +} + // String complies with Stringer to ensure the Conceal() version // of the url is printed anytime it gets transformed to a string. func (u SafeURL) String() string { diff --git a/src/internal/observe/observe.go b/src/internal/observe/observe.go index c05297587..50994eacb 100644 --- a/src/internal/observe/observe.go +++ b/src/internal/observe/observe.go @@ -563,8 +563,8 @@ func (b bulletf) String() string { // observe progress bar. Logged values should only use // the fmt %v to ensure Concealers hide PII. func plainString(v any) string { - if ps, ok := v.(clues.PlainStringer); ok { - return ps.PlainString() + if c, ok := v.(clues.Concealer); ok { + return c.PlainString() } return fmt.Sprintf("%v", v) diff --git a/src/pkg/control/restore.go b/src/pkg/control/restore.go index 74cf88093..cce3bea9b 100644 --- a/src/pkg/control/restore.go +++ b/src/pkg/control/restore.go @@ -107,10 +107,6 @@ var ( // interface compliance required for handling PII _ clues.Concealer = &RestoreConfig{} _ fmt.Stringer = &RestoreConfig{} - - // interface compliance for the observe package to display - // values without concealing PII. - _ clues.PlainStringer = &RestoreConfig{} ) func (rc RestoreConfig) marshal() string { diff --git a/src/pkg/filters/filters.go b/src/pkg/filters/filters.go index 40c12a630..c697203b7 100644 --- a/src/pkg/filters/filters.go +++ b/src/pkg/filters/filters.go @@ -501,7 +501,7 @@ func suffixed(target, input string) bool { // Printers and PII control // ---------------------------------------------------------------------------------------------------- -var _ clues.PlainConcealer = &Filter{} +var _ clues.Concealer = &Filter{} var safeFilterValues = map[string]struct{}{"*": {}} diff --git a/src/pkg/path/elements.go b/src/pkg/path/elements.go index d1ca932dc..5a0802d50 100644 --- a/src/pkg/path/elements.go +++ b/src/pkg/path/elements.go @@ -54,10 +54,6 @@ var ( // interface compliance required for handling PII _ clues.Concealer = &Elements{} _ fmt.Stringer = &Elements{} - - // interface compliance for the observe package to display - // values without concealing PII. - _ clues.PlainStringer = &Elements{} ) // Elements are a PII Concealer-compliant slice of elements within a path. diff --git a/src/pkg/path/path.go b/src/pkg/path/path.go index ca63bf8fe..b7cd38da0 100644 --- a/src/pkg/path/path.go +++ b/src/pkg/path/path.go @@ -120,10 +120,6 @@ type Path interface { // is appropriately hidden from logging, errors, and other outputs. clues.Concealer fmt.Stringer - - // In the rare case that the path needs to get printed as a plain string, - // without obscuring values for PII. - clues.PlainStringer } // interface compliance required for handling PII diff --git a/src/pkg/selectors/scopes.go b/src/pkg/selectors/scopes.go index 2a860892b..aebd0f156 100644 --- a/src/pkg/selectors/scopes.go +++ b/src/pkg/selectors/scopes.go @@ -153,9 +153,6 @@ type ( // Primarily to ensure that root- or mid-tier scopes (such as folders) // cascade 'Any' matching to more granular categories. setDefaults() - - // Scopes need to comply with PII printing controls. - clues.PlainConcealer } // scopeT is the generic type interface of a scoper. scopeT interface { diff --git a/src/pkg/selectors/selectors.go b/src/pkg/selectors/selectors.go index 1e148e04b..936bc3a32 100644 --- a/src/pkg/selectors/selectors.go +++ b/src/pkg/selectors/selectors.go @@ -341,7 +341,7 @@ func selectorAsIface[T any](s Selector) (T, error) { // Stringers and Concealers // --------------------------------------------------------------------------- -var _ clues.PlainConcealer = &Selector{} +var _ clues.Concealer = &Selector{} type loggableSelector struct { Service service `json:"service,omitempty"`