executeDownloadPayload downloads a previously generated payload
(ctx context.Context, client *csclient.Client, action Action)
| 202 | |
| 203 | // executeDownloadPayload downloads a previously generated payload |
| 204 | func (e *Executor) executeDownloadPayload(ctx context.Context, client *csclient.Client, action Action) (string, error) { |
| 205 | fileName, ok := action.Parameters["file_name"].(string) |
| 206 | if !ok { |
| 207 | return "", fmt.Errorf("file_name parameter required for download_payload") |
| 208 | } |
| 209 | |
| 210 | e.logInfo("Downloading payload: %s", fileName) |
| 211 | _, err := client.DownloadPayload(ctx, fileName) |
| 212 | if err != nil { |
| 213 | return "", fmt.Errorf("download payload failed: %w", err) |
| 214 | } |
| 215 | // Note: actual binary data handling would need a file write destination |
| 216 | return fmt.Sprintf("payload '%s' downloaded", fileName), nil |
| 217 | } |
| 218 | |
| 219 | // --- Server Config Operations --- |
| 220 |