Skip to content

Commit

Permalink
chore: Bump dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: jay-dee7 <[email protected]>
  • Loading branch information
jay-dee7 committed Oct 12, 2024
1 parent 1e2876d commit ee6fd2e
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 122 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ config.yml.bak
*.test
telemetry/*.yml
/.mock-fs
/.local
9 changes: 3 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
run:
timeout: 2m

skip-dirs:
- .go-skynet

linters-settings:
cyclop:
max-complexity: 16
gosec:
excludes:
- G114
lll:
line-length: 120
tab-width: 1

lll:
line-length: 120
tab-width: 1

linters:
enable:
Expand Down
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ const (
StoreKindPostgres StoreKind = "postgres"
StoreKindSQLite StoreKind = "sqlite"

MaxS3UploadParts int32 = 1000

MockStorageBackendMemMapped MockStorageBackend = iota + 1
MockStorageBackendFileBased
)
Expand Down
5 changes: 5 additions & 0 deletions dfs/filebase/filebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package filebase
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"time"
Expand Down Expand Up @@ -69,6 +70,10 @@ func (fb *filebase) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

ctx, cancel := context.WithTimeout(ctx, time.Minute*10)
defer cancel()

Expand Down
5 changes: 5 additions & 0 deletions dfs/ipfs/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package p2p
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -117,6 +118,10 @@ func (ipfs *ipfsP2p) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

session, ok := ipfs.uploadSession.Get(uploadId)
if !ok {
return s3types.CompletedPart{}, fmt.Errorf("UploadPart: multipart session not found")
Expand Down
5 changes: 5 additions & 0 deletions dfs/mock/memMappedSystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mock

import (
"context"
"errors"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -75,6 +76,10 @@ func (ms *memMappedMockStorage) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

if err := ms.validateLayerPrefix(layerKey); err != nil {
return s3types.CompletedPart{}, err
}
Expand Down
5 changes: 5 additions & 0 deletions dfs/mock/mockFileSystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mock

import (
"context"
"errors"
"fmt"
"io"
"net"
Expand Down Expand Up @@ -78,6 +79,10 @@ func (ms *fileBasedMockStorage) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

if err := ms.validateLayerPrefix(layerKey); err != nil {
return s3types.CompletedPart{}, err
}
Expand Down
5 changes: 5 additions & 0 deletions dfs/storj/storj.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package storj
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"time"
Expand Down Expand Up @@ -67,6 +68,10 @@ func (sj *storj) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

ctx, cancel := context.WithTimeout(ctx, time.Minute*10)
defer cancel()

Expand Down
10 changes: 10 additions & 0 deletions dfs/storj/uplink/uplink.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package uplink

import (
"context"
"errors"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -75,9 +76,18 @@ func (u *storjUplink) UploadPart(
content io.ReadSeeker,
contentLength int64,
) (s3types.CompletedPart, error) {
if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

ctx, cancel := context.WithTimeout(ctx, time.Minute*20)
defer cancel()

if partNumber > config.MaxS3UploadParts {
return s3types.CompletedPart{}, errors.New("ERR_TOO_MANY_PARTS")
}

//nolint:gosec
resp, err := u.client.UploadPart(ctx, u.bucket, key, uploadId, uint32(partNumber))
if err != nil {
return s3types.CompletedPart{}, err
Expand Down
105 changes: 53 additions & 52 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ toolchain go1.23.0
require (
github.com/alexliesenfeld/health v0.8.0
github.com/alphadose/haxmap v1.4.0
github.com/aws/aws-sdk-go-v2 v1.30.4
github.com/aws/aws-sdk-go-v2/config v1.27.31
github.com/aws/aws-sdk-go-v2/credentials v1.17.30
github.com/aws/aws-sdk-go-v2/service/s3 v1.61.0
github.com/aws/smithy-go v1.20.4
github.com/axiomhq/axiom-go v0.20.2
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.27.43
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
github.com/aws/aws-sdk-go-v2/service/s3 v1.65.3
github.com/aws/smithy-go v1.22.0
github.com/axiomhq/axiom-go v0.21.1
github.com/bradleyfalzon/ghinstallation/v2 v2.11.0
github.com/bufbuild/connect-go v1.10.0
github.com/fatih/color v1.17.0
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.22.0
github.com/go-playground/validator/v10 v10.22.1
github.com/go-webauthn/webauthn v0.11.2
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-github/v56 v56.0.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-multierror v1.1.1
github.com/honeycombio/otel-config-go v1.17.0
github.com/ipfs/boxo v0.22.0
github.com/ipfs/kubo v0.29.0
github.com/ipfs/boxo v0.24.0
github.com/ipfs/kubo v0.30.0
github.com/jackc/pgx/v4 v4.18.3
github.com/labstack/echo-contrib v0.17.1
github.com/labstack/echo-jwt/v4 v4.2.0
Expand All @@ -46,31 +46,31 @@ require (
github.com/uptrace/bun/extra/bundebug v1.2.3
github.com/urfave/cli/v2 v2.27.4
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.54.0
go.opentelemetry.io/contrib/processors/baggagecopy v0.1.0
go.opentelemetry.io/otel v1.29.0
golang.org/x/crypto v0.26.0
golang.org/x/net v0.28.0
golang.org/x/oauth2 v0.22.0
google.golang.org/protobuf v1.34.2
go.opentelemetry.io/contrib/processors/baggagecopy v0.3.0
go.opentelemetry.io/otel v1.30.0
golang.org/x/crypto v0.28.0
golang.org/x/net v0.30.0
golang.org/x/oauth2 v0.23.0
google.golang.org/protobuf v1.35.1
gopkg.in/yaml.v2 v2.4.0
storj.io/uplink v1.13.1
)

require (
github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.4 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect
github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.16 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.18 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.16 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/calebcase/tmpfile v1.0.3 // indirect
Expand All @@ -97,7 +97,7 @@ require (
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/go-tpm v0.9.1 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
Expand All @@ -109,15 +109,15 @@ require (
github.com/ipfs/go-datastore v0.6.0 // indirect
github.com/ipfs/go-ds-measure v0.2.0 // indirect
github.com/ipfs/go-fs-lock v0.0.7 // indirect
github.com/ipfs/go-ipfs-cmds v0.11.0 // indirect
github.com/ipfs/go-ipfs-cmds v0.13.0 // indirect
github.com/ipfs/go-ipfs-util v0.0.3 // indirect
github.com/ipfs/go-ipld-cbor v0.1.0 // indirect
github.com/ipfs/go-ipld-format v0.6.0 // indirect
github.com/ipfs/go-ipld-legacy v0.2.1 // indirect
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/ipfs/go-unixfsnode v1.9.0 // indirect
github.com/ipfs/go-unixfsnode v1.9.1 // indirect
github.com/ipld/go-car/v2 v2.13.1 // indirect
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
github.com/ipld/go-ipld-prime v0.21.0 // indirect
Expand All @@ -130,6 +130,7 @@ require (
github.com/jackc/pgtype v1.14.1 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jtolio/noiseconn v0.0.0-20230111204749-d7ec1a08b0b8 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
Expand All @@ -138,12 +139,12 @@ require (
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
github.com/libp2p/go-libp2p v0.36.1 // indirect
github.com/libp2p/go-libp2p v0.36.4 // indirect
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.25.2 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.26.1 // indirect
github.com/libp2p/go-libp2p-kbucket v0.6.3 // indirect
github.com/libp2p/go-libp2p-record v0.2.0 // indirect
github.com/libp2p/go-libp2p-routing-helpers v0.7.3 // indirect
github.com/libp2p/go-libp2p-routing-helpers v0.7.4 // indirect
github.com/libp2p/go-msgio v0.3.0 // indirect
github.com/libp2p/go-netroute v0.2.1 // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
Expand All @@ -158,7 +159,7 @@ require (
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-dns v0.4.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multicodec v0.9.0 // indirect
github.com/multiformats/go-multihash v0.2.3 // indirect
Expand All @@ -168,7 +169,7 @@ require (
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 // indirect
github.com/polydawn/refmt v0.89.0 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
Expand All @@ -182,7 +183,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/samber/lo v1.39.0 // indirect
github.com/samber/lo v1.46.0 // indirect
github.com/sendgrid/rest v2.6.9+incompatible // indirect
github.com/sethvargo/go-envconfig v1.1.0 // indirect
github.com/shirou/gopsutil/v4 v4.24.6 // indirect
Expand Down Expand Up @@ -211,35 +212,35 @@ require (
github.com/zeebo/errs v1.3.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/host v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.55.0 // indirect
go.opentelemetry.io/contrib/instrumentation/runtime v0.53.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.29.0 // indirect
go.opentelemetry.io/contrib/propagators/ot v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 // indirect
go.opentelemetry.io/otel/metric v1.29.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.30.0 // indirect
go.opentelemetry.io/otel/metric v1.30.0 // indirect
go.opentelemetry.io/otel/sdk v1.30.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.opentelemetry.io/otel/trace v1.30.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.6.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
golang.org/x/tools v0.25.0 // indirect
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
google.golang.org/grpc v1.66.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
Expand Down
Loading

0 comments on commit ee6fd2e

Please sign in to comment.