Skip to content

Commit f1eb2f6

Browse files
Update dependencies and refactor
* Update dependencies * Fix sdk linting issues * Fix linting for openapi, okta and ldap plugins * Fix linting in jumpcloud, google and fusionauth plugins * Fix linting for azuread, azuredb2c and cognito plugins * Fix auth0 and cli linting errors * Update ci go linter and go releaser versions * Use linting rules from topaz and update formatting with gofumpt * Update error messages and address review comments * Update cognito fetch groups func * Update azuread plugin fetcher * Update azureadb2c fetcher * Update google and azure plugin fetchers * Update auth0 plugin fetcher and httpclient * Add fetcher helpers to sdk * Remove BASE_DIR from makefile * Address review comments * Fix generic fetcher map yield helper * Create a custom error writer in sdk * Update error writer * ErrorWriter embeds an io.Writer --------- Co-authored-by: Ronen Hilewicz <github@ronen.hilewi.cz>
1 parent f46d21f commit f1eb2f6

File tree

87 files changed

+1567
-906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1567
-906
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ env:
1717
VAULT_ADDR: https://vault.eng.aserto.com/
1818
PRE_RELEASE: ${{ github.ref == 'refs/heads/main' && 'main' || '' }}
1919
GO_VERSION: "1.24"
20-
GO_RELEASER_VERSION: "v2.3.2"
21-
GO_LANGCI_LINT_VERSION: "v1.64.5"
20+
GO_RELEASER_VERSION: "v2.8.2"
21+
GO_LANGCI_LINT_VERSION: "v2.0.2"
2222
GO_TESTSUM_VERSION: "1.11.0"
2323

2424
jobs:
@@ -60,7 +60,7 @@ jobs:
6060
go-version: ${{ env.GO_VERSION }}
6161
-
6262
name: Lint package ${{ matrix.package }}
63-
uses: golangci/golangci-lint-action@v6
63+
uses: golangci/golangci-lint-action@v7
6464
with:
6565
version: ${{ env.GO_LANGCI_LINT_VERSION }}
6666
install-mode: binary

.golangci.yaml

Lines changed: 74 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,83 @@
11
---
22
# golangci.com configuration
33
# https://github.com/golangci/golangci/wiki/Configuration
4-
5-
linters-settings:
6-
dupl:
7-
threshold: 100
8-
funlen:
9-
lines: 100
10-
statements: 80
11-
goconst:
12-
min-len: 2
13-
min-occurrences: 2
14-
gocritic:
15-
enabled-tags:
16-
- diagnostic
17-
- experimental
18-
- opinionated
19-
- performance
20-
- style
21-
disabled-checks:
22-
- dupImport # https://github.com/go-critic/go-critic/issues/845
23-
- ifElseChain
24-
- octalLiteral
25-
- whyNoLint
26-
- wrapperFunc
27-
gocyclo:
28-
min-complexity: 18
29-
goimports:
30-
local-prefixes: github.com/golangci/golangci-lint
31-
govet:
32-
settings:
33-
printf:
34-
funcs:
35-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
36-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
37-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
38-
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
39-
misspell:
40-
locale: US
41-
nolintlint:
42-
allow-unused: false # report any unused nolint directives
43-
require-explanation: false # don't require an explanation for nolint directives
44-
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
4+
version: "2"
455

466
linters:
47-
# please, do not use `enable-all`: it's deprecated and will be removed soon.
48-
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
49-
disable-all: true
50-
enable:
51-
- asciicheck
52-
- bodyclose
53-
- dogsled
7+
default: all
8+
9+
# explicitly disabled linters
10+
disable:
11+
- containedctx
12+
- contextcheck
13+
- cyclop
14+
- depguard
5415
- errcheck
55-
- copyloopvar
16+
- exhaustruct
5617
- exhaustive
57-
- funlen
58-
- gochecknoinits
59-
- goconst
60-
- gocritic
61-
- gocyclo
62-
- godot
63-
- err113
64-
- gofmt
65-
- goimports
66-
- goprintffuncname
67-
- gosec
68-
- gosimple
69-
- govet
70-
- ineffassign
71-
- misspell
72-
- nakedret
73-
- noctx
74-
- rowserrcheck
75-
- staticcheck
76-
- stylecheck
77-
- testpackage
78-
- typecheck
79-
- unconvert
80-
- unparam
81-
- unused
18+
- forbidigo
19+
- gomodguard # no go.mod at root level
20+
- gochecknoglobals # no configuration options
21+
- nilnil
22+
- nlreturn # redundant with wsl
23+
- paralleltest
24+
- revive
25+
- tagalign
26+
- thelper
27+
- varnamelen
28+
- wrapcheck
29+
30+
settings:
31+
cyclop:
32+
max-complexity: 12
33+
34+
errcheck:
35+
exclude-functions:
36+
- fmt.Fprint
37+
- fmt.Fprintf
38+
- fmt.Fprintln
39+
- os.Close
40+
41+
funlen:
42+
lines: 80
43+
statements: 60
44+
ignore-comments: true
45+
46+
gomoddirectives:
47+
replace-local: true
8248

83-
# don't enable:
84-
# - depguard
85-
# - dupl
86-
# - gochecknoglobals
87-
# - gocognit
88-
# - godox
89-
# - gomnd
90-
# - lll
91-
# - nestif
92-
# - nolintlint # conflict with 1.19 gofmt changes
93-
# - prealloc
94-
# - revive
95-
# - wsl
96-
# - whitespace
49+
gosec:
50+
excludes:
51+
- G104 # Errors unhandled
52+
- G304 # Potential file inclusion via variable (see https://github.com/golang/go/issues/67002)
9753

98-
issues:
99-
# List of regexps of issue texts to exclude, empty list by default.
100-
# But independently from this option we use default exclude patterns,
101-
# it can be disabled by `exclude-use-default: false`. To list all
102-
# excluded by default patterns execute `golangci-lint run --help`
103-
exclude:
104-
- declaration of "(err|ctx)" shadows declaration at
105-
- shadow of imported from 'github.com/stretchr/testify/assert' package 'assert'
106-
# Excluding configuration per-path, per-linter, per-text and per-source
107-
exclude-rules:
108-
- path: _test\.go
109-
linters:
110-
- gomnd
111-
# https://github.com/go-critic/go-critic/issues/926
112-
- text: "unnecessaryDefer:"
113-
linters:
114-
- gocritic
115-
- text: "unnamedResult:"
116-
linters:
117-
- gocritic
118-
- text: "G404"
119-
linters:
120-
- gosec
54+
ireturn:
55+
allow:
56+
- error
57+
- empty
58+
- stdlib
59+
- generic
60+
- proto.Message
61+
- v3.ImporterClient
62+
63+
lll:
64+
line-length: 150
65+
66+
recvcheck:
67+
exclusions:
68+
- "*.Map"
69+
70+
tagliatelle:
71+
case:
72+
rules:
73+
json: snake
74+
yaml: snake
75+
76+
exclusions:
77+
generated: lax
78+
79+
formatters:
80+
enable:
81+
- gofmt
82+
- gofumpt
83+
- goimports

.goreleaser.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ builds:
271271

272272
archives:
273273
# https://goreleaser.com/customization/archive/
274-
- format: zip
274+
- formats:
275+
- zip
275276
files:
276277
- LICENSE
277278
- README.md

cli/cmd/ds-load/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"fmt"
45
"os"
56
"strings"
67

@@ -18,13 +19,13 @@ func main() {
1819

1920
pluginFinder, err := plugin.NewHomeDirFinder(true)
2021
if err != nil {
21-
os.Stderr.WriteString(err.Error())
22+
_, _ = fmt.Fprint(os.Stderr, err)
2223
os.Exit(1)
2324
}
2425

2526
plugins, err := pluginFinder.Find()
2627
if err != nil {
27-
os.Stderr.WriteString(err.Error())
28+
_, _ = fmt.Fprint(os.Stderr, err)
2829
os.Exit(1)
2930
}
3031

cli/go.mod

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ toolchain go1.24.1
77
replace github.com/aserto-dev/ds-load/sdk => ../sdk
88

99
require (
10-
github.com/alecthomas/kong v1.8.1
11-
github.com/aserto-dev/ds-load/sdk v0.0.0-00010101000000-000000000000
12-
github.com/aserto-dev/go-aserto v0.33.7
13-
github.com/aserto-dev/go-directory v0.33.7
14-
github.com/fullstorydev/grpcurl v1.9.2
10+
github.com/alecthomas/kong v1.10.0
11+
github.com/aserto-dev/ds-load/sdk v0.0.0-20250408143332-e8965667fcc0
12+
github.com/aserto-dev/go-aserto v0.33.8
13+
github.com/aserto-dev/go-directory v0.33.10
14+
github.com/fullstorydev/grpcurl v1.9.3
1515
github.com/pkg/errors v0.9.1
16-
github.com/rs/zerolog v1.33.0
16+
github.com/rs/zerolog v1.34.0
1717
github.com/stretchr/testify v1.10.0
18-
golang.org/x/sync v0.12.0
19-
google.golang.org/grpc v1.71.0
18+
golang.org/x/sync v0.13.0
19+
google.golang.org/grpc v1.71.1
2020
)
2121

2222
require (
23-
github.com/aserto-dev/errors v0.0.15 // indirect
24-
github.com/aserto-dev/header v0.0.10 // indirect
25-
github.com/aserto-dev/logger v0.0.7 // indirect
26-
github.com/bufbuild/protocompile v0.10.0 // indirect
27-
github.com/cncf/xds/go v0.0.0-20241223141626-cff3c89139a3 // indirect
23+
github.com/aserto-dev/errors v0.0.17 // indirect
24+
github.com/aserto-dev/header v0.0.11 // indirect
25+
github.com/aserto-dev/logger v0.0.9 // indirect
26+
github.com/bufbuild/protocompile v0.14.1 // indirect
27+
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
2828
github.com/davecgh/go-spew v1.1.1 // indirect
2929
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
3030
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
@@ -35,17 +35,17 @@ require (
3535
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
3636
github.com/hashicorp/errwrap v1.1.0 // indirect
3737
github.com/hashicorp/go-multierror v1.1.1 // indirect
38-
github.com/jhump/protoreflect v1.16.0 // indirect
38+
github.com/jhump/protoreflect v1.17.0 // indirect
3939
github.com/mattn/go-colorable v0.1.14 // indirect
4040
github.com/mattn/go-isatty v0.0.20 // indirect
4141
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
4242
github.com/pmezard/go-difflib v1.0.0 // indirect
4343
github.com/samber/lo v1.49.1 // indirect
44-
golang.org/x/net v0.37.0 // indirect
45-
golang.org/x/sys v0.31.0 // indirect
46-
golang.org/x/text v0.23.0 // indirect
47-
google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect
48-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
49-
google.golang.org/protobuf v1.36.5 // indirect
44+
golang.org/x/net v0.39.0 // indirect
45+
golang.org/x/sys v0.32.0 // indirect
46+
golang.org/x/text v0.24.0 // indirect
47+
google.golang.org/genproto/googleapis/api v0.0.0-20250409194420-de1ac958c67a // indirect
48+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250409194420-de1ac958c67a // indirect
49+
google.golang.org/protobuf v1.36.6 // indirect
5050
gopkg.in/yaml.v3 v3.0.1 // indirect
5151
)

0 commit comments

Comments
 (0)