From 6c6baafb2c7927abc69ef0abef3403784fbc6d5a Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Wed, 2 Sep 2026 17:29:08 +0200 Subject: [PATCH] chore(deps): update go, linter and deps Go 1.27, golangci-lint v2.13.2 and dependency refresh. Config updated for the new linter set: exhaustruct_v5 and wsl_v5 disabled alongside their v1 counterparts, deprecated gomodguard disabled in favor of gomodguard_v2, goconst excluded from tests, gofumpt extra rules expressed with the granular `extra` settings. modernize findings applied: interface{} -> any, and the stringPtr/boolPtr helpers replaced by Go 1.27 new(value). --- .github/workflows/ci.yaml | 2 +- .golangci.yml | 9 +- cmd/internal/mongo.go | 1 + go.mod | 79 +++++++------- go.sum | 176 ++++++++++++++------------------ pkg/db/db.go | 42 ++++---- pkg/db/mongodb/bootstrap.go | 16 +-- pkg/db/mongodb/plugindb.go | 30 +++--- pkg/db/mongodb/plugindb_test.go | 47 +++++---- pkg/handlers/handlers_test.go | 10 +- pkg/handlers/jsonerror.go | 4 +- pkg/handlers/module.go | 1 + 12 files changed, 203 insertions(+), 214 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1325759..67360ea 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -24,7 +24,7 @@ jobs: if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft }} env: # renovate: datasource=github-tags depName=golangci/golangci-lint versioning=loose - GOLANGCI_LINT_VERSION: 'v2.3.0' + GOLANGCI_LINT_VERSION: 'v2.13.2' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: diff --git a/.golangci.yml b/.golangci.yml index 1001450..1044e17 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,8 @@ linters: - err113 - exhaustive - exhaustruct + - exhaustruct_v5 + - gomodguard # deprecated, replaced by gomodguard_v2 - inamedparam - ireturn - lll @@ -28,6 +30,7 @@ linters: - varnamelen - wrapcheck - wsl + - wsl_v5 settings: depguard: rules: @@ -73,6 +76,7 @@ linters: text: '`(version|date|commit)` is a global variable' - linters: - funlen + - goconst - maintidx - unused path: .*_test.go @@ -118,7 +122,10 @@ formatters: - goimports settings: gofumpt: - extra-rules: true + extra: + group-params: true + clothe-returns: true + balance-calls: true exclusions: generated: lax paths: diff --git a/cmd/internal/mongo.go b/cmd/internal/mongo.go index be853af..d74c6b6 100644 --- a/cmd/internal/mongo.go +++ b/cmd/internal/mongo.go @@ -16,6 +16,7 @@ import ( // MongoFlags setup CLI flags for MongoDB. func MongoFlags() []cli.Flag { return []cli.Flag{ + //nolint:gosec // G101: local development default, overridden by MONGODB_URI in every real environment. &cli.StringFlag{ Name: "mongodb-uri", Usage: "MongoDB connection string", diff --git a/go.mod b/go.mod index 4e4d097..e81169d 100644 --- a/go.mod +++ b/go.mod @@ -1,61 +1,62 @@ module github.com/traefik/plugin-service -go 1.23.0 +go 1.27 + +toolchain go1.27.1 require ( github.com/ettle/strcase v0.2.0 github.com/google/go-github/v74 v74.0.0 github.com/gorilla/mux v1.8.1 github.com/julienschmidt/httprouter v1.3.0 - github.com/ldez/grignotin v0.9.0 - github.com/rs/zerolog v1.34.0 - github.com/stretchr/testify v1.10.0 + github.com/ldez/grignotin v0.10.1 + github.com/rs/zerolog v1.35.1 + github.com/stretchr/testify v1.12.1 github.com/urfave/cli/v2 v2.27.7 - go.mongodb.org/mongo-driver v1.17.4 - go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.62.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 - go.opentelemetry.io/otel v1.37.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.37.0 - go.opentelemetry.io/otel/sdk v1.37.0 - go.opentelemetry.io/otel/trace v1.37.0 - golang.org/x/oauth2 v0.30.0 + go.mongodb.org/mongo-driver v1.17.9 + go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.71.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 + go.opentelemetry.io/otel v1.46.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.46.0 + go.opentelemetry.io/otel/sdk v1.46.0 + go.opentelemetry.io/otel/trace v1.46.0 + golang.org/x/oauth2 v0.36.0 ) require ( - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/go-logr/logr v1.4.3 // indirect + github.com/felixge/httpsnoop v1.1.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/snappy v1.0.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect + github.com/google/go-querystring v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect - github.com/klauspost/compress v1.18.0 // indirect - github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/montanaflynn/stats v0.7.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/klauspost/compress v1.20.0 // indirect + github.com/mattn/go-colorable v0.1.15 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect + github.com/montanaflynn/stats v0.12.5 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.1.2 // indirect + github.com/xdg-go/scram v1.2.0 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect - go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel/metric v1.37.0 // indirect - go.opentelemetry.io/proto/otlp v1.7.0 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/mod v0.26.0 // indirect - golang.org/x/net v0.42.0 // indirect - golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250721164621-a45f3dfb1074 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 // indirect - google.golang.org/grpc v1.73.0 // indirect - google.golang.org/protobuf v1.36.6 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/crypto v0.55.0 // indirect + golang.org/x/mod v0.40.0 // indirect + golang.org/x/net v0.58.0 // indirect + golang.org/x/sync v0.22.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.41.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260831171406-18b4a7587f8a // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260831171406-18b4a7587f8a // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect ) diff --git a/go.sum b/go.sum index a55fbcf..10afd31 100644 --- a/go.sum +++ b/go.sum @@ -1,74 +1,61 @@ -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo= github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= +github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v74 v74.0.0 h1:yZcddTUn8DPbj11GxnMrNiAnXH14gNs559AsUpNpPgM= github.com/google/go-github/v74 v74.0.0/go.mod h1:ubn/YdyftV80VPSI26nSJvaEsTOnsjrxG3o9kJhcyak= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 h1:X5VWvz21y3gzm9Nw/kaUeku/1+uBhcekkmy4IkffJww= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1/go.mod h1:Zanoh4+gvIgluNqcfMVTJueD4wSS5hT7zTt4Mrutd90= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ldez/grignotin v0.9.0 h1:MgOEmjZIVNn6p5wPaGp/0OKWyvq42KnzAt/DAb8O4Ow= -github.com/ldez/grignotin v0.9.0/go.mod h1:uaVTr0SoZ1KBii33c47O1M8Jp3OP3YDwhZCmzT9GHEk= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE= -github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= -github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= -github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= +github.com/klauspost/compress v1.20.0 h1:a3C1ke2ohxFymNlb2HWAHjDeKCI90scRskErZkR0ezA= +github.com/klauspost/compress v1.20.0/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= +github.com/ldez/grignotin v0.10.1 h1:keYi9rYsgbvqAZGI1liek5c+jv9UUjbvdj3Tbn5fn4o= +github.com/ldez/grignotin v0.10.1/go.mod h1:UlDbXFCARrXbWGNGP3S5vsysNXAPhnSuBufpTEbwOas= +github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= +github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= +github.com/montanaflynn/stats v0.12.5 h1:bmGi2m9LQJ6qKrDAvd/xZ3IKz+BEfZT2JnCYVbYKU7Y= +github.com/montanaflynn/stats v0.12.5/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI= +github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU= github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/scram v1.2.0 h1:bYKF2AEwG5rqd1BumT4gAnvwU/M9nBp2pTSxeZw7Wvs= +github.com/xdg-go/scram v1.2.0/go.mod h1:3dlrS0iBaWKYVt2ZfA4cj48umJZ+cAEbR6/SjLA88I8= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= @@ -76,83 +63,78 @@ github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBi github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw= -go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= -go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= -go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= -go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.62.0 h1:IDI0wUpSFq/RUr1rRTHT7nF/Mr3V4kENTn05P39fH7k= -go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.62.0/go.mod h1:PxUlDgXfAHM+OrUrqs3pbc2OR59ZLDSe9r5NiS0B/4E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0 h1:Hf9xI/XLML9ElpiHVDNwvqI0hIFlzV8dgIr35kV1kRU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0/go.mod h1:NfchwuyNoMcZ5MLHwPrODwUF1HWCXWrL31s8gSAdIKY= -go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= -go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 h1:Ahq7pZmv87yiyn3jeFz/LekZmPLLdKejuO3NcK9MssM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0/go.mod h1:MJTqhM0im3mRLw1i8uGHnCvUEeS7VwRyxlLC78PA18M= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.37.0 h1:bDMKF3RUSxshZ5OjOTi8rsHGaPKsAt76FaqgvIUySLc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.37.0/go.mod h1:dDT67G/IkA46Mr2l9Uj7HsQVwsjASyV9SjGofsiUZDA= -go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= -go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= -go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= -go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= -go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= -go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= -go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= -go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= -go.opentelemetry.io/proto/otlp v1.7.0 h1:jX1VolD6nHuFzOYso2E73H85i92Mv8JQYk0K9vz09os= -go.opentelemetry.io/proto/otlp v1.7.0/go.mod h1:fSKjH6YJ7HDlwzltzyMj036AJ3ejJLCgCSHGj4efDDo= +go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU= +go.mongodb.org/mongo-driver v1.17.9/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.71.0 h1:R2/bh4FhetellQgP/8OfGDVkkb47xf3CXD759wyFHRM= +go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo v0.71.0/go.mod h1:otZxVOqNx5ilNmEV4/H/TtdyFfkYKRqUwUCyJH67dSU= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 h1:3g7B90UzBltIDKq1/5mrTGxTnOFDV0ICOhLoxiZ8jlg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0/go.mod h1:Ef8SuTh59BT7+ofpDxN9z+yOlc4t2GjLmKDgYNJL/NU= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 h1:OFnwLJr+pF3iHrlGSzbxyuo6/6HyBlnlN1CWEJmBVcw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0/go.mod h1:716wFneO0ov19A2beH5hjfh9AK5z/VWNAtDijp1Y0/g= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.46.0 h1:KrC1YrQeSt46ITMWAbgQx1M1eV1/1TKzttrBzymPmss= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.46.0/go.mod h1:zDSEzoEqsOrgBeGvH66KRgxh90VonFyJqBHA0Pk3+rM= +go.opentelemetry.io/otel/metric v1.46.0 h1:yBnkXvgV7AXFILZc5K6IZe/CBFF3OS7BJ8ov6/lj0K8= +go.opentelemetry.io/otel/metric v1.46.0/go.mod h1:iPmdWqifKUdzziPkvvzIJXITl56fQx2mGM/DHLB3/2o= +go.opentelemetry.io/otel/sdk v1.46.0 h1:h5CNQQjEbuQXY/JfZtgt3i7HVFV3aHPO2OAwO2eTYPI= +go.opentelemetry.io/otel/sdk v1.46.0/go.mod h1:GAERFXFt5SYCEB+YiKUbMBeza6UaDH7GmGOZEfh2gSM= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.46.0 h1:OULy7ccdJnZtJ0UDYFOIGaCmiWzJ8Vi2G/Rsu60qs1c= +go.opentelemetry.io/otel/trace v1.46.0/go.mod h1:J7GAXweO77XSFkB/rmAqk9D6ihszhFjLU+d9WuUxDLI= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= +golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg= -golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ= +golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs= +golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= -golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= -golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= +golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= +golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= +golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/api v0.0.0-20250721164621-a45f3dfb1074 h1:mVXdvnmR3S3BQOqHECm9NGMjYiRtEvDYcqAqedTXY6s= -google.golang.org/genproto/googleapis/api v0.0.0-20250721164621-a45f3dfb1074/go.mod h1:vYFwMYFbmA8vl6Z/krj/h7+U/AqpHknwJX4Uqgfyc7I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074 h1:qJW29YvkiJmXOYMu5Tf8lyrTp3dOS+K4z6IixtLaCf8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250721164621-a45f3dfb1074/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.73.0 h1:VIWSmpI2MegBtTuFt5/JWy2oXxtjJ/e89Z70ImfD2ok= -google.golang.org/grpc v1.73.0/go.mod h1:50sbHOUqWoCQGI8V2HQLJM0B+LMlIUjNSZmow7EVBQc= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260831171406-18b4a7587f8a h1:i3TAXhpKc7TUP1VAPiBBrv45kamjoizCC3rOC0cAbOs= +google.golang.org/genproto/googleapis/api v0.0.0-20260831171406-18b4a7587f8a/go.mod h1:CvYJHpbzPlT0fb/PsgtAamdwru/GVxUsomFdXTpOTI8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260831171406-18b4a7587f8a h1:3Dnd1cDaZlB68lziofO+bJXpjOy8UfRv8Unt+yH8tQ4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260831171406-18b4a7587f8a/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/pkg/db/db.go b/pkg/db/db.go index 706e907..9fe9ca5 100644 --- a/pkg/db/db.go +++ b/pkg/db/db.go @@ -4,27 +4,27 @@ import "time" // Plugin The plugin information. type Plugin struct { - ID string `json:"id,omitempty" bson:"id"` - Name string `json:"name,omitempty" bson:"name"` - DisplayName string `json:"displayName,omitempty" bson:"displayName"` - Runtime string `json:"runtime,omitempty" bson:"runtime"` - WasmPath string `json:"wasmPath,omitempty" bson:"wasmPath"` - Author string `json:"author,omitempty" bson:"author"` - Type string `json:"type,omitempty" bson:"type"` - Import string `json:"import,omitempty" bson:"import"` - Compatibility string `json:"compatibility,omitempty" bson:"compatibility"` - Summary string `json:"summary,omitempty" bson:"summary"` - IconURL string `json:"iconUrl,omitempty" bson:"iconUrl"` - BannerURL string `json:"bannerUrl,omitempty" bson:"bannerUrl"` - Readme string `json:"readme,omitempty" bson:"readme"` - LatestVersion string `json:"latestVersion,omitempty" bson:"latestVersion"` - Versions []string `json:"versions,omitempty" bson:"versions"` - Stars int `json:"stars,omitempty" bson:"stars"` - Snippet map[string]interface{} `json:"snippet,omitempty" bson:"snippet"` - CreatedAt time.Time `json:"createdAt" bson:"createdAt"` - Disabled bool `json:"disabled,omitempty" bson:"disabled"` - Hidden bool `json:"hidden,omitempty" bson:"hidden"` - UseUnsafe bool `json:"useUnsafe,omitempty" bson:"useUnsafe"` + ID string `json:"id,omitempty" bson:"id"` + Name string `json:"name,omitempty" bson:"name"` + DisplayName string `json:"displayName,omitempty" bson:"displayName"` + Runtime string `json:"runtime,omitempty" bson:"runtime"` + WasmPath string `json:"wasmPath,omitempty" bson:"wasmPath"` + Author string `json:"author,omitempty" bson:"author"` + Type string `json:"type,omitempty" bson:"type"` + Import string `json:"import,omitempty" bson:"import"` + Compatibility string `json:"compatibility,omitempty" bson:"compatibility"` + Summary string `json:"summary,omitempty" bson:"summary"` + IconURL string `json:"iconUrl,omitempty" bson:"iconUrl"` + BannerURL string `json:"bannerUrl,omitempty" bson:"bannerUrl"` + Readme string `json:"readme,omitempty" bson:"readme"` + LatestVersion string `json:"latestVersion,omitempty" bson:"latestVersion"` + Versions []string `json:"versions,omitempty" bson:"versions"` + Stars int `json:"stars,omitempty" bson:"stars"` + Snippet map[string]any `json:"snippet,omitempty" bson:"snippet"` + CreatedAt time.Time `json:"createdAt" bson:"createdAt"` + Disabled bool `json:"disabled,omitempty" bson:"disabled"` + Hidden bool `json:"hidden,omitempty" bson:"hidden"` + UseUnsafe bool `json:"useUnsafe,omitempty" bson:"useUnsafe"` } // PluginHash The plugin hash tuple. diff --git a/pkg/db/mongodb/bootstrap.go b/pkg/db/mongodb/bootstrap.go index ce43432..96d9202 100644 --- a/pkg/db/mongodb/bootstrap.go +++ b/pkg/db/mongodb/bootstrap.go @@ -21,20 +21,20 @@ func (m *MongoDB) Bootstrap() error { models := []mongo.IndexModel{ { Options: &options.IndexOptions{ - Name: stringPtr("_uniq_id"), - Unique: boolPtr(true), + Name: new("_uniq_id"), + Unique: new(true), }, Keys: bson.D{{Key: "id", Value: 1}}, }, { Options: &options.IndexOptions{ - Name: stringPtr("_by_stars"), + Name: new("_by_stars"), }, Keys: bson.D{{Key: "stars", Value: 1}}, }, { Options: &options.IndexOptions{ - Name: stringPtr("_by_name"), + Name: new("_by_name"), }, Keys: bson.D{{Key: "name", Value: 1}}, }, @@ -46,11 +46,3 @@ func (m *MongoDB) Bootstrap() error { return nil } - -func stringPtr(val string) *string { - return &val -} - -func boolPtr(val bool) *bool { - return &val -} diff --git a/pkg/db/mongodb/plugindb.go b/pkg/db/mongodb/plugindb.go index 49e3c5c..5441002 100644 --- a/pkg/db/mongodb/plugindb.go +++ b/pkg/db/mongodb/plugindb.go @@ -20,6 +20,12 @@ import ( const collName = "plugin" +const ( + fieldHashes = "hashes" + fieldDisabled = "disabled" + fieldHidden = "hidden" +) + // MongoDB is a mongoDB client. type MongoDB struct { client *mongo.Database @@ -53,7 +59,7 @@ func (m *MongoDB) Get(ctx context.Context, id string) (db.Plugin, error) { } opts := &options.FindOneOptions{} - opts.SetProjection(bson.D{{Key: "hashes", Value: 0}}) + opts.SetProjection(bson.D{{Key: fieldHashes, Value: 0}}) var plugin db.Plugin @@ -124,8 +130,8 @@ func (m *MongoDB) List(ctx context.Context, page db.Pagination) ([]db.Plugin, st defer span.End() criteria := bson.D{ - {Key: "disabled", Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, - {Key: "hidden", Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, + {Key: fieldDisabled, Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, + {Key: fieldHidden, Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, } if page.Start != "" { @@ -153,7 +159,7 @@ func (m *MongoDB) List(ctx context.Context, page db.Pagination) ([]db.Plugin, st opts := &options.FindOptions{} opts.SetLimit(int64(page.Size + 1)) - opts.SetProjection(bson.D{{Key: "hashes", Value: 0}}) + opts.SetProjection(bson.D{{Key: fieldHashes, Value: 0}}) opts.SetSort(bson.D{{Key: "stars", Value: -1}}) cursor, err := m.client.Collection(m.collName).Find(ctx, criteria, opts) @@ -187,15 +193,15 @@ func (m *MongoDB) GetByName(ctx context.Context, name string, filterDisabled, fi } if filterHidden { - criteria = append(criteria, bson.E{Key: "hidden", Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}) + criteria = append(criteria, bson.E{Key: fieldHidden, Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}) } if filterDisabled { - criteria = append(criteria, bson.E{Key: "disabled", Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}) + criteria = append(criteria, bson.E{Key: fieldDisabled, Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}) } opts := &options.FindOneOptions{} - opts.SetProjection(bson.D{{Key: "hashes", Value: 0}}) + opts.SetProjection(bson.D{{Key: fieldHashes, Value: 0}}) var plugin db.Plugin @@ -219,8 +225,8 @@ func (m *MongoDB) SearchByName(ctx context.Context, name string, page db.Paginat criteria := bson.D{ {Key: "displayName", Value: primitive.Regex{Pattern: regexp.QuoteMeta(name), Options: "i"}}, - {Key: "disabled", Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, - {Key: "hidden", Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, + {Key: fieldDisabled, Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, + {Key: fieldHidden, Value: bson.D{{Key: "$in", Value: bson.A{false, nil}}}}, } if page.Start != "" { @@ -338,7 +344,7 @@ func (m *MongoDB) CreateHash(ctx context.Context, module, version, hash string) { Key: "$push", Value: bson.D{ - {Key: "hashes", Value: newHash}, + {Key: fieldHashes, Value: newHash}, }, }, } @@ -411,7 +417,7 @@ func (m *MongoDB) GetHashByName(ctx context.Context, module, version string) (db filter := bson.D{ {Key: "name", Value: module}, - {Key: "hashes", Value: bson.D{ + {Key: fieldHashes, Value: bson.D{ {Key: "$elemMatch", Value: bson.D{ {Key: "name", Value: module + "@" + version}, }}, @@ -420,7 +426,7 @@ func (m *MongoDB) GetHashByName(ctx context.Context, module, version string) (db opts := &options.FindOneOptions{} opts.SetProjection(bson.D{ - {Key: "hashes", Value: 1}, + {Key: fieldHashes, Value: 1}, {Key: "_id", Value: 0}, }) diff --git a/pkg/db/mongodb/plugindb_test.go b/pkg/db/mongodb/plugindb_test.go index 2be20e2..03077fb 100644 --- a/pkg/db/mongodb/plugindb_test.go +++ b/pkg/db/mongodb/plugindb_test.go @@ -11,7 +11,6 @@ import ( "testing" "time" - "github.com/google/go-github/v74/github" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/traefik/plugin-service/pkg/db" @@ -40,7 +39,7 @@ func TestMongoDB_Create(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -90,7 +89,7 @@ func TestMongoDB_Get(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -202,7 +201,7 @@ func TestMongoDB_GetByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -228,7 +227,7 @@ func TestMongoDB_GetByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -283,7 +282,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -308,7 +307,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -333,7 +332,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -358,7 +357,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -383,7 +382,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -408,7 +407,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -433,7 +432,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -458,7 +457,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -483,7 +482,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -508,7 +507,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -533,7 +532,7 @@ func TestMongoDB_SearchByName(t *testing.T) { LatestVersion: "latestVersion", Versions: []string{"v1.0.0"}, Stars: 10, - Snippet: map[string]interface{}{ + Snippet: map[string]any{ "something": "there", }, CreatedAt: time.Now().Add(-2 * time.Hour), @@ -795,8 +794,8 @@ func TestMongoDB_UpdateHashVerified(t *testing.T) { }, Hashes: []db.PluginHash{ {Name: "plugin@v1.1.1", Hash: "123"}, - {Name: "plugin@v1.1.2", Hash: "123", Verified: github.Ptr(false)}, - {Name: "plugin@v1.1.3", Hash: "123", Verified: github.Ptr(true)}, + {Name: "plugin@v1.1.2", Hash: "123", Verified: new(false)}, + {Name: "plugin@v1.1.3", Hash: "123", Verified: new(true)}, }, }, }, @@ -809,7 +808,7 @@ func TestMongoDB_UpdateHashVerified(t *testing.T) { require.NoError(t, err) want := fixtures["plugin"].Hashes[0] - want.Verified = github.Ptr(true) + want.Verified = new(true) assert.Equal(t, want, got) @@ -817,7 +816,7 @@ func TestMongoDB_UpdateHashVerified(t *testing.T) { require.NoError(t, err) want = fixtures["plugin"].Hashes[1] - want.Verified = github.Ptr(true) + want.Verified = new(true) assert.Equal(t, want, got) @@ -825,7 +824,7 @@ func TestMongoDB_UpdateHashVerified(t *testing.T) { require.NoError(t, err) want = fixtures["plugin"].Hashes[2] - want.Verified = github.Ptr(false) + want.Verified = new(false) assert.Equal(t, want, got) @@ -837,9 +836,9 @@ func TestMongoDB_UpdateHashVerified(t *testing.T) { require.NoError(t, err) wantHashes := []db.PluginHash{ - {Name: "plugin@v1.1.1", Hash: "123", Verified: github.Ptr(true)}, - {Name: "plugin@v1.1.2", Hash: "123", Verified: github.Ptr(true)}, - {Name: "plugin@v1.1.3", Hash: "123", Verified: github.Ptr(false)}, + {Name: "plugin@v1.1.1", Hash: "123", Verified: new(true)}, + {Name: "plugin@v1.1.2", Hash: "123", Verified: new(true)}, + {Name: "plugin@v1.1.3", Hash: "123", Verified: new(false)}, } assert.Equal(t, wantHashes, pluginWithHashes.Hashes) } diff --git a/pkg/handlers/handlers_test.go b/pkg/handlers/handlers_test.go index 6b31f41..267a682 100644 --- a/pkg/handlers/handlers_test.go +++ b/pkg/handlers/handlers_test.go @@ -25,7 +25,7 @@ func TestHandlers_List(t *testing.T) { LatestVersion: "v0.2.1", Name: "github.com/traefik/plugindemo", Readme: "README", - Snippet: map[string]interface{}{"toml": "toml", "yaml": "yaml"}, + Snippet: map[string]any{"toml": "toml", "yaml": "yaml"}, Stars: 22, Summary: "[Demo] Add Request Header", Type: "middleware", @@ -41,7 +41,7 @@ func TestHandlers_List(t *testing.T) { LatestVersion: "v0.3.1", Name: "github.com/traefik/plugin-blockpath", Readme: "README", - Snippet: map[string]interface{}{"toml": "toml", "yaml": "yaml"}, + Snippet: map[string]any{"toml": "toml", "yaml": "yaml"}, Stars: 3, Summary: "Block Path plugin", Type: "middleware", @@ -81,7 +81,7 @@ func TestHandlers_List_GetByName(t *testing.T) { LatestVersion: "v0.2.1", Name: "github.com/traefik/plugindemo", Readme: "README", - Snippet: map[string]interface{}{"toml": "toml", "yaml": "yaml"}, + Snippet: map[string]any{"toml": "toml", "yaml": "yaml"}, Stars: 22, Summary: "[Demo] Add Request Header", Type: "middleware", @@ -119,7 +119,7 @@ func TestHandlers_List_GetByName_hidden(t *testing.T) { LatestVersion: "v0.2.1", Name: "github.com/traefik/plugindemo", Readme: "README", - Snippet: map[string]interface{}{"toml": "toml", "yaml": "yaml"}, + Snippet: map[string]any{"toml": "toml", "yaml": "yaml"}, Stars: 22, Summary: "[Demo] Add Request Header", Type: "middleware", @@ -169,7 +169,7 @@ func TestHandlers_List_SearchByName(t *testing.T) { LatestVersion: "v0.2.1", Name: "github.com/traefik/plugindemo", Readme: "README", - Snippet: map[string]interface{}{"toml": "toml", "yaml": "yaml"}, + Snippet: map[string]any{"toml": "toml", "yaml": "yaml"}, Stars: 22, Summary: "[Demo] Add Request Header", Type: "middleware", diff --git a/pkg/handlers/jsonerror.go b/pkg/handlers/jsonerror.go index d66a68c..fb4656c 100644 --- a/pkg/handlers/jsonerror.go +++ b/pkg/handlers/jsonerror.go @@ -13,7 +13,7 @@ type apiError struct { } // PanicHandler handles panics. -func PanicHandler(rw http.ResponseWriter, req *http.Request, err interface{}) { +func PanicHandler(rw http.ResponseWriter, req *http.Request, err any) { log.Error().Str("method", req.Method).Interface("url", req.URL).Interface("err", err). Msg("Panic error executing request") JSONError(rw, http.StatusInternalServerError, "panic") @@ -25,7 +25,7 @@ func JSONInternalServerError(rw http.ResponseWriter) { } // JSONErrorf handles an JSON error. -func JSONErrorf(rw http.ResponseWriter, code int, errMsg string, args ...interface{}) { +func JSONErrorf(rw http.ResponseWriter, code int, errMsg string, args ...any) { JSONError(rw, code, fmt.Sprintf(errMsg, args...)) } diff --git a/pkg/handlers/module.go b/pkg/handlers/module.go index e90f0e8..6dbf444 100644 --- a/pkg/handlers/module.go +++ b/pkg/handlers/module.go @@ -490,6 +490,7 @@ func (h Handlers) getArchiveLinkRequest(ctx context.Context, moduleName, version return nil, fmt.Errorf("failed to get archive link: %w", err) } + //nolint:gosec // G704: the URL is issued by the GitHub API, not by the caller. return http.NewRequestWithContext(ctx, http.MethodGet, link.String(), http.NoBody) }