MCPcopy
hub / github.com/PeerDB-io/peerdb / sensitiveJSONFields

Function sensitiveJSONFields

flow/alerting/secrets.go:17–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17func sensitiveJSONFields[T any]() []string {
18 var fields []string
19 for field := range reflect.TypeFor[T]().Fields() {
20 if field.Tag.Get("sensitive") == "true" {
21 name, _, _ := strings.Cut(field.Tag.Get("json"), ",")
22 fields = append(fields, name)
23 }
24 }
25 return fields
26}
27
28// RedactSecrets replaces every sensitive field with an empty JSON string so
29// secrets are never returned to API clients.

Callers

nothing calls this directly

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected