fixedTimeForLog returns the raw fixed_time_utc value (or " ") for a policy, suitable for inclusion in slog fields. slog escapes control characters in JSON/text output so log injection via this value is contained to the field itself.
(p *db.PatchPolicy)
| 133 | // characters in JSON/text output so log injection via this value is contained |
| 134 | // to the field itself. |
| 135 | func fixedTimeForLog(p *db.PatchPolicy) string { |
| 136 | if p == nil || p.FixedTimeUtc == nil { |
| 137 | return "<nil>" |
| 138 | } |
| 139 | return *p.FixedTimeUtc |
| 140 | } |
| 141 | |
| 142 | func isValidPackageName(s string) bool { |
| 143 | return len(s) > 0 && len(s) <= 256 && packageNameRegex.MatchString(s) |
no outgoing calls
no test coverage detected