diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0818a5..14758a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [push] +on: [push, pull_request] jobs: build: @@ -15,6 +15,7 @@ jobs: uses: actions/setup-go@v6.0.0 with: go-version-file: go.mod + cache: true - name: Build run: make diff --git a/.github/workflows/vulnerability.yml b/.github/workflows/vulnerability.yml new file mode 100644 index 0000000..9c81783 --- /dev/null +++ b/.github/workflows/vulnerability.yml @@ -0,0 +1,19 @@ +name: Vulnerability Check + +on: [push, pull_request] + +jobs: + vulncheck: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5.0.0 + + - name: Install Go + uses: actions/setup-go@v6.0.0 + with: + go-version-file: go.mod + cache: true + + - name: Check for vulnerabilities + run: go run golang.org/x/vuln/cmd/govulncheck@latest ./... diff --git a/CHANGELOG.md b/CHANGELOG.md index 684eab1..909b326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ All notable changes to this project will be documented in this file. See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Added: +* Added `AWSAccountID` field to `CloudDetail` struct in subscriptions model for AWS account identification +* Added `govulncheck` to CI pipeline for automated vulnerability detection +* New `.github/workflows/vulnerability.yml` workflow for parallel vulnerability checking +* Enabled Go module caching in GitHub Actions for improved build performance + +### Updated: +* Updated Go toolchain to 1.25.3 to address stdlib vulnerabilities (GO-2025-4007, GO-2025-3751, GO-2025-3750, GO-2025-3749, GO-2025-3563) + +### Tests: +* Added AWS account ID to subscription test fixtures (`TestSubscription_List`, `TestSubscription_Get`, `TestSubscription_Get_PublicEndpointAccess`) + ## 0.40.0 (31st October 2025) ### Added: diff --git a/go.mod b/go.mod index 27de6d7..4ed36f9 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/RedisLabs/rediscloud-go-api go 1.24.0 -toolchain go1.24.1 +toolchain go1.25.3 require ( github.com/avast/retry-go/v4 v4.7.0 diff --git a/service/subscriptions/model.go b/service/subscriptions/model.go index ce1d98a..f5e172e 100644 --- a/service/subscriptions/model.go +++ b/service/subscriptions/model.go @@ -153,6 +153,7 @@ func (o Subscription) String() string { type CloudDetail struct { Provider *string `json:"provider,omitempty"` CloudAccountID *int `json:"cloudAccountId,omitempty"` + AWSAccountID *string `json:"awsAccountId,omitempty"` TotalSizeInGB *float64 `json:"totalSizeInGb,omitempty"` Regions []*Region `json:"regions,omitempty"` } diff --git a/subscription_test.go b/subscription_test.go index 2816f79..e1c6697 100644 --- a/subscription_test.go +++ b/subscription_test.go @@ -425,6 +425,7 @@ func TestSubscription_List(t *testing.T) { { "provider": "AWS", "cloudAccountId": 2, + "awsAccountId": "123456789012", "totalSizeInGb": 0.0062, "regions": [ { @@ -509,6 +510,7 @@ func TestSubscription_List(t *testing.T) { { Provider: redis.String("AWS"), CloudAccountID: redis.Int(2), + AWSAccountID: redis.String("123456789012"), TotalSizeInGB: redis.Float64(0.0062), Regions: []*subscriptions.Region{ { @@ -579,6 +581,7 @@ func TestSubscription_Get(t *testing.T) { { "provider": "AWS", "cloudAccountId": 3, + "awsAccountId": "987654321098", "totalSizeInGb": 4, "regions": [ { @@ -624,6 +627,7 @@ func TestSubscription_Get(t *testing.T) { { Provider: redis.String("AWS"), CloudAccountID: redis.Int(3), + AWSAccountID: redis.String("987654321098"), TotalSizeInGB: redis.Float64(4), Regions: []*subscriptions.Region{ { @@ -658,6 +662,7 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) { { "provider": "AWS", "cloudAccountId": 3, + "awsAccountId": "111222333444", "totalSizeInGb": 4, "regions": [ { @@ -704,6 +709,7 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) { { Provider: redis.String("AWS"), CloudAccountID: redis.Int(3), + AWSAccountID: redis.String("111222333444"), TotalSizeInGB: redis.Float64(4), Regions: []*subscriptions.Region{ {