MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / truncateResponse

Function truncateResponse

agent-source-code/internal/client/client.go:30–35  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

28// SECURITY: Error messages should not include full response bodies which may contain
29// sensitive information like tokens, internal paths, or system details
30func 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"
38func IsSkipSSLVerifyEnvSet() bool {

Callers 7

PingMethod · 0.85
SendUpdateMethod · 0.85
GetUpdateIntervalMethod · 0.85
SendDockerDataMethod · 0.85
GetIntegrationStatusMethod · 0.85
SendComplianceDataMethod · 0.85
SendPatchOutputMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected