mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-29 21:31:48 +02:00
refactor(config): update config structures to use strutils.Redacted for sensitive fields
- Modified Config structs in various packages to replace string fields with strutils.Redacted to prevent logging sensitive information. - Updated serialization methods to accommodate new data types. - Adjusted API token handling in Proxmox configuration.
This commit is contained in:
@@ -21,6 +21,22 @@ import (
|
||||
|
||||
type SerializedObject = map[string]any
|
||||
|
||||
// ToSerializedObject converts a map[string]VT to a SerializedObject.
|
||||
func ToSerializedObject[VT any](m map[string]VT) SerializedObject {
|
||||
so := make(SerializedObject, len(m))
|
||||
for k, v := range m {
|
||||
so[k] = v
|
||||
}
|
||||
return so
|
||||
}
|
||||
|
||||
func init() {
|
||||
strutils.SetJSONMarshaler(sonic.Marshal)
|
||||
strutils.SetJSONUnmarshaler(sonic.Unmarshal)
|
||||
strutils.SetYAMLMarshaler(yaml.Marshal)
|
||||
strutils.SetYAMLUnmarshaler(yaml.Unmarshal)
|
||||
}
|
||||
|
||||
type MapUnmarshaller interface {
|
||||
UnmarshalMap(m map[string]any) gperr.Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user