Add API endpoint to retrieve sanitized server configuration

This commit is contained in:
2025-11-14 18:57:03 +01:00
parent 91d8a9008f
commit 623e258a2a
6 changed files with 779 additions and 1 deletions

View File

@@ -610,3 +610,20 @@ func getDefaultConfigLocations() []string {
return locations
}
// SanitizedCopy returns a copy of the AppConfig with sensitive information removed
func (cfg *AppConfig) SanitizedCopy() AppConfig {
// Create a copy of the config
sanitized := *cfg
// Clear sensitive information
sanitized.Auth.InferenceKeys = []string{}
sanitized.Auth.ManagementKeys = []string{}
for nodeName, node := range sanitized.Nodes {
node.APIKey = ""
sanitized.Nodes[nodeName] = node
}
return sanitized
}