Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sgm/parsepath
Browse files Browse the repository at this point in the history
  • Loading branch information
sgmiller committed Jan 6, 2025
2 parents 0e5fa2f + 7876aa2 commit 2dc6748
Show file tree
Hide file tree
Showing 81 changed files with 2,077 additions and 4,704 deletions.
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This repo contains modules that are used by many different projects within
# HashiCorp. As such, seemingly minor changes meant for one project can have
# unexpected impacts on another.
#
# For this reason there are currently a few stewards within Secure that
# have a good understanding of those impacts on their projects and coordinate
# if there is uncertainty, and they are the owners rather than a team that may
# be modified externally.

* @jefferai @sgmiller @jimlambrt
62 changes: 33 additions & 29 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,54 @@ jobs:
build:
strategy:
matrix:
go: ["1.20", "1.19", "1.18", "1.17"]
go: ["1.21", "1.20"]
platform: [ubuntu-latest] # can not run in windows OS
runs-on: ${{ matrix.platform }}

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: go mod package cache
uses: actions/cache@v2
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}

- name: Build
run: CGO_ENABLED=0 find . -name go.mod -execdir go build ./... \;
run: find . -name go.mod -execdir sh -c 'pwd && CGO_ENABLED=0 go build ./... || exit 1' sh {} +

- name: JS/WASM Build
run: find . -name go.mod -not -path "*examples*" -execdir sh -c 'pwd && GOOS=js GOARCH=wasm CGO_CENABLED=0 go build ./... || exit 1' sh {} +

- name: Test
# exclude the transit plugin since it's tested with the plugin-transit
# job, which requires a vault container to be running
run: find . -name go.mod -not -path "*wrappers/transit/*" -execdir go test ./... \;
run: find . -name go.mod -not -path "*wrappers/transit/*" -execdir sh -c 'go test ./... || exit 1' sh {} +

sqlite:
strategy:
matrix:
go: ["1.20", "1.19", "1.18"]
go: ["1.21", "1.20"]
platform: [ubuntu-latest] # can not run in windows OS
runs-on: ${{ matrix.platform }}

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: go mod package cache
uses: actions/cache@v2
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
Expand All @@ -74,7 +77,7 @@ jobs:
"postgres:11",
"postgres:10",
]
go: ["1.20", "1.19", "1.18"]
go: ["1.21", "1.20"]
platform: [ubuntu-latest] # can not run in macOS and Windows
runs-on: ${{ matrix.platform }}

Expand All @@ -96,15 +99,15 @@ jobs:
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: go mod package cache
uses: actions/cache@v2
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
Expand All @@ -116,21 +119,21 @@ jobs:
plugin-transit:
strategy:
matrix:
go: ["1.20", "1.19", "1.18", "1.17"]
go: ["1.21", "1.20"]
platform: [ubuntu-latest] # can not run in macOS and Windows
runs-on: ${{ matrix.platform }}

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: go mod package cache
uses: actions/cache@v2
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('tests/go.mod') }}
Expand All @@ -152,19 +155,19 @@ jobs:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: bufbuild/buf-setup-action@a2450ddf330ebcbbb88645837933e7141568fd09 # v1.23.1
with:
version: "1.15.1"
- uses: bufbuild/buf-lint-action@v1
- uses: bufbuild/buf-breaking-action@v1
- uses: bufbuild/buf-lint-action@bd48f53224baaaf0fc55de9a913e7680ca6dbea4 # v1.0.3
- uses: bufbuild/buf-breaking-action@f47418c81c00bfd65394628385593542f64db477 # v1.1.2
with:
# The 'main' branch of the GitHub repository that defines the module.
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main"
- name: Set up Go 1.x
uses: actions/setup-go@v4
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: go.mod
go-version-file: go.mod
- name: install go-inject-tag dependency
run: |
go install github.com/favadi/[email protected]
Expand All @@ -179,21 +182,22 @@ jobs:
# if merged -> then lint, build and finally push a commit to the buf registry
buf_if_merged:
if: ${{ github.ref_name == 'main'}}
strategy:
matrix:
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v1
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: bufbuild/buf-setup-action@a2450ddf330ebcbbb88645837933e7141568fd09 # v1.23.1
with:
version: "1.15.1"
- uses: bufbuild/buf-lint-action@v1
- uses: bufbuild/buf-breaking-action@v1
- uses: bufbuild/buf-lint-action@bd48f53224baaaf0fc55de9a913e7680ca6dbea4 # v1.0.3
- uses: bufbuild/buf-breaking-action@f47418c81c00bfd65394628385593542f64db477 # v1.1.2
with:
# The 'main' branch of the GitHub repository that defines the module.
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main"
- uses: bufbuild/buf-push-action@v1
- uses: bufbuild/buf-push-action@1c45f6a21ec277ee4c1fa2772e49b9541ea17f38 # v1.1.1
with:
buf_token: ${{ secrets.BUF_TOKEN }}
draft: ${{ github.ref_name != 'main'}}
46 changes: 46 additions & 0 deletions .github/workflows/make-gen-delta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "make-gen-delta"
on:
- workflow_dispatch
- push
- workflow_call

permissions:
contents: read

jobs:
make-gen-delta:
name: "Check for uncommitted changes from make gen in extras/kms"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: '0'
- name: Determine Go version
id: get-go-version
# We use .go-version as our source of truth for current Go
# version, because "goenv" can react to it automatically.
run: |
echo "Building with Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "${{ steps.get-go-version.outputs.go-version }}"
- name: Running go mod tidy
run: |
cd ./extras/kms
go mod tidy
- name: Install Dependencies
run: |
cd ./extras/kms
make tools
- name: Running make fmt
run: |
cd ./extras/kms
make fmt
- name: Check for changes
run: |
cd ./extras/kms
git diff --exit-code
git status --porcelain
test -z "$(git status --porcelain)"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.vscode
.idea
go.work
go.work.sum
4 changes: 2 additions & 2 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

version: v1
plugins:
- plugin: buf.build/protocolbuffers/go
- plugin: buf.build/protocolbuffers/go:v1.34.1
out: .
opt: paths=source_relative
- plugin: buf.build/grpc/go
- plugin: buf.build/grpc/go:v1.3.0
out: .
opt:
- paths=source_relative
40 changes: 20 additions & 20 deletions examples/plugin-cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/hashicorp/go-kms-wrapping/v2/examples/plugin-cli
go 1.20

require (
github.com/hashicorp/go-hclog v1.4.0
github.com/hashicorp/go-kms-wrapping/v2 v2.0.9-0.20230228100945-740d2999c798
github.com/hashicorp/go-secure-stdlib/configutil/v2 v2.0.7
github.com/hashicorp/go-secure-stdlib/pluginutil/v2 v2.0.3
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-kms-wrapping/v2 v2.0.14
github.com/hashicorp/go-secure-stdlib/configutil/v2 v2.0.11
github.com/hashicorp/go-secure-stdlib/pluginutil/v2 v2.0.6
)

require (
Expand All @@ -17,19 +17,19 @@ require (
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-kms-wrapping/plugin/v2 v2.0.3 // indirect
github.com/hashicorp/go-kms-wrapping/plugin/v2 v2.0.5 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.8 // indirect
github.com/hashicorp/go-plugin v1.5.2 // indirect
github.com/hashicorp/go-secure-stdlib/base62 v0.1.2 // indirect
github.com/hashicorp/go-secure-stdlib/listenerutil v0.1.5 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 // indirect
github.com/hashicorp/go-secure-stdlib/listenerutil v0.1.9 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect
github.com/hashicorp/go-secure-stdlib/reloadutil v0.1.1 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.3 // indirect
github.com/hashicorp/go-sockaddr v1.0.6 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
Expand All @@ -49,13 +49,13 @@ require (
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/stretchr/testify v1.8.2 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20230227214838-9b19f0bdc514 // indirect
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/stretchr/testify v1.8.4 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 2dc6748

Please sign in to comment.