fix(webui): mark cookies Secure behind a TLS proxy; run gosec in the gate (#1919)
Cookies took Secure from r.TLS, which is nil behind a proxy that terminates TLS, so sign-in cookies went out without it. Every dashboard cookie now goes through one builder that reads the scheme the way the origin check does. The worktree reset and the agent worker's chown walk use os.Root, so a symlink swapped in mid-walk can't point them outside the worktree. gosec runs in golangci-lint, tests included. G104, G115, G204 and G304 are excluded in config; each remaining finding is fixed or suppressed at the site with its reason.
This commit is contained in:
46 files changed
+199
-115
No files matched your search
@@ -54,7 +54,7 @@ func prefetchPRReview(ctx context.Context, f any, owner, repo string, number int
|
||||
if err != nil {
|
||||
return fmt.Errorf("prefetch pr-review: %w", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(base, "diff.patch"), []byte(diff), 0o644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(base, "diff.patch"), []byte(diff), 0o644); err != nil { //nolint:gosec // G306: the task container reads the diff as another user.
|
||||
return fmt.Errorf("prefetch pr-review: write diff: %w", err)
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ func prefetchPRReview(ctx context.Context, f any, owner, repo string, number int
|
||||
if err != nil {
|
||||
return fmt.Errorf("prefetch pr-review: encode metadata: %w", err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(base, "metadata.json"), metaJSON, 0o644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(base, "metadata.json"), metaJSON, 0o644); err != nil { //nolint:gosec // G306: the task container reads the metadata as another user.
|
||||
return fmt.Errorf("prefetch pr-review: write metadata: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user