truncateResponse truncates a response string to prevent leaking sensitive data in logs SECURITY: Error messages should not include full response bodies which may contain sensitive information like tokens, internal paths, or system details
(s string, maxLen int)
| 28 | // SECURITY: Error messages should not include full response bodies which may contain |
| 29 | // sensitive information like tokens, internal paths, or system details |
| 30 | func truncateResponse(s string, maxLen int) string { |
| 31 | if len(s) <= maxLen { |
| 32 | return s |
| 33 | } |
| 34 | return s[:maxLen] + "... (truncated)" |
| 35 | } |
| 36 | |
| 37 | // IsSkipSSLVerifyEnvSet returns true if PATCHMON_SKIP_SSL_VERIFY is set to "true" or "1" |
| 38 | func IsSkipSSLVerifyEnvSet() bool { |
no outgoing calls
no test coverage detected