From bc9fb5fb3c2f2775b5398a43d401dc13a5668866 Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Tue, 30 Jul 2024 14:25:29 +0100 Subject: [PATCH 1/3] Add `ClusterTraffic` to account claims For supporting nats-io/nats-server#5466. For now expected values would be: * `"system"` - use the system account (default, as today) * `"owner"` - use the same account that owns the asset * `"account:ACCNAME"` - use a third specified `ACCNAME` Signed-off-by: Neil Twigg --- v2/account_claims.go | 1 + 1 file changed, 1 insertion(+) diff --git a/v2/account_claims.go b/v2/account_claims.go index fa8fc58..e071a8c 100644 --- a/v2/account_claims.go +++ b/v2/account_claims.go @@ -241,6 +241,7 @@ type Account struct { Mappings Mapping `json:"mappings,omitempty"` Authorization ExternalAuthorization `json:"authorization,omitempty"` Trace *MsgTrace `json:"trace,omitempty"` + ClusterTraffic string `json:"cluster_traffic,omitempty"` Info GenericFields } From 2e1251e5109465388c40eef4d5224c42edd03d11 Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Tue, 10 Sep 2024 10:31:40 +0100 Subject: [PATCH 2/3] Update CI to use latest stable Go version Signed-off-by: Neil Twigg --- .github/workflows/go-test.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml index 4263e1e..72391d2 100644 --- a/.github/workflows/go-test.yaml +++ b/.github/workflows/go-test.yaml @@ -7,10 +7,10 @@ jobs: strategy: matrix: include: - - go: '1.19.x' + - go: "stable" os: ubuntu-latest canonical: true - - go: '1.19.x' + - go: "stable" os: windows-latest canonical: false @@ -29,7 +29,6 @@ jobs: with: go-version: ${{matrix.go}} - - name: Install deps shell: bash --noprofile --norc -x -eo pipefail {0} run: | From 1378f5922cddb43d7776da60f100520aee0a6c59 Mon Sep 17 00:00:00 2001 From: Neil Twigg Date: Tue, 10 Sep 2024 22:37:40 +0100 Subject: [PATCH 3/3] Fix lint errors, probably from new staticcheck version Signed-off-by: Neil Twigg --- v2/types.go | 2 +- v2/v1compat/types.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/types.go b/v2/types.go index f0db549..d5814db 100644 --- a/v2/types.go +++ b/v2/types.go @@ -309,7 +309,7 @@ func (l *Limits) Validate(vr *ValidationResults) { } } - if l.Times != nil && len(l.Times) > 0 { + if len(l.Times) > 0 { for _, t := range l.Times { t.Validate(vr) } diff --git a/v2/v1compat/types.go b/v2/v1compat/types.go index a1f09fd..25725fc 100644 --- a/v2/v1compat/types.go +++ b/v2/v1compat/types.go @@ -197,7 +197,7 @@ func (l *Limits) Validate(vr *ValidationResults) { } } - if l.Times != nil && len(l.Times) > 0 { + if len(l.Times) > 0 { for _, t := range l.Times { t.Validate(vr) }