Fix harness config sync against local Hub storage#122
Fix harness config sync against local Hub storage#122ptone merged 6 commits intoGoogleCloudPlatform:mainfrom
Conversation
5b50616 to
620da00
Compare
|
Cleaned up the retry/error-classification path. Changes:
Current head: |
PR #122 Review: Fix harness config sync against local Hub storageExecutive SummaryThis PR adds a fallback mechanism so that when the Hub returns Critical Issues1. Missing
|
|
As a heads up - have a planned major refactor of the harness/config system coming up in https://github.com/GoogleCloudPlatform/scion/blob/main/.design/decoupled-harness-implementation.md |
131f629 to
49332f6
Compare
|
Addressed the upload-size review point on this branch. Changes:
Validation:
Current head: |
Add validateWorkspaceFilePath() checks to all harness config file handlers (read, write, upload, delete) to prevent path traversal attacks via crafted file paths. The multipart upload handler was particularly vulnerable since form field names bypass HTTP router path cleaning. Also add http.MaxBytesReader to handleHarnessConfigFileWrite to limit body size on the JSON content-type path, and replace an unnecessary []byte->string->Reader conversion with bytes.NewReader in the upload handler.
Summary
file://pathsValidation
go test ./pkg/hubclient -run ^ -count=1go test ./pkg/hub -run ^ -count=1go test ./cmd -run ^TestPullHarnessConfigFromHub_FallsBackToHubFileAPIForLocalStorageURLs -count=1go test ./cmd -run ^TestSyncHarnessConfigToHub_FallsBackToHubFileAPIForLocalStorageURLs -count=1scion --hub https://scion.carverauto.dev --global harness-config pull codex --to ...failed by trying to open/home/scion/.scion/storage/...locally