Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
73b1e2a
[COMPLIANCE] Add Copyright and License Headers
hashicorp-copywrite[bot] Aug 19, 2024
768e85f
Clean up git repo on disk when the ref checkout fails
james-warren0 Oct 9, 2024
b19f8af
Merge pull request #504 from hashicorp/james-warren0/git-bad-ref-clea…
james-warren0 Nov 6, 2024
6077ad5
Merge pull request #409 from hashicorp/compliance/add-headers
james-warren0 Nov 7, 2024
7edd4e0
Add CODEOWNERS file in .github/CODEOWNERS
mukeshjc Nov 18, 2024
842d6c3
Merge pull request #505 from mukeshjc/main
mukeshjc Nov 18, 2024
2e56c18
IND-1804 Bump up dependencies to remediate vulnerabiities
mohanmanikanta2299 Jan 9, 2025
6552f72
Merge pull request #513 from hashicorp/Vulnerability_Fix_v1
mohanmanikanta2299 Jan 9, 2025
d315d97
IND-1804 Updating arguments in github release CI
mohanmanikanta2299 Jan 9, 2025
81c6950
Merge pull request #514 from hashicorp/Vulnerability_Fix_v1
mohanmanikanta2299 Jan 9, 2025
0f05341
IND-1804 Updating .goreleaser.yml file with valid version
mohanmanikanta2299 Jan 9, 2025
7dddd13
Merge pull request #515 from hashicorp/Vulnerability_Fix_v1
mohanmanikanta2299 Jan 9, 2025
f7836fb
sec: fix s3 and gcs host checks (#512)
dduzgun-security Jan 14, 2025
ba17f59
Speed up XZ decompression by 5x with bufio wrapper
vsarunas Mar 17, 2025
c831ccd
Merge pull request #520 from vsarunas/buffered-xz
mallikabandaru Mar 19, 2025
0164e52
actions/cache version update in GH Workflow
mohanmanikanta2299 Mar 20, 2025
4032cca
actions/artifact-upload version update in GH Workflow
mohanmanikanta2299 Mar 20, 2025
c37343e
Tes result artifact name update
mohanmanikanta2299 Mar 20, 2025
07eac9d
Merge pull request #522 from hashicorp/mohanm/fix_workflows
mohanmanikanta2299 Mar 20, 2025
1fc83f9
test: Remove use of "mitchellh/go-testing-interface" for stdlib (#523)
jrasell Apr 14, 2025
964a569
Merge remote-tracking branch 'upstream/main' into main
aliscott Apr 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Each line is a file pattern followed by one or more owners.
# More on CODEOWNERS files: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

# Default owner
* @hashicorp/team-ip-compliance

# Add override rules below. Each line is a file/folder pattern followed by one or more owners.
# Being an owner means those groups or individuals will be added as reviewers to PRs affecting
# those areas of the code.
# Examples:
# /docs/ @docs-team
# *.js @js-team
# *.go @go-team
14 changes: 6 additions & 8 deletions .github/workflows/go-getter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
strategy:
matrix:
go-version:
- 1.17
- 1.18
- 1.19
permissions:
Expand All @@ -32,7 +31,7 @@ jobs:
mkdir -p ${{ env.TEST_RESULTS_PATH }}

- name: Setup cache for go modules
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.cache/go-build
Expand Down Expand Up @@ -82,17 +81,16 @@ jobs:

# Save coverage report parts
- name: Upload and save artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: linux test results
name: linux-test-results-${{ matrix.go-version }}
path: linux_cov.part

windows-tests:
runs-on: windows-latest
strategy:
matrix:
go-version:
- 1.17
- 1.18
- 1.19
permissions:
Expand All @@ -111,7 +109,7 @@ jobs:
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Setup cache for go modules
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~\AppData\Local\go-build
Expand Down Expand Up @@ -152,7 +150,7 @@ jobs:

# Save coverage report parts
- name: Upload and save artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: windows test results
name: windows-test-results-${{ matrix.go-version }}
path: win_cov.part
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
version: latest
args: release --skip-validate --timeout "60m"
args: release --skip=validate --timeout "60m"
env:
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 6 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: 2

env:
- GOPRIVATE=github.com/hashicorp

Expand Down Expand Up @@ -46,4 +51,4 @@ signs:
artifacts: checksum

changelog:
skip: true
disable: true
3 changes: 3 additions & 0 deletions checksum.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions client_mode.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

// ClientMode is the mode that the client operates in.
Expand Down
3 changes: 3 additions & 0 deletions client_option.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions client_option_insecure.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

// WithInsecure allows for a user to avoid
Expand Down
3 changes: 3 additions & 0 deletions client_option_progress.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions client_option_progress_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions cmd/go-getter/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions cmd/go-getter/progress_tracking.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions common.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions copy_dir.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_bzip2.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_bzip2_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_gzip.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_gzip_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tar.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tar_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tbz2.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tbz2_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
16 changes: 9 additions & 7 deletions decompress_testing.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand All @@ -11,9 +14,8 @@ import (
"runtime"
"sort"
"strings"
"testing"
"time"

"github.com/mitchellh/go-testing-interface"
)

// TestDecompressCase is a single test case for testing decompressors
Expand All @@ -27,7 +29,7 @@ type TestDecompressCase struct {
}

// TestDecompressor is a helper function for testing generic decompressors.
func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
func TestDecompressor(t testing.TB, d Decompressor, cases []TestDecompressCase) {
t.Helper()

for _, tc := range cases {
Expand Down Expand Up @@ -80,7 +82,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), dst, actual.String())
}
} else if actual.Unix() <= 0 {
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String())
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", tc.Input, actual.String())
}
}

Expand Down Expand Up @@ -115,7 +117,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), path, actual.String())
}
} else if actual.Unix() < 0 {
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String())
t.Fatalf("err %s: expected mtime to be > 0, got '%s'", tc.Input, actual.String())
}

}
Expand All @@ -124,7 +126,7 @@ func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) {
}
}

func testListDir(t testing.T, path string) []string {
func testListDir(t testing.TB, path string) []string {
var result []string
err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error {
if err != nil {
Expand Down Expand Up @@ -153,7 +155,7 @@ func testListDir(t testing.T, path string) []string {
return result
}

func testMD5(t testing.T, path string) string {
func testMD5(t testing.TB, path string) string {
f, err := os.Open(path)
if err != nil {
t.Fatalf("err: %s", err)
Expand Down
3 changes: 3 additions & 0 deletions decompress_tgz.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tgz_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
6 changes: 5 additions & 1 deletion decompress_txz.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
"bufio"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -42,7 +46,7 @@ func (d *TarXzDecompressor) Decompress(dst, src string, dir bool, umask os.FileM
defer f.Close()

// xz compression is second
txzR, err := xz.NewReader(f)
txzR, err := xz.NewReader(bufio.NewReader(f))
if err != nil {
return fmt.Errorf("Error opening an xz reader for %s: %s", src, err)
}
Expand Down
3 changes: 3 additions & 0 deletions decompress_txz_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tzst.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_tzst_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
6 changes: 5 additions & 1 deletion decompress_xz.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
"bufio"
"fmt"
"os"
"path/filepath"
Expand Down Expand Up @@ -36,7 +40,7 @@ func (d *XzDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode
defer f.Close()

// xz compression is second
xzR, err := xz.NewReader(f)
xzR, err := xz.NewReader(bufio.NewReader(f))
if err != nil {
return err
}
Expand Down
3 changes: 3 additions & 0 deletions decompress_xz_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
3 changes: 3 additions & 0 deletions decompress_zip.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

package getter

import (
Expand Down
Loading
Loading