diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 17117b83cc4..71c069a2366 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -154,9 +154,6 @@ jobs: - name: Test manifest id: manifest run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-manifest - - name: Test authenticate - id: authenticate - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-authenticate; do echo "waiting for auth..."; sleep .3; done' - name: Test postage stamps id: postage-stamps run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-postage diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 4008e3a7b4e..83097774128 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -40,7 +40,7 @@ jobs: if: steps.checkdocs.outputs.build_docs == 'true' uses: acud/openapi-dockerized@v1 with: - build-roots: 'openapi/Swarm.yaml openapi/SwarmDebug.yaml' + build-roots: 'openapi/Swarm.yaml' env: AWS_ACCESS_KEY_ID: ${{ secrets.DO_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7d7edc9e0b4..75eec69aab7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -33,10 +33,9 @@ jobs: env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} - - name: Set the API and debug API versions + - name: Set the API version run: | echo "BEE_API_VERSION=$(grep '^ version:' openapi/Swarm.yaml | awk '{print $2}')" >> $GITHUB_ENV - echo "BEE_DEBUG_API_VERSION=$(grep '^ version:' openapi/SwarmDebug.yaml | awk '{print $2}')" >> $GITHUB_ENV - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: @@ -50,4 +49,3 @@ jobs: GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} BEE_API_VERSION: ${{ env.BEE_API_VERSION }} - BEE_DEBUG_API_VERSION: ${{ env.BEE_DEBUG_API_VERSION }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 0f8844cbfdc..d84f3b1e8cd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -19,7 +19,6 @@ builds: - -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }} - -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }} - -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }} - - -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }} env: - CGO_ENABLED=0 goos: @@ -43,7 +42,6 @@ builds: - -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }} - -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }} - -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }} - - -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }} env: - CGO_ENABLED=0 goos: @@ -69,7 +67,6 @@ builds: - -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }} - -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }} - -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }} - - -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }} env: - CGO_ENABLED=0 goos: @@ -89,7 +86,6 @@ builds: - -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }} - -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }} - -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }} - - -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }} env: - CGO_ENABLED=0 goos: @@ -108,7 +104,6 @@ builds: - -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }} - -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }} - -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }} - - -X github.com/ethersphere/bee/v2/pkg/debugapi.Version={{ .Env.BEE_DEBUG_API_VERSION }} env: - CGO_ENABLED=0 goos: diff --git a/CODING.md b/CODING.md index 98efe16e63f..f72712ee8fe 100644 --- a/CODING.md +++ b/CODING.md @@ -206,9 +206,9 @@ A value of `all` will enable the highest verbosity of V-level. Examples: -`curl -XPUT http://localhost:1635/loggers/bm9kZS8q/none` - will disable all loggers; `bm9kZS8q` is base64 encoded `node/*` regular expression. +`curl -XPUT http://localhost:1633/loggers/bm9kZS8q/none` - will disable all loggers; `bm9kZS8q` is base64 encoded `node/*` regular expression. -`curl -XPUT http://localhost:1635/loggers/bm9kZS9hcGlbMV1bXT4-ODI0NjM0OTMzMjU2/error` - will set the verbosity of the logger with the subsystem `node/api[1][]>>824634933256` to `error`. +`curl -XPUT http://localhost:1633/loggers/bm9kZS9hcGlbMV1bXT4-ODI0NjM0OTMzMjU2/error` - will set the verbosity of the logger with the subsystem `node/api[1][]>>824634933256` to `error`. ## Commit Messages diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba690740ec1..88973b5ffe2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,7 +35,7 @@ These are work items that are good if you're contributing to the codebase for th - Performance optimizations - The best way to propose any optimizations would be to provide the relevant data to describe the problem and then also the same data after the optimizations are done. Keep in mind, Bee nodes work in a distributed system, so changes that would seem good locally may not hold in some cases. The Bee client in debug mode can show you metrics as well as pprof information. This can be used to demonstrate the optimizations. + The best way to propose any optimizations would be to provide the relevant data to describe the problem and then also the same data after the optimizations are done. Keep in mind, Bee nodes work in a distributed system, so changes that would seem good locally may not hold in some cases. The Bee client can show you metrics as well as pprof information. This can be used to demonstrate the optimizations. - Concurrency related optimizations diff --git a/Dockerfile b/Dockerfile index 5aa35de1e8c..e0f0738de6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 AS build +FROM golang:1.22 AS build WORKDIR /src # enable modules caching in separate layer @@ -24,7 +24,7 @@ RUN mkdir -p /home/bee/.bee && chown 999:999 /home/bee/.bee COPY --from=build /src/dist/bee /usr/local/bin/bee -EXPOSE 1633 1634 1635 +EXPOSE 1633 1634 USER bee WORKDIR /home/bee VOLUME /home/bee/.bee diff --git a/Dockerfile.ci b/Dockerfile.ci index 2c12b44ad4a..b2f962ddc13 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -8,7 +8,7 @@ RUN addgroup --system bee --gid 998; \ COPY bee /bee -EXPOSE 1633 1634 1635 +EXPOSE 1633 1634 USER bee WORKDIR /home/bee diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index 907c29ed0ab..cd1fe90dc0d 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -14,7 +14,7 @@ RUN mkdir -p /home/bee/.bee && chown 999:999 /home/bee/.bee COPY bee /usr/local/bin/bee -EXPOSE 1633 1634 1635 +EXPOSE 1633 1634 USER bee WORKDIR /home/bee VOLUME /home/bee/.bee diff --git a/Dockerfile.scratch b/Dockerfile.scratch index 85905fd691b..40b0bec6c94 100644 --- a/Dockerfile.scratch +++ b/Dockerfile.scratch @@ -17,7 +17,7 @@ COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs COPY --from=0 /etc/passwd /etc/passwd COPY --from=0 /home /home -EXPOSE 1633 1634 1635 +EXPOSE 1633 1634 USER bee WORKDIR /home/bee VOLUME /home/bee/.bee diff --git a/Makefile b/Makefile index 46da4995b14..9aa79e4f9cd 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ REACHABILITY_OVERRIDE_PUBLIC ?= false BATCHFACTOR_OVERRIDE_PUBLIC ?= 5 BEE_API_VERSION ?= "$(shell grep '^ version:' openapi/Swarm.yaml | awk '{print $$2}')" -BEE_DEBUG_API_VERSION ?= "$(shell grep '^ version:' openapi/SwarmDebug.yaml | awk '{print $$2}')" VERSION ?= "$(shell git describe --tags --abbrev=0 | cut -c2-)" COMMIT_HASH ?= "$(shell git describe --long --dirty --always --match "" || true)" @@ -24,7 +23,6 @@ LDFLAGS ?= -s -w \ -X github.com/ethersphere/bee/v2.commitHash="$(COMMIT_HASH)" \ -X github.com/ethersphere/bee/v2.commitTime="$(COMMIT_TIME)" \ -X github.com/ethersphere/bee/v2/pkg/api.Version="$(BEE_API_VERSION)" \ --X github.com/ethersphere/bee/v2/pkg/api.DebugVersion="$(BEE_DEBUG_API_VERSION)" \ -X github.com/ethersphere/bee/v2/pkg/p2p/libp2p.reachabilityOverridePublic="$(REACHABILITY_OVERRIDE_PUBLIC)" \ -X github.com/ethersphere/bee/v2/pkg/postage/listener.batchFactorOverridePublic="$(BATCHFACTOR_OVERRIDE_PUBLIC)" diff --git a/README.md b/README.md index c5fb6fdf04c..c310e4fea89 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ [![codecov](https://codecov.io/gh/ethersphere/bee/branch/master/graph/badge.svg?token=63RNRLO3RU)](https://codecov.io/gh/ethersphere/bee) [![Go Report Card](https://goreportcard.com/badge/github.com/ethersphere/bee)](https://goreportcard.com/report/github.com/ethersphere/bee) [![API OpenAPI Specs](https://img.shields.io/badge/openapi-api-blue)](https://docs.ethswarm.org/api/) -[![Debug API OpenAPI Specs](https://img.shields.io/badge/openapi-debugapi-lightblue)](https://docs.ethswarm.org/debug-api/) ![Docker Pulls](https://img.shields.io/docker/pulls/ethersphere/bee) ![GitHub all releases](https://img.shields.io/github/downloads/ethersphere/bee/total) ![GitHub](https://img.shields.io/github/license/ethersphere/bee) @@ -27,7 +26,7 @@ There are two versioning schemes used in Bee that you should be aware of. The ma strict Semantic Versioning. Bee hosts different peer-to-peer wire protocol implementations and individual protocol breaking changes would necessitate a bump in the major part of the version. Breaking changes are expected with bumps of the minor version component. New (backward-compatible) features and bug fixes are expected with a bump of the patch component. Major version bumps are reserved for significant changes in Swarm's incentive structure. -The second set of versions that are important are the Bee's API versions (denoted in our [Bee](https://github.com/ethersphere/bee/blob/master/openapi/Swarm.yaml) and [Bee Debug](https://github.com/ethersphere/bee/blob/master/openapi/SwarmDebug.yaml) OpenAPI specifications). These versions **do follow** +The second is the Bee's API version (denoted in our [Bee](https://github.com/ethersphere/bee/blob/master/openapi/Swarm.yaml) OpenAPI specifications). This version **follows** Semantic Versioning and hence you should follow these for breaking changes. ## Contributing diff --git a/cmd/bee/cmd/bcrypt.go b/cmd/bee/cmd/bcrypt.go deleted file mode 100644 index 94c48a86d37..00000000000 --- a/cmd/bee/cmd/bcrypt.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmd - -import ( - "errors" - "fmt" - - "github.com/spf13/cobra" - "golang.org/x/crypto/bcrypt" -) - -func (c *command) initHasherCmd() (err error) { - cmd := &cobra.Command{ - Use: "bcrypt", - Short: "Generate or validate a bcrypt hash", - Long: `Generate or validate a bcrypt hash - -Takes a single plain text argument in order to generate a bcrypt hash. -If '--check' flag is provided it will validate the first (plain text) argument against -the second one, which is expected to be a quoted bcrypt hash.`, - Example: ` -$> bee bcrypt super$ecret -$2a$10$eZP5YuhJq2k8DFmj9UJGWOIjDtXu6NcAQMrz7Zj1bgIVBcHA3bU5u - -$> bee bcrypt --check super$ecret '$2a$10$eZP5YuhJq2k8DFmj9UJGWOIjDtXu6NcAQMrz7Zj1bgIVBcHA3bU5u' -OK: password hash matches provided plain text`, - RunE: func(cmd *cobra.Command, args []string) error { - if len(args) < 1 || len(args) > 2 { - return cmd.Help() - } - - isCheck := c.config.GetBool("check") - - if isCheck { - if len(args) != 2 { - fmt.Println("Usage:", "bee bcrypt", "--check", "your-plain-text-password", "'password-hash'") - return nil - } - - err := bcrypt.CompareHashAndPassword([]byte(args[1]), []byte(args[0])) - if err != nil { - return errors.New("password hash does not match provided plain text") - } - - fmt.Println("OK: password hash matches provided plain text") - return nil - } - - if len(args) != 1 { - return cmd.Help() - } - - hashed, err := bcrypt.GenerateFromPassword([]byte(args[0]), bcrypt.DefaultCost) - if err != nil { - return errors.New("failed to generate password hash") - } - - fmt.Print(string(hashed)) - return nil - }, - PreRunE: func(cmd *cobra.Command, args []string) error { - return c.config.BindPFlags(cmd.Flags()) - }, - } - - cmd.Flags().Bool("check", false, "validate existing hash") - - c.root.AddCommand(cmd) - return nil -} diff --git a/cmd/bee/cmd/cmd.go b/cmd/bee/cmd/cmd.go index e02e3ff6f3f..f6028e878ec 100644 --- a/cmd/bee/cmd/cmd.go +++ b/cmd/bee/cmd/cmd.go @@ -34,8 +34,6 @@ const ( optionNameP2PAddr = "p2p-addr" optionNameNATAddr = "nat-addr" optionNameP2PWSEnable = "p2p-ws-enable" - optionNameDebugAPIEnable = "debug-api-enable" - optionNameDebugAPIAddr = "debug-api-addr" optionNameBootnodes = "bootnode" optionNameNetworkID = "network-id" optionWelcomeMessage = "welcome-message" @@ -78,9 +76,6 @@ const ( optionNameStaticNodes = "static-nodes" optionNameAllowPrivateCIDRs = "allow-private-cidrs" optionNameSleepAfter = "sleep-after" - optionNameRestrictedAPI = "restricted" - optionNameTokenEncryptionKey = "token-encryption-key" - optionNameAdminPasswordHash = "admin-password" optionNameUsePostageSnapshot = "use-postage-snapshot" optionNameStorageIncentivesEnable = "storage-incentives-enable" optionNameStateStoreCacheCapacity = "statestore-cache-capacity" @@ -144,10 +139,6 @@ func newCommand(opts ...option) (c *command, err error) { return nil, err } - if err := c.initHasherCmd(); err != nil { - return nil, err - } - if err := c.initInitCmd(); err != nil { return nil, err } @@ -256,8 +247,6 @@ func (c *command) setAllFlags(cmd *cobra.Command) { cmd.Flags().String(optionNameNATAddr, "", "NAT exposed address") cmd.Flags().Bool(optionNameP2PWSEnable, false, "enable P2P WebSocket transport") cmd.Flags().StringSlice(optionNameBootnodes, []string{""}, "initial nodes to connect to") - cmd.Flags().Bool(optionNameDebugAPIEnable, false, "enable debug HTTP API") - cmd.Flags().String(optionNameDebugAPIAddr, ":1635", "debug HTTP API listen address") cmd.Flags().Uint64(optionNameNetworkID, chaincfg.Mainnet.NetworkID, "ID of the Swarm network") cmd.Flags().StringSlice(optionCORSAllowedOrigins, []string{}, "origins with CORS headers enabled") cmd.Flags().Bool(optionNameTracingEnabled, false, "enable tracing") @@ -297,9 +286,6 @@ func (c *command) setAllFlags(cmd *cobra.Command) { cmd.Flags().Bool(optionNamePProfMutex, false, "enable pprof mutex profile") cmd.Flags().StringSlice(optionNameStaticNodes, []string{}, "protect nodes from getting kicked out on bootnode") cmd.Flags().Bool(optionNameAllowPrivateCIDRs, false, "allow to advertise private CIDRs to the public network") - cmd.Flags().Bool(optionNameRestrictedAPI, false, "enable permission check on the http APIs") - cmd.Flags().String(optionNameTokenEncryptionKey, "", "admin username to get the security token") - cmd.Flags().String(optionNameAdminPasswordHash, "", "bcrypt hash of the admin password to get the security token") cmd.Flags().Bool(optionNameUsePostageSnapshot, false, "bootstrap node using postage snapshot from the network") cmd.Flags().Bool(optionNameStorageIncentivesEnable, true, "enable storage incentives feature") cmd.Flags().Uint64(optionNameStateStoreCacheCapacity, 100_000, "lru memory caching capacity in number of statestore entries") diff --git a/cmd/bee/cmd/start.go b/cmd/bee/cmd/start.go index c0378e52e2b..d4a39c99bd0 100644 --- a/cmd/bee/cmd/start.go +++ b/cmd/bee/cmd/start.go @@ -74,7 +74,6 @@ func (c *command) initStartCmd() (err error) { fmt.Print(beeWelcomeMessage) fmt.Printf("\n\nversion: %v - planned to be supported until %v, please follow https://ethswarm.org/\n\n", bee.Version, endSupportDate()) - fmt.Printf("DEPRECATION NOTICE:\nThe Debug API is deprecated and will be removed in the next release, version [2.2.0].\nPlease update your integrations to use the main Bee API to avoid service disruptions.\n\n") logger.Info("bee version", "version", bee.Version) go startTimeBomb(logger) @@ -215,11 +214,6 @@ func buildBeeNode(ctx context.Context, c *command, cmd *cobra.Command, logger lo } } - debugAPIAddr := c.config.GetString(optionNameDebugAPIAddr) - if !c.config.GetBool(optionNameDebugAPIEnable) { - debugAPIAddr = "" - } - signerConfig, err := c.configureSigner(cmd, logger) if err != nil { return nil, err @@ -302,7 +296,6 @@ func buildBeeNode(ctx context.Context, c *command, cmd *cobra.Command, logger lo DBWriteBufferSize: c.config.GetUint64(optionNameDBWriteBufferSize), DBDisableSeeksCompaction: c.config.GetBool(optionNameDBDisableSeeksCompaction), APIAddr: c.config.GetString(optionNameAPIAddr), - DebugAPIAddr: debugAPIAddr, Addr: c.config.GetString(optionNameP2PAddr), NATAddr: c.config.GetString(optionNameNATAddr), EnableWS: c.config.GetBool(optionNameP2PWSEnable), @@ -339,9 +332,6 @@ func buildBeeNode(ctx context.Context, c *command, cmd *cobra.Command, logger lo MutexProfile: c.config.GetBool(optionNamePProfMutex), StaticNodes: staticNodes, AllowPrivateCIDRs: c.config.GetBool(optionNameAllowPrivateCIDRs), - Restricted: c.config.GetBool(optionNameRestrictedAPI), - TokenEncryptionKey: c.config.GetString(optionNameTokenEncryptionKey), - AdminPasswordHash: c.config.GetString(optionNameAdminPasswordHash), UsePostageSnapshot: c.config.GetBool(optionNameUsePostageSnapshot), EnableStorageIncentives: c.config.GetBool(optionNameStorageIncentivesEnable), StatestoreCacheCapacity: c.config.GetUint64(optionNameStateStoreCacheCapacity), diff --git a/cmd/bee/cmd/start_dev.go b/cmd/bee/cmd/start_dev.go index a372094bf20..c53158daeaa 100644 --- a/cmd/bee/cmd/start_dev.go +++ b/cmd/bee/cmd/start_dev.go @@ -57,15 +57,9 @@ func (c *command) initStartDevCmd() (err error) { fmt.Println("Starting in development mode") fmt.Println() - debugAPIAddr := c.config.GetString(optionNameDebugAPIAddr) - if !c.config.GetBool(optionNameDebugAPIEnable) { - debugAPIAddr = "" - } - // generate signer in here b, err := node.NewDevBee(logger, &node.DevOptions{ APIAddr: c.config.GetString(optionNameAPIAddr), - DebugAPIAddr: debugAPIAddr, Logger: logger, DBOpenFilesLimit: c.config.GetUint64(optionNameDBOpenFilesLimit), DBBlockCacheCapacity: c.config.GetUint64(optionNameDBBlockCacheCapacity), @@ -73,9 +67,6 @@ func (c *command) initStartDevCmd() (err error) { DBDisableSeeksCompaction: c.config.GetBool(optionNameDBDisableSeeksCompaction), CORSAllowedOrigins: c.config.GetStringSlice(optionCORSAllowedOrigins), ReserveCapacity: c.config.GetUint64(optionNameDevReserveCapacity), - Restricted: c.config.GetBool(optionNameRestrictedAPI), - TokenEncryptionKey: c.config.GetString(optionNameTokenEncryptionKey), - AdminPasswordHash: c.config.GetString(optionNameAdminPasswordHash), }) if err != nil { return err @@ -140,9 +131,7 @@ func (c *command) initStartDevCmd() (err error) { }, } - cmd.Flags().Bool(optionNameDebugAPIEnable, true, "enable debug HTTP API") cmd.Flags().String(optionNameAPIAddr, ":1633", "HTTP API listen address") - cmd.Flags().String(optionNameDebugAPIAddr, ":1635", "debug HTTP API listen address") cmd.Flags().String(optionNameVerbosity, "info", "log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace") cmd.Flags().Uint64(optionNameDevReserveCapacity, 4194304, "cache reserve capacity") cmd.Flags().StringSlice(optionCORSAllowedOrigins, []string{}, "origins with CORS headers enabled") @@ -150,9 +139,6 @@ func (c *command) initStartDevCmd() (err error) { cmd.Flags().Uint64(optionNameDBBlockCacheCapacity, 32*1024*1024, "size of block cache of the database in bytes") cmd.Flags().Uint64(optionNameDBWriteBufferSize, 32*1024*1024, "size of the database write buffer in bytes") cmd.Flags().Bool(optionNameDBDisableSeeksCompaction, false, "disables db compactions triggered by seeks") - cmd.Flags().Bool(optionNameRestrictedAPI, false, "enable permission check on the http APIs") - cmd.Flags().String(optionNameTokenEncryptionKey, "", "security token encryption hash") - cmd.Flags().String(optionNameAdminPasswordHash, "$2a$10$Maw2HUQjcUINtqdnasOs1ee5MtQl7jxnkv2GqCGfbytAiCElzcbYC", "bcrypt hash of the admin password to get the security token") c.root.AddCommand(cmd) return nil diff --git a/go.mod b/go.mod index b3d4a7b6623..da46b1d2016 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,17 @@ module github.com/ethersphere/bee/v2 -go 1.21 +go 1.22 + +toolchain go1.22.0 require ( contrib.go.opencensus.io/exporter/prometheus v0.4.2 github.com/armon/go-radix v1.0.0 github.com/btcsuite/btcd/btcec/v2 v2.3.2 - github.com/casbin/casbin/v2 v2.35.0 github.com/coreos/go-semver v0.3.0 - github.com/ethereum/go-ethereum v1.13.4 + github.com/ethereum/go-ethereum v1.14.3 github.com/ethersphere/go-price-oracle-abi v0.2.0 - github.com/ethersphere/go-storage-incentives-abi v0.8.6-rc5 + github.com/ethersphere/go-storage-incentives-abi v0.8.6 github.com/ethersphere/go-sw3-abi v0.6.5 github.com/ethersphere/langos v1.0.0 github.com/go-playground/validator/v10 v10.11.1 @@ -43,12 +44,12 @@ require ( gitlab.com/nolash/go-mockbytes v0.0.7 go.uber.org/atomic v1.11.0 go.uber.org/goleak v1.3.0 - golang.org/x/crypto v0.19.0 + golang.org/x/crypto v0.23.0 golang.org/x/exp v0.0.0-20240213143201-ec583247a57a - golang.org/x/net v0.21.0 - golang.org/x/sync v0.6.0 - golang.org/x/sys v0.17.0 - golang.org/x/term v0.17.0 + golang.org/x/net v0.25.0 + golang.org/x/sync v0.7.0 + golang.org/x/sys v0.20.0 + golang.org/x/term v0.20.0 golang.org/x/time v0.5.0 gopkg.in/yaml.v2 v2.4.0 resenje.org/multex v0.1.0 @@ -58,12 +59,11 @@ require ( require ( github.com/BurntSushi/toml v1.1.0 // indirect - github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.7.0 // indirect + github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/codahale/hdrhistogram v0.0.0-00010101000000-000000000000 // indirect @@ -71,34 +71,32 @@ require ( github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/elastic/gosigar v0.14.2 // indirect - github.com/ethereum/c-kzg-4844 v0.3.1 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-ole/go-ole v1.2.5 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-stack/stack v1.8.1 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/holiman/uint256 v1.2.3 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/ipfs/go-log/v2 v2.5.1 // indirect @@ -166,10 +164,10 @@ require ( go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.18.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/tools v0.20.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.57.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect diff --git a/go.sum b/go.sum index f5e9509bbea..956c674a405 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,6 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/HdrHistogram/hdrhistogram-go v0.0.0-20200919145931-8dac23c8dac1 h1:nEjGZtKHMK92888VT6XkzKwyiW14v5FFRGeWq2uV7N0= github.com/HdrHistogram/hdrhistogram-go v0.0.0-20200919145931-8dac23c8dac1/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -116,8 +114,8 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= +github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= @@ -140,8 +138,6 @@ github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtE github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/casbin/casbin/v2 v2.35.0 h1:f0prVg9LgTJTihjAxWEZhfJptXvah1GpZh12sb5KXNA= -github.com/casbin/casbin/v2 v2.35.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= @@ -160,16 +156,14 @@ github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593 h1:aPEJyR4rPBvDmeyi+l/FS/VtA00IWvjeFvjen1m1l1A= -github.com/cockroachdb/pebble v0.0.0-20230928194634-aa077af62593/go.mod h1:6hk1eMY/u5t+Cf18q5lFMUA1Rc+Sm5I6Ra1QuPyxXCo= -github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= @@ -195,8 +189,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= -github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233 h1:d28BXYi+wUpz1KBmiF9bWrjEMacUEREV6MBi2ODnrfQ= +github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -233,22 +229,23 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg= -github.com/ethereum/c-kzg-4844 v0.3.1/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg= -github.com/ethereum/go-ethereum v1.13.4 h1:25HJnaWVg3q1O7Z62LaaI6S9wVq8QCw3K88g8wEzrcM= -github.com/ethereum/go-ethereum v1.13.4/go.mod h1:I0U5VewuuTzvBtVzKo7b3hJzDhXOUtn9mJW7SsIPB0Q= +github.com/ethereum/go-ethereum v1.14.3 h1:5zvnAqLtnCZrU9uod1JCvHWJbPMURzYFHfc2eHz4PHA= +github.com/ethereum/go-ethereum v1.14.3/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/ethersphere/go-price-oracle-abi v0.2.0 h1:wtIcYLgNZHY4BjYwJCnu93SvJdVAZVvBaKinspyyHvQ= github.com/ethersphere/go-price-oracle-abi v0.2.0/go.mod h1:sI/Qj4/zJ23/b1enzwMMv0/hLTpPNVNacEwCWjo6yBk= -github.com/ethersphere/go-storage-incentives-abi v0.8.6-rc5 h1:lW7p+KwAkCZbhoZIxYHfAJSqXHL02FXs1Su5WtevVrI= -github.com/ethersphere/go-storage-incentives-abi v0.8.6-rc5/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= +github.com/ethersphere/go-storage-incentives-abi v0.8.6 h1:M9WwEtWoxVHKehBAoPMzQhXlzlBetuXsrGgoFvM5I8Y= +github.com/ethersphere/go-storage-incentives-abi v0.8.6/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= github.com/ethersphere/go-sw3-abi v0.6.5 h1:M5dcIe1zQYvGpY2K07UNkNU9Obc4U+A1fz68Ho/Q+XE= github.com/ethersphere/go-sw3-abi v0.6.5/go.mod h1:BmpsvJ8idQZdYEtWnvxA8POYQ8Rl/NhyCdF0zLMOOJU= github.com/ethersphere/langos v1.0.0 h1:NBtNKzXTTRSue95uOlzPN4py7Aofs0xWPzyj4AI1Vcc= github.com/ethersphere/langos v1.0.0/go.mod h1:dlcN2j4O8sQ+BlCaxeBu43bgr4RQ+inJ+pHwLeZg5Tw= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= +github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= @@ -262,6 +259,10 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46 h1:BAIP2GihuqhwdILrV+7GJel5lyPV3u1+PgzrWLc0TkE= +github.com/gballet/go-verkle v0.1.1-0.20231031103413-a67434b50f46/go.mod h1:QNpY22eby74jVhqH4WhDLDwxc/vqsern6pW+u2kbkpc= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= @@ -284,8 +285,9 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -297,8 +299,6 @@ github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4 github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -332,8 +332,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -350,8 +348,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +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 v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -379,6 +377,8 @@ github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+u github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -448,13 +448,13 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= @@ -1003,8 +1003,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1043,8 +1043,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1097,8 +1097,8 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1121,8 +1121,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1198,17 +1198,18 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1217,8 +1218,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1278,10 +1279,9 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1384,8 +1384,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/openapi/Swarm.yaml b/openapi/Swarm.yaml index d4024534449..920710bafc4 100644 --- a/openapi/Swarm.yaml +++ b/openapi/Swarm.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: - version: 6.0.0 + version: 7.0.0 title: Bee API description: "A list of the currently provided Interfaces to interact with the swarm, implementing file operations and sending messages" @@ -31,193 +31,6 @@ servers: description: Service port provided in bee node config paths: - "/auth": - post: - summary: "Authenticate - This endpoint is experimental" - tags: - - Auth - security: - - basicAuth: [ ] - requestBody: - required: true - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SecurityTokenRequest" - responses: - "201": - description: Ok - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SecurityTokenResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "401": - $ref: "SwarmCommon.yaml#/components/responses/401" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/refresh": - post: - summary: "Refresh the auth token - This endpoint is experimental" - tags: - - Auth - security: - - bearerAuth: [ ] - requestBody: - required: true - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SecurityTokenRequest" - responses: - "201": - description: Ok - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SecurityTokenResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "401": - $ref: "SwarmCommon.yaml#/components/responses/401" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/grantee": - post: - summary: "Create grantee list" - tags: - - ACT - parameters: - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId" - name: swarm-postage-batch-id - required: true - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmTagParameter" - name: swarm-tag - required: false - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmPinParameter" - name: swarm-pin - required: false - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmDeferredUpload" - name: swarm-deferred-upload - required: false - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress" - name: swarm-act-history-address - required: false - requestBody: - required: true - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ActGranteesCreateRequest" - responses: - "201": - description: Ok - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ActGranteesOperationResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - - "/grantee/{reference}": - get: - summary: "Get grantee list" - tags: - - ACT - parameters: - - in: path - name: reference - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmEncryptedReference" - required: true - description: Grantee list reference - responses: - "200": - description: Ok - content: - application/json: - schema: - type: array - items: - $ref: "SwarmCommon.yaml#/components/schemas/PublicKey" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - patch: - summary: "Update grantee list" - description: "Add or remove grantees from an existing grantee list" - tags: - - ACT - parameters: - - in: path - name: reference - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmEncryptedReference" - required: true - description: Grantee list reference - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress" - name: swarm-act-history-address - required: true - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmPostageBatchId" - name: swarm-postage-batch-id - required: true - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmTagParameter" - name: swarm-tag - required: false - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmPinParameter" - name: swarm-pin - required: false - - in: header - schema: - $ref: "SwarmCommon.yaml#/components/parameters/SwarmDeferredUpload" - name: swarm-deferred-upload - required: false - requestBody: - required: true - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ActGranteesPatchRequest" - responses: - "200": - description: Ok - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ActGranteesOperationResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - "/bytes": post: summary: "Upload data" @@ -1089,7 +902,6 @@ paths: "/addresses": get: summary: Get overlay and underlay addresses of the node - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. tags: - Connectivity responses: @@ -1141,7 +953,6 @@ paths: "/balances": get: summary: Get the balances with all known peers including prepaid services - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1161,7 +972,6 @@ paths: "/balances/{address}": get: summary: Get the balances with a specific peer including prepaid services - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1190,7 +1000,6 @@ paths: "/blocklist": get: summary: Get a list of blocklisted peers - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1210,7 +1019,6 @@ paths: "/consumed": get: summary: Get the past due consumption balances with all known peers - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1230,7 +1038,6 @@ paths: "/consumed/{address}": get: summary: Get the past due consumption balance with a specific peer - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1259,7 +1066,6 @@ paths: "/chequebook/address": get: summary: Get the address of the chequebook contract used - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1275,7 +1081,6 @@ paths: "/chequebook/balance": get: summary: Get the balance of the chequebook - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1355,7 +1160,6 @@ paths: "/connect/{multiAddress}": post: summary: Connect to address - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1385,7 +1189,6 @@ paths: "/reservestate": get: summary: Get reserve state - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1403,7 +1206,6 @@ paths: "/chainstate": get: summary: Get chain state - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1421,7 +1223,6 @@ paths: "/node": get: summary: Get information about the node - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. tags: - Status responses: @@ -1437,7 +1238,6 @@ paths: "/peers": get: summary: Get a list of peers - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1455,7 +1255,6 @@ paths: "/peers/{address}": delete: summary: Remove peer - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1484,7 +1283,6 @@ paths: "/pingpong/{address}": post: summary: Try connection to node - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1515,7 +1313,6 @@ paths: "/settlements/{address}": get: summary: Get amount of sent and received from settlements with a peer - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1544,7 +1341,6 @@ paths: "/settlements": get: summary: Get settlements with all known peers and total amount sent or received - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1564,7 +1360,6 @@ paths: "/timesettlements": get: summary: Get time based settlements with all known peers and total amount sent or received - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1584,7 +1379,6 @@ paths: "/topology": get: summary: Get topology of known network - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1600,7 +1394,6 @@ paths: "/welcome-message": get: summary: Get configured P2P welcome message - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1618,7 +1411,6 @@ paths: description: Default response post: summary: Set P2P welcome message - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1645,7 +1437,6 @@ paths: "/chequebook/cashout/{peer-id}": get: summary: Get last cashout action for the peer - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] parameters: @@ -1672,7 +1463,6 @@ paths: description: Default response post: summary: Cashout the last cheque for the peer - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] parameters: @@ -1705,7 +1495,6 @@ paths: "/chequebook/cheque/{peer-id}": get: summary: Get last cheques for the peer - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] parameters: @@ -1734,7 +1523,6 @@ paths: "/chequebook/cheque": get: summary: Get last cheques for all peers - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1756,7 +1544,6 @@ paths: "/chequebook/deposit": post: summary: Deposit tokens from overlay address into chequebook - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] parameters: @@ -1786,7 +1573,6 @@ paths: "/chequebook/withdraw": post: summary: Withdraw tokens from the chequebook to the overlay address - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] parameters: @@ -1816,7 +1602,6 @@ paths: "/transactions": get: summary: Get list of pending transactions - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. tags: - Transaction responses: @@ -1834,7 +1619,6 @@ paths: "/transactions/{txHash}": get: summary: Get information about a sent transaction - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. parameters: - in: path name: txHash @@ -1859,7 +1643,6 @@ paths: description: Default response post: summary: Rebroadcast existing transaction - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. parameters: - in: path name: txHash @@ -1884,7 +1667,6 @@ paths: description: Default response delete: summary: Cancel existing transaction - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. parameters: - in: path name: txHash @@ -1912,7 +1694,6 @@ paths: "/stamps": get: summary: Get stamps for this node - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1940,7 +1721,6 @@ paths: description: Swarm address of the stamp get: summary: Get an individual postage batch status - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1969,7 +1749,6 @@ paths: description: Swarm address of the stamp get: summary: Get extended bucket data of a batch - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: @@ -1995,8 +1774,6 @@ paths: - bearerAuth: [ ] description: | Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! - - This endpoint can be restricted if the node is spawned with the `--restricted` flag. tags: - Postage Stamps parameters: @@ -2046,8 +1823,6 @@ paths: summary: Top up an existing postage batch. description: | Be aware, this endpoint creates on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! - - This endpoint can be restricted if the node is spawned with the `--restricted` flag. tags: - Postage Stamps parameters: @@ -2088,8 +1863,6 @@ paths: summary: Dilute an existing postage batch. description: | Be aware, this endpoint creates on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! - - This endpoint can be restricted if the node is spawned with the `--restricted` flag. tags: - Postage Stamps parameters: @@ -2126,7 +1899,6 @@ paths: "/batches": get: summary: Get all globally available batches that were purchased by all nodes. - description: This endpoint can be restricted if the node is spawned with the `--restricted` flag. security: - bearerAuth: [ ] tags: diff --git a/openapi/SwarmCommon.yaml b/openapi/SwarmCommon.yaml index 620f3ed8aff..8559a7c4e53 100644 --- a/openapi/SwarmCommon.yaml +++ b/openapi/SwarmCommon.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 3.2.7 + version: 3.2.8 title: Common Data Types description: | \*****bzzz***** @@ -469,10 +469,6 @@ components: type: string default: "0.0.0" description: The default value is set in case the bee binary was not build correctly. - debugApiVersion: - type: string - default: "0.0.0" - description: The default value is set in case the bee binary was not build correctly. PostageBatch: type: object diff --git a/openapi/SwarmDebug.yaml b/openapi/SwarmDebug.yaml deleted file mode 100644 index ff51a96300a..00000000000 --- a/openapi/SwarmDebug.yaml +++ /dev/null @@ -1,1173 +0,0 @@ -openapi: 3.0.3 -info: - version: 4.1.1 - title: Bee Debug API - description: "A list of the currently provided debug interfaces to interact with the bee node" - -security: - - {} - -externalDocs: - description: Browse the documentation @ the Swarm Docs - url: "https://docs.ethswarm.org" - -servers: - - url: "http://{apiRoot}:{port}" - variables: - apiRoot: - default: "localhost" - description: Base address of the local bee node debug API - port: - default: "1635" - description: Service port provided in bee node config - -paths: - "/addresses": - get: - summary: Get overlay and underlay addresses of the node - tags: - - Connectivity - responses: - "200": - description: Own node underlay and overlay addresses - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Addresses" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/accounting": - get: - summary: Get all accounting associated values with all known peers - tags: - - Balance - responses: - "200": - description: Own accounting associated values with all known peers - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/PeerAccountingData" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/balances": - get: - summary: Get the balances with all known peers including prepaid services - tags: - - Balance - responses: - "200": - description: Own balances with all known peers - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Balances" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/balances/{address}": - get: - summary: Get the balances with a specific peer including prepaid services - tags: - - Balance - parameters: - - in: path - name: address - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - responses: - "200": - description: Balance with the specific peer - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Balance" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/blocklist": - get: - summary: Get a list of blocklisted peers - tags: - - Connectivity - responses: - "200": - description: Returns overlay addresses of blocklisted peers - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Peers" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/consumed": - get: - summary: Get the past due consumption balances with all known peers - tags: - - Balance - responses: - "200": - description: Own past due consumption balances with all known peers - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Balances" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/consumed/{address}": - get: - summary: Get the past due consumption balance with a specific peer - tags: - - Balance - parameters: - - in: path - name: address - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - responses: - "200": - description: Past-due consumption balance with the specific peer - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Balance" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chequebook/address": - get: - summary: Get the address of the chequebook contract used - tags: - - Chequebook - responses: - "200": - description: Ethereum address of chequebook contract - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ChequebookAddress" - - "/chequebook/balance": - get: - summary: Get the balance of the chequebook - tags: - - Chequebook - responses: - "200": - description: Balance of the chequebook - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ChequebookBalance" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chunks/{address}": - get: - summary: Check if chunk at address exists locally - tags: - - Chunk - parameters: - - in: path - name: address - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of chunk - - $ref: "SwarmCommon.yaml#/components/parameters/SwarmActTimestamp" - - $ref: "SwarmCommon.yaml#/components/parameters/SwarmActPublisher" - - $ref: "SwarmCommon.yaml#/components/parameters/SwarmActHistoryAddress" - responses: - "200": - description: Chunk exists - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Response" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - default: - description: Default response - - "/connect/{multiAddress}": - post: - summary: Connect to address - tags: - - Connectivity - parameters: - - in: path - allowReserved: true - name: multiAddress - schema: - $ref: "SwarmCommon.yaml#/components/schemas/MultiAddress" - required: true - description: Underlay address of peer - responses: - "200": - description: Returns overlay address of connected peer - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Address" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/reservestate": - get: - summary: Get reserve state - tags: - - Status - responses: - "200": - description: Reserve State - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ReserveState" - default: - description: Default response - - "/chainstate": - get: - summary: Get chain state - tags: - - Status - responses: - "200": - description: Chain State - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ChainState" - default: - description: Default response - - "/node": - get: - summary: Get information about the node - tags: - - Status - responses: - "200": - description: Information about the node - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Node" - default: - description: Default response - - "/peers": - get: - summary: Get a list of peers - tags: - - Connectivity - responses: - "200": - description: Returns overlay addresses of connected peers - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Peers" - default: - description: Default response - - "/peers/{address}": - delete: - summary: Remove peer - tags: - - Connectivity - parameters: - - in: path - name: address - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - responses: - "200": - description: Disconnected peer - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Response" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/pingpong/{address}": - post: - summary: Try connection to node - tags: - - Connectivity - parameters: - - in: path - name: address - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - responses: - "200": - description: Returns round trip time for given peer - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/RttMs" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/health": - get: - summary: Get node overall health Status - description: | - Health Status will indicate node healthiness. - - If node is unhealthy please check node logs for errors. - tags: - - Status - responses: - "200": - description: Health Status of node - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/HealthStatus" - default: - description: Default response - - "/readiness": - get: - summary: Readiness endpoint indicates if node is ready to start accepting traffic - tags: - - Status - responses: - "200": - description: Indicates that node is ready - $ref: "SwarmCommon.yaml#/components/responses/200" - "400": - description: Indicates that node is not ready - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response - - "/settlements/{address}": - get: - summary: Get amount of sent and received from settlements with a peer - tags: - - Settlements - parameters: - - in: path - name: address - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - responses: - "200": - description: Amount of sent or received from settlements with a peer - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Settlement" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/settlements": - get: - summary: Get settlements with all known peers and total amount sent or received - tags: - - Settlements - responses: - "200": - description: Settlements with all known peers and total amount sent or received - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Settlements" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/timesettlements": - get: - summary: Get time based settlements with all known peers and total amount sent or received - tags: - - Settlements - responses: - "200": - description: Time based settlements with all known peers and total amount sent or received - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/Settlements" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/topology": - get: - description: Get topology of known network - tags: - - Connectivity - responses: - "200": - description: Swarm topology of the bee node - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BzzTopology" - - "/welcome-message": - get: - summary: Get configured P2P welcome message - tags: - - Connectivity - responses: - "200": - description: Welcome message - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/WelcomeMessage" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - post: - summary: Set P2P welcome message - tags: - - Connectivity - requestBody: - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/WelcomeMessage" - responses: - "200": - description: OK - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/HealthStatus" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chequebook/cashout/{peer-id}": - get: - summary: Get last cashout action for the peer - parameters: - - in: path - name: peer-id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - tags: - - Chequebook - responses: - "200": - description: Cashout status - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwapCashoutStatus" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - post: - summary: Cashout the last cheque for the peer - parameters: - - in: path - name: peer-id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" - - $ref: "SwarmCommon.yaml#/components/parameters/GasLimitParameter" - tags: - - Chequebook - responses: - "201": - description: OK - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionResponse" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "429": - $ref: "SwarmCommon.yaml#/components/responses/429" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chequebook/cheque/{peer-id}": - get: - summary: Get last cheques for the peer - parameters: - - in: path - name: peer-id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - required: true - description: Swarm address of peer - tags: - - Chequebook - responses: - "200": - description: Last cheques - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ChequePeerResponse" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chequebook/cheque": - get: - summary: Get last cheques for all peers - tags: - - Chequebook - responses: - "200": - description: Last cheques - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/ChequeAllPeersResponse" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chequebook/deposit": - post: - summary: Deposit tokens from overlay address into chequebook - parameters: - - in: query - name: amount - schema: - type: integer - required: true - description: amount of tokens to deposit - - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" - tags: - - Chequebook - responses: - "201": - description: Transaction hash of the deposit transaction - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/chequebook/withdraw": - post: - summary: Withdraw tokens from the chequebook to the overlay address - parameters: - - in: query - name: amount - schema: - type: integer - required: true - description: amount of tokens to withdraw - - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" - tags: - - Chequebook - responses: - "201": - description: Transaction hash of the withdraw transaction - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/redistributionstate": - get: - summary: Get current status of node in redistribution game - tags: - - RedistributionState - responses: - "200": - description: Redistribution status info - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/RedistributionStatusResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - "/wallet": - get: - summary: Get wallet balance for BZZ and xDai - tags: - - Wallet - responses: - "200": - description: Wallet balance info - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/WalletResponse" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - "/wallet/withdraw/{coin}": - post: - summary: Allows withdrawals of BZZ or xDAI to provided (whitelisted) address - tags: - - Wallet - parameters: - - in: query - name: amount - required: true - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BigInt" - - in: query - name: address - required: true - schema: - $ref: "SwarmCommon.yaml#/components/schemas/EthereumAddress" - - in: path - name: coin - required: true - schema: - $ref: "SwarmCommon.yaml#/components/schemas/SwarmAddress" - responses: - "200": - content: - application/json: - schema: - $ref: 'SwarmCommon.yaml#/components/schemas/WalletTxResponse' - description: OK - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - description: Amount greater than ballance or coin is other than BZZ/xDAI - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/transactions": - get: - summary: Get list of pending transactions - tags: - - Transaction - responses: - "200": - description: List of pending transactions - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/PendingTransactionsResponse" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/transactions/{txHash}": - get: - summary: Get information about a sent transaction - parameters: - - in: path - name: txHash - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionHash" - required: true - description: Hash of the transaction - tags: - - Transaction - responses: - "200": - description: Get info about transaction - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionInfo" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - post: - summary: Rebroadcast existing transaction - parameters: - - in: path - name: txHash - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionHash" - required: true - description: Hash of the transaction - tags: - - Transaction - responses: - "200": - description: Hash of the transaction - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionResponse" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - delete: - summary: Cancel existing transaction - parameters: - - in: path - name: txHash - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionHash" - required: true - description: Hash of the transaction - - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" - tags: - - Transaction - responses: - "200": - description: Hash of the transaction - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/TransactionResponse" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/stamps": - get: - summary: Get stamps for this node - tags: - - Postage Stamps - responses: - "200": - description: Returns an array of postage batches. - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/DebugPostageBatchesResponse" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - - default: - description: Default response - - "/stamps/{batch_id}": - parameters: - - in: path - name: batch_id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchID" - required: true - description: Swarm address of the stamp - get: - summary: Get an individual postage batch status - tags: - - Postage Stamps - responses: - "200": - description: Returns an individual postage batch state - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/DebugPostageBatch" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response - - "/stamps/{batch_id}/buckets": - parameters: - - in: path - name: batch_id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchID" - required: true - description: Swarm address of the stamp - get: - summary: Get extended bucket data of a batch - tags: - - Postage Stamps - responses: - "200": - description: Returns extended bucket data of the provided batch ID - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/PostageStampBuckets" - "404": - $ref: "SwarmCommon.yaml#/components/responses/404" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response - - "/stamps/{amount}/{depth}": - post: - summary: Buy a new postage batch. - description: Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! - tags: - - Postage Stamps - parameters: - - in: path - name: amount - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BigInt" - required: true - description: Amount of BZZ added that the postage batch will have. - - in: path - name: depth - schema: - type: integer - required: true - description: Batch depth which specifies how many chunks can be signed with the batch. It is a logarithm. Must be higher than default bucket depth (16) - - in: query - name: label - schema: - type: string - required: false - description: An optional label for this batch - - in: header - name: immutable - schema: - type: boolean - required: false - responses: - "201": - description: Returns the newly created postage batch ID - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchIDResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "429": - $ref: "SwarmCommon.yaml#/components/responses/429" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/stamps/topup/{batch_id}/{amount}": - patch: - summary: Top up an existing postage batch. - description: Be aware, this endpoint creates on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! - tags: - - Postage Stamps - parameters: - - in: path - name: batch_id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchID" - required: true - description: Batch ID to top up - - in: path - name: amount - schema: - type: integer - required: true - description: Amount of BZZ per chunk to top up to an existing postage batch. - responses: - "202": - description: Returns the postage batch ID that was topped up - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchIDResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "429": - $ref: "SwarmCommon.yaml#/components/responses/429" - "402": - $ref: "SwarmCommon.yaml#/components/responses/402" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/stamps/dilute/{batch_id}/{depth}": - patch: - summary: Dilute an existing postage batch. - description: Be aware, this endpoint creates on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance! - tags: - - Postage Stamps - parameters: - - in: path - name: batch_id - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchID" - required: true - description: Batch ID to dilute - - in: path - name: depth - schema: - type: integer - required: true - description: New batch depth. Must be higher than the previous depth. - responses: - "202": - description: Returns the postage batch ID that was diluted. - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/BatchIDResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "429": - $ref: "SwarmCommon.yaml#/components/responses/429" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/batches": - get: - summary: Get all globally available batches that were purchased by all nodes. - tags: - - Postage Stamps - responses: - "200": - description: Returns an array of all available and currently valid postage batches. - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/DebugPostageAllBatchesResponse" - - default: - description: Default response - - "/stake/{amount}": - post: - summary: Deposit some amount for staking. - description: Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance. - tags: - - Staking - parameters: - - in: path - name: amount - schema: - type: string - description: Amount of BZZ added that will be deposited for staking. - - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" - - $ref: "SwarmCommon.yaml#/components/parameters/GasLimitParameter" - responses: - "200": - $ref: "SwarmCommon.yaml#/components/schemas/StakeDepositResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/stake": - get: - summary: Get the staked amount. - description: This endpoint fetches the staked amount from the blockchain. - tags: - - Staking - responses: - "200": - $ref: "SwarmCommon.yaml#/components/schemas/GetStakeResponse" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - delete: - summary: Withdraw all staked amount. - description: Be aware, this endpoint creates an on-chain transactions and transfers BZZ from the node's Ethereum account and hence directly manipulates the wallet balance. - tags: - - Staking - parameters: - - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" - - $ref: "SwarmCommon.yaml#/components/parameters/GasLimitParameter" - responses: - "200": - $ref: "SwarmCommon.yaml#/components/schemas/WithdrawAllStakeResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - "500": - $ref: "SwarmCommon.yaml#/components/responses/500" - default: - description: Default response - - "/loggers": - get: - summary: Get all available loggers. - tags: - - Logging - responses: - "200": - description: Returns an array of all available loggers, also represented in short form in a tree. - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/LoggerResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response - - "/loggers/{exp}": - get: - summary: Get all available loggers that match the specified expression. - parameters: - - in: path - name: exp - schema: - $ref: "SwarmCommon.yaml#/components/schemas/LoggerExp" - required: true - description: Regular expression or a subsystem that matches the logger(s). - tags: - - Logging - responses: - "200": - description: Returns an array of all available loggers that matches given expression, also represented in short form in a tree. - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/LoggerResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response - put: - summary: Set logger(s) verbosity level. - parameters: - - in: path - name: exp - schema: - $ref: "SwarmCommon.yaml#/components/schemas/LoggerExp" - required: true - description: Regular expression or a subsystem that matches the logger(s). - tags: - - Logging - responses: - "200": - description: The verbosity was changed successfully. - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response - - "/status": - get: - summary: Get the current status snapshot of this node. - tags: - - Node Status - responses: - "200": - description: Returns the current node status snapshot. - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/StatusSnapshotResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response. - - "/status/peers": - get: - summary: Get the current status snapshot of this node connected peers. - tags: - - Node Status - responses: - "200": - description: Returns the status snapshot of this node connected peers - content: - application/json: - schema: - $ref: "SwarmCommon.yaml#/components/schemas/StatusResponse" - "400": - $ref: "SwarmCommon.yaml#/components/responses/400" - default: - description: Default response. diff --git a/packaging/bee.yaml b/packaging/bee.yaml index 560352926e1..6db6944b84c 100644 --- a/packaging/bee.yaml +++ b/packaging/bee.yaml @@ -24,10 +24,6 @@ data-dir: /var/lib/bee # db-write-buffer-size: 33554432 ## disables db compactions triggered by seeks # db-disable-seeks-compaction: false -## debug HTTP API listen address (default ":1635") -debug-api-addr: 127.0.0.1:1635 -## enable debug HTTP API -debug-api-enable: true ## cause the node to start in full mode # full-node: false ## NAT exposed address diff --git a/packaging/docker/README.md b/packaging/docker/README.md index cd95f1d131f..bce886018ae 100644 --- a/packaging/docker/README.md +++ b/packaging/docker/README.md @@ -43,7 +43,7 @@ docker-compose pull && docker-compose up -d ## Running multiple Bee nodes It is easy to run multiple bee nodes with docker compose by adding more services to `docker-compose.yaml` To do so, open `docker-compose.yaml`, copy lines 4-54 and past this after line 54 (whole bee-1 section). -In the copied lines, replace all occurrences of `bee-1` with `bee-2` and adjust the `API_ADDR` and `P2P_ADDR` and `DEBUG_API_ADDR` to respectively `1733`, `1734` and `127.0.0.1:1735` +In the copied lines, replace all occurrences of `bee-1` with `bee-2` and adjust the `API_ADDR` and `P2P_ADDR` to respectively `1733`, `1734.` Lastly, add your newly configured services under `volumes` (last lines), such that it looks like: ```yaml volumes: diff --git a/packaging/docker/docker-compose.yml b/packaging/docker/docker-compose.yml index f0b21be7701..56b6581d574 100644 --- a/packaging/docker/docker-compose.yml +++ b/packaging/docker/docker-compose.yml @@ -17,8 +17,6 @@ services: - BEE_DB_BLOCK_CACHE_CAPACITY - BEE_DB_WRITE_BUFFER_SIZE - BEE_DB_DISABLE_SEEKS_COMPACTION - - BEE_DEBUG_API_ADDR - - BEE_DEBUG_API_ENABLE - BEE_FULL_NODE - BEE_NAT_ADDR - BEE_NETWORK_ID @@ -48,7 +46,6 @@ services: ports: - "${API_ADDR:-1633}${BEE_API_ADDR:-:1633}" - "${P2P_ADDR:-1634}${BEE_P2P_ADDR:-:1634}" - - "${DEBUG_API_ADDR:-127.0.0.1:1635}${BEE_DEBUG_API_ADDR:-:1635}" volumes: - bee-1:/home/bee/.bee command: start diff --git a/packaging/docker/env b/packaging/docker/env index a9da56ae85e..f578f1ea9c9 100644 --- a/packaging/docker/env +++ b/packaging/docker/env @@ -26,10 +26,6 @@ # BEE_DB_WRITE_BUFFER_SIZE=33554432 ## disables db compactions triggered by seeks # BEE_DB_DISABLE_SEEKS_COMPACTION=false -## debug HTTP API listen address (default :1635) -# BEE_DEBUG_API_ADDR=:1635 -## enable debug HTTP API -# BEE_DEBUG_API_ENABLE=false ## enable global pinning ## cause the node to start in full mode # BEE_FULL_NODE=false diff --git a/packaging/homebrew-amd64/bee.yaml b/packaging/homebrew-amd64/bee.yaml index 235ad42e781..79470f1b7a4 100644 --- a/packaging/homebrew-amd64/bee.yaml +++ b/packaging/homebrew-amd64/bee.yaml @@ -24,10 +24,6 @@ data-dir: /usr/local/var/lib/swarm-bee # db-write-buffer-size: 33554432 ## disables db compactions triggered by seeks # db-disable-seeks-compaction: false -## debug HTTP API listen address (default ":1635") -debug-api-addr: 127.0.0.1:1635 -## enable debug HTTP API -debug-api-enable: true ## cause the node to start in full mode # full-node: false ## NAT exposed address diff --git a/packaging/homebrew-arm64/bee.yaml b/packaging/homebrew-arm64/bee.yaml index 212fadca581..5b52b272d31 100644 --- a/packaging/homebrew-arm64/bee.yaml +++ b/packaging/homebrew-arm64/bee.yaml @@ -24,10 +24,6 @@ data-dir: /opt/homebrew/var/lib/swarm-bee # db-write-buffer-size: 33554432 ## disables db compactions triggered by seeks # db-disable-seeks-compaction: false -## debug HTTP API listen address (default ":1635") -debug-api-addr: 127.0.0.1:1635 -## enable debug HTTP API -debug-api-enable: true ## cause the node to start in full mode # full-node: false ## NAT exposed address diff --git a/packaging/scoop/bee.yaml b/packaging/scoop/bee.yaml index 18c01229b2c..6efdc90bb20 100644 --- a/packaging/scoop/bee.yaml +++ b/packaging/scoop/bee.yaml @@ -14,10 +14,6 @@ config: ./bee.yaml data-dir: ./data ## cache capacity in chunks, multiply by 4096 to get approximate capacity in bytes # cache-capacity: 1000000 -## debug HTTP API listen address (default ":1635") -# debug-api-addr: 127.0.0.1:1635 -## enable debug HTTP API -# debug-api-enable: false ## cause the node to start in full mode # full-node: false ## NAT exposed address diff --git a/pkg/api/accounting_test.go b/pkg/api/accounting_test.go index 7a807aa811e..c2db87d2cdb 100644 --- a/pkg/api/accounting_test.go +++ b/pkg/api/accounting_test.go @@ -56,7 +56,6 @@ func TestAccountingInfo(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithPeerAccountingFunc(accountingFunc)}, }) @@ -112,7 +111,6 @@ func TestAccountingInfoError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithPeerAccountingFunc(accountingFunc)}, }) diff --git a/pkg/api/api.go b/pkg/api/api.go index 0d97a2abf0b..38f0aac866f 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -11,7 +11,6 @@ import ( "crypto/ecdsa" "encoding/base64" "encoding/hex" - "encoding/json" "errors" "fmt" "io" @@ -29,7 +28,6 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethersphere/bee/v2/pkg/accesscontrol" "github.com/ethersphere/bee/v2/pkg/accounting" - "github.com/ethersphere/bee/v2/pkg/auth" "github.com/ethersphere/bee/v2/pkg/crypto" "github.com/ethersphere/bee/v2/pkg/feeds" "github.com/ethersphere/bee/v2/pkg/file/pipeline" @@ -143,7 +141,6 @@ type PinIntegrity interface { } type Service struct { - auth auth.Authenticator storer Storer resolver resolver.Interface pss pss.Interface @@ -169,7 +166,6 @@ type Service struct { wsWg sync.WaitGroup // wait for all websockets to close on exit quit chan struct{} - // from debug API overlay *swarm.Address publicKey ecdsa.PublicKey pssPublicKey ecdsa.PublicKey @@ -236,7 +232,6 @@ func (s *Service) SetRedistributionAgent(redistributionAgent *storageincentives. type Options struct { CORSAllowedOrigins []string WsPingPeriod time.Duration - Restricted bool } type ExtraOptions struct { @@ -323,8 +318,7 @@ func New( } // Configure will create a and initialize a new API service. -func (s *Service) Configure(signer crypto.Signer, auth auth.Authenticator, tracer *tracing.Tracer, o Options, e ExtraOptions, chainID int64, erc20 erc20.Service) { - s.auth = auth +func (s *Service) Configure(signer crypto.Signer, tracer *tracing.Tracer, o Options, e ExtraOptions, chainID int64, erc20 erc20.Service) { s.signer = signer s.Options = o s.tracer = tracer @@ -440,119 +434,6 @@ func (s *Service) resolveNameOrAddress(str string) (swarm.Address, error) { return swarm.ZeroAddress, fmt.Errorf("%w: %w", errInvalidNameOrAddress, err) } -type securityTokenRsp struct { - Key string `json:"key"` -} - -type securityTokenReq struct { - Role string `json:"role"` - Expiry int `json:"expiry"` // duration in seconds -} - -func (s *Service) authHandler(w http.ResponseWriter, r *http.Request) { - _, pass, ok := r.BasicAuth() - - if !ok { - s.logger.Error(nil, "auth handler: missing basic auth") - w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`) - jsonhttp.Unauthorized(w, "Unauthorized") - return - } - - if !s.auth.Authorize(pass) { - s.logger.Error(nil, "auth handler: unauthorized") - w.Header().Set("WWW-Authenticate", `Basic realm="Restricted"`) - jsonhttp.Unauthorized(w, "Unauthorized") - return - } - - body, err := io.ReadAll(r.Body) - if err != nil { - s.logger.Debug("auth handler: read request body failed", "error", err) - s.logger.Error(nil, "auth handler: read request body failed") - jsonhttp.BadRequest(w, "Read request body") - return - } - - var payload securityTokenReq - if err = json.Unmarshal(body, &payload); err != nil { - s.logger.Debug("auth handler: unmarshal request body failed", "error", err) - s.logger.Error(nil, "auth handler: unmarshal request body failed") - jsonhttp.BadRequest(w, "Unmarshal json body") - return - } - - key, err := s.auth.GenerateKey(payload.Role, time.Duration(payload.Expiry)*time.Second) - if errors.Is(err, auth.ErrExpiry) { - s.logger.Debug("auth handler: generate key failed", "error", err) - s.logger.Error(nil, "auth handler: generate key failed") - jsonhttp.BadRequest(w, "Expiry duration must be a positive number") - return - } - if err != nil { - s.logger.Debug("auth handler: add auth token failed", "error", err) - s.logger.Error(nil, "auth handler: add auth token failed") - jsonhttp.InternalServerError(w, "Error generating authorization token") - return - } - - jsonhttp.Created(w, securityTokenRsp{ - Key: key, - }) -} - -func (s *Service) refreshHandler(w http.ResponseWriter, r *http.Request) { - reqToken := r.Header.Get(AuthorizationHeader) - if !strings.HasPrefix(reqToken, "Bearer ") { - jsonhttp.Forbidden(w, "Missing bearer token") - return - } - - keys := strings.Split(reqToken, "Bearer ") - - if len(keys) != 2 || strings.Trim(keys[1], " ") == "" { - jsonhttp.Forbidden(w, "Missing security token") - return - } - - authToken := keys[1] - - body, err := io.ReadAll(r.Body) - if err != nil { - s.logger.Debug("auth handler: read request body failed", "error", err) - s.logger.Error(nil, "auth handler: read request body failed") - jsonhttp.BadRequest(w, "Read request body") - return - } - - var payload securityTokenReq - if err = json.Unmarshal(body, &payload); err != nil { - s.logger.Debug("auth handler: unmarshal request body failed", "error", err) - s.logger.Error(nil, "auth handler: unmarshal request body failed") - jsonhttp.BadRequest(w, "Unmarshal json body") - return - } - - key, err := s.auth.RefreshKey(authToken, time.Duration(payload.Expiry)*time.Second) - if errors.Is(err, auth.ErrTokenExpired) { - s.logger.Debug("auth handler: refresh key failed", "error", err) - s.logger.Error(nil, "auth handler: refresh key failed") - jsonhttp.BadRequest(w, "Token expired") - return - } - - if err != nil { - s.logger.Debug("auth handler: refresh token failed", "error", err) - s.logger.Error(nil, "auth handler: refresh token failed") - jsonhttp.InternalServerError(w, "Error refreshing authorization token") - return - } - - jsonhttp.Created(w, securityTokenRsp{ - Key: key, - }) -} - func (s *Service) newTracingHandler(spanName string) func(h http.Handler) http.Handler { return func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -801,15 +682,11 @@ func (p *putterSessionWrapper) Put(ctx context.Context, chunk swarm.Chunk) error } func (p *putterSessionWrapper) Done(ref swarm.Address) error { - err := p.PutterSession.Done(ref) - if err != nil { - return err - } - return p.save() + return errors.Join(p.PutterSession.Done(ref), p.save()) } func (p *putterSessionWrapper) Cleanup() error { - return p.PutterSession.Cleanup() + return errors.Join(p.PutterSession.Cleanup(), p.save()) } func (s *Service) getStamper(batchID []byte) (postage.Stamper, func() error, error) { diff --git a/pkg/api/api_test.go b/pkg/api/api_test.go index 2e8ccbf5512..84634930599 100644 --- a/pkg/api/api_test.go +++ b/pkg/api/api_test.go @@ -27,8 +27,6 @@ import ( mockac "github.com/ethersphere/bee/v2/pkg/accesscontrol/mock" accountingmock "github.com/ethersphere/bee/v2/pkg/accounting/mock" "github.com/ethersphere/bee/v2/pkg/api" - "github.com/ethersphere/bee/v2/pkg/auth" - mockauth "github.com/ethersphere/bee/v2/pkg/auth/mock" "github.com/ethersphere/bee/v2/pkg/crypto" "github.com/ethersphere/bee/v2/pkg/feeds" "github.com/ethersphere/bee/v2/pkg/file/pipeline" @@ -107,9 +105,6 @@ type testServerOptions struct { AccessControl accesscontrol.Controller Steward steward.Interface WsHeaders http.Header - Authenticator auth.Authenticator - DebugAPI bool - Restricted bool DirectUpload bool Probe *api.Probe @@ -164,13 +159,7 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket. if o.SyncStatus == nil { o.SyncStatus = func() (bool, error) { return true, nil } } - if o.Authenticator == nil { - o.Authenticator = &mockauth.Auth{ - EnforceFunc: func(_, _, _ string) (bool, error) { - return true, nil - }, - } - } + var chanStore *chanStorer topologyDriver := topologymock.NewTopologyDriver(o.TopologyOpts...) @@ -237,17 +226,14 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket. }) testutil.CleanupCloser(t, tracerCloser) - s.Configure(signer, o.Authenticator, noOpTracer, api.Options{ + s.Configure(signer, noOpTracer, api.Options{ CORSAllowedOrigins: o.CORSAllowedOrigins, WsPingPeriod: o.WsPingPeriod, - Restricted: o.Restricted, }, extraOpts, 1, erc20) - if o.DebugAPI { - s.MountTechnicalDebug() - s.MountDebug() - } else { - s.MountAPI() - } + + s.MountTechnicalDebug() + s.MountDebug() + s.MountAPI() if o.DirectUpload { chanStore = newChanStore(o.Storer.PusherFeed()) @@ -258,21 +244,6 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket. t.Cleanup(ts.Close) var ( - httpClient = &http.Client{ - Transport: web.RoundTripperFunc(func(r *http.Request) (*http.Response, error) { - u, err := url.Parse(ts.URL + r.URL.String()) - if err != nil { - return nil, err - } - r.URL = u - return ts.Client().Transport.RoundTrip(r) - }), - } - conn *websocket.Conn - err error - ) - - if !o.DebugAPI { httpClient = &http.Client{ Transport: web.RoundTripperFunc(func(r *http.Request) (*http.Response, error) { requestURL := r.URL.String() @@ -294,7 +265,9 @@ func newTestServer(t *testing.T, o testServerOptions) (*http.Client, *websocket. return transport.RoundTrip(r) }), } - } + conn *websocket.Conn + err error + ) if o.WsPath != "" { u := url.URL{Scheme: "ws", Host: ts.Listener.Addr().String(), Path: o.WsPath} @@ -403,7 +376,7 @@ func TestParseName(t *testing.T) { signer := crypto.NewDefaultSigner(pk) s := api.New(pk.PublicKey, pk.PublicKey, common.Address{}, nil, log, nil, nil, 1, false, false, nil, []string{"*"}, inmemstore.New()) - s.Configure(signer, nil, nil, api.Options{}, api.ExtraOptions{Resolver: tC.res}, 1, nil) + s.Configure(signer, nil, api.Options{}, api.ExtraOptions{Resolver: tC.res}, 1, nil) s.MountAPI() tC := tC diff --git a/pkg/api/auth_test.go b/pkg/api/auth_test.go deleted file mode 100644 index f2cb0a99d59..00000000000 --- a/pkg/api/auth_test.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2021 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package api_test - -import ( - "errors" - "net/http" - "testing" - - "github.com/ethersphere/bee/v2/pkg/api" - "github.com/ethersphere/bee/v2/pkg/auth/mock" - "github.com/ethersphere/bee/v2/pkg/jsonhttp" - "github.com/ethersphere/bee/v2/pkg/jsonhttp/jsonhttptest" - "github.com/ethersphere/bee/v2/pkg/log" -) - -// nolint:paralleltest -func TestAuth(t *testing.T) { - var ( - resource = "/auth" - logger = log.Noop - authenticator = &mock.Auth{ - AuthorizeFunc: func(string) bool { return true }, - GenerateKeyFunc: func(string) (string, error) { return "123", nil }, - } - client, _, _, _ = newTestServer(t, testServerOptions{ - Logger: logger, - Restricted: true, - Authenticator: authenticator, - }) - ) - - t.Run("missing authorization header", func(t *testing.T) { - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusUnauthorized, - jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ - Message: "Unauthorized", - Code: http.StatusUnauthorized, - }), - ) - }) - t.Run("missing role", func(t *testing.T) { - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusBadRequest, - jsonhttptest.WithRequestHeader(api.AuthorizationHeader, "Basic dGVzdDp0ZXN0"), - jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ - Message: "Unmarshal json body", - Code: http.StatusBadRequest, - }), - ) - }) - t.Run("bad authorization header", func(t *testing.T) { - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusUnauthorized, - jsonhttptest.WithRequestHeader(api.AuthorizationHeader, "Basic dGV"), - jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ - Message: "Unauthorized", - Code: http.StatusUnauthorized, - }), - ) - }) - t.Run("bad request body", func(t *testing.T) { - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusBadRequest, - jsonhttptest.WithRequestHeader(api.AuthorizationHeader, "Basic dGVzdDp0ZXN0"), - - jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ - Message: "Unmarshal json body", - Code: http.StatusBadRequest, - }), - ) - }) - t.Run("unauthorized", func(t *testing.T) { - original := authenticator.AuthorizeFunc - authenticator.AuthorizeFunc = func(string) bool { return false } - defer func() { - authenticator.AuthorizeFunc = original - }() - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusUnauthorized, - jsonhttptest.WithRequestHeader(api.AuthorizationHeader, "Basic dGVzdDp0ZXN0"), - - jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ - Message: "Unauthorized", - Code: http.StatusUnauthorized, - }), - ) - }) - t.Run("failed to add key", func(t *testing.T) { - original := authenticator.GenerateKeyFunc - authenticator.GenerateKeyFunc = func(s string) (string, error) { - return "", errors.New("error adding key") - } - defer func() { - authenticator.GenerateKeyFunc = original - }() - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusInternalServerError, - jsonhttptest.WithRequestHeader(api.AuthorizationHeader, "Basic dGVzdDp0ZXN0"), - jsonhttptest.WithJSONRequestBody(api.SecurityTokenRequest{ - Role: "consumer", - }), - jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ - Message: "Error generating authorization token", - Code: http.StatusInternalServerError, - }), - ) - }) - t.Run("success", func(t *testing.T) { - jsonhttptest.Request(t, client, http.MethodPost, resource, http.StatusCreated, - jsonhttptest.WithRequestHeader(api.AuthorizationHeader, "Basic dGVzdDp0ZXN0"), - jsonhttptest.WithJSONRequestBody(api.SecurityTokenRequest{ - Role: "consumer", - }), - jsonhttptest.WithExpectedJSONResponse(api.SecurityTokenResponse{ - Key: "123", - }), - ) - }) -} diff --git a/pkg/api/balances_test.go b/pkg/api/balances_test.go index 174196d253a..d5434c3d3c8 100644 --- a/pkg/api/balances_test.go +++ b/pkg/api/balances_test.go @@ -32,7 +32,6 @@ func TestBalances(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalancesFunc(compensatedBalancesFunc)}, }) @@ -72,7 +71,6 @@ func TestBalancesError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalancesFunc(compensatedBalancesFunc)}, }) @@ -92,7 +90,6 @@ func TestBalancesPeers(t *testing.T) { return big.NewInt(100000000000000000), nil } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalanceFunc(compensatedBalanceFunc)}, }) @@ -113,7 +110,6 @@ func TestBalancesPeersError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalanceFunc(compensatedBalanceFunc)}, }) @@ -133,7 +129,6 @@ func TestBalancesPeersNoBalance(t *testing.T) { return nil, accounting.ErrPeerNoBalance } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithCompensatedBalanceFunc(compensatedBalanceFunc)}, }) @@ -186,7 +181,6 @@ func TestConsumedBalances(t *testing.T) { return ret, err } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalancesFunc(balancesFunc)}, }) @@ -227,7 +221,6 @@ func TestConsumedError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalancesFunc(balancesFunc)}, }) @@ -247,7 +240,6 @@ func TestConsumedPeers(t *testing.T) { return big.NewInt(1000000000000000000), nil } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalanceFunc(balanceFunc)}, }) @@ -268,7 +260,6 @@ func TestConsumedPeersError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalanceFunc(balanceFunc)}, }) @@ -288,7 +279,6 @@ func TestConsumedPeersNoBalance(t *testing.T) { return nil, accounting.ErrPeerNoBalance } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, AccountingOpts: []mock.Option{mock.WithBalanceFunc(balanceFunc)}, }) @@ -303,7 +293,7 @@ func TestConsumedPeersNoBalance(t *testing.T) { func Test_peerBalanceHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -352,7 +342,7 @@ func Test_peerBalanceHandler_invalidInputs(t *testing.T) { func Test_compensatedPeerBalanceHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/chequebook_test.go b/pkg/api/chequebook_test.go index b9b9cbdef32..e0276654d45 100644 --- a/pkg/api/chequebook_test.go +++ b/pkg/api/chequebook_test.go @@ -40,7 +40,6 @@ func TestChequebookBalance(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{ mock.WithChequebookBalanceFunc(chequebookBalanceFunc), mock.WithChequebookAvailableBalanceFunc(chequebookAvailableBalanceFunc), @@ -71,7 +70,6 @@ func TestChequebookBalanceError(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookBalanceFunc(chequebookBalanceFunc)}, }) @@ -95,7 +93,6 @@ func TestChequebookAvailableBalanceError(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{ mock.WithChequebookBalanceFunc(chequebookBalanceFunc), mock.WithChequebookAvailableBalanceFunc(chequebookAvailableBalanceFunc), @@ -118,7 +115,6 @@ func TestChequebookAddress(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookAddressFunc(chequebookAddressFunc)}, }) @@ -154,7 +150,6 @@ func TestChequebookWithdraw(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookWithdrawFunc(chequebookWithdrawFunc)}, }) @@ -184,7 +179,6 @@ func TestChequebookWithdraw(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookWithdrawFunc(chequebookWithdrawFunc)}, }) @@ -218,7 +212,6 @@ func TestChequebookDeposit(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookDepositFunc(chequebookDepositFunc)}, }) @@ -249,7 +242,6 @@ func TestChequebookDeposit(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, ChequebookOpts: []mock.Option{mock.WithChequebookDepositFunc(chequebookDepositFunc)}, }) @@ -358,7 +350,6 @@ func TestChequebookLastCheques(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithLastReceivedChequesFunc(lastReceivedChequesFunc), swapmock.WithLastSentChequesFunc(lastSentChequesFunc)}, }) @@ -472,7 +463,6 @@ func TestChequebookLastChequesPeer(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithLastReceivedChequeFunc(lastReceivedChequeFunc), swapmock.WithLastSentChequeFunc(lastSentChequeFunc)}, }) @@ -512,7 +502,6 @@ func TestChequebookCashout(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashChequeFunc(cashChequeFunc)}, }) @@ -543,7 +532,6 @@ func TestChequebookCashout_CustomGas(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashChequeFunc(cashChequeFunc)}, }) @@ -619,7 +607,6 @@ func TestChequebookCashoutStatus(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashoutStatusFunc(cashoutStatusFunc)}, }) @@ -667,7 +654,6 @@ func TestChequebookCashoutStatus(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashoutStatusFunc(cashoutStatusFunc)}, }) @@ -706,7 +692,6 @@ func TestChequebookCashoutStatus(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []swapmock.Option{swapmock.WithCashoutStatusFunc(cashoutStatusFunc)}, }) @@ -733,7 +718,7 @@ func TestChequebookCashoutStatus(t *testing.T) { func Test_chequebookLastPeerHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/debugstorage_test.go b/pkg/api/debugstorage_test.go index bb12a5585fd..14a669f6b10 100644 --- a/pkg/api/debugstorage_test.go +++ b/pkg/api/debugstorage_test.go @@ -35,8 +35,7 @@ func TestDebugStorage(t *testing.T) { } ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, - Storer: mockstorer.NewWithDebugInfo(want), + Storer: mockstorer.NewWithDebugInfo(want), }) jsonhttptest.Request(t, ts, http.MethodGet, "/debugstore", http.StatusOK, diff --git a/pkg/api/export_test.go b/pkg/api/export_test.go index fd78ae6974f..6c07c260479 100644 --- a/pkg/api/export_test.go +++ b/pkg/api/export_test.go @@ -18,8 +18,6 @@ type ( TagRequest = tagRequest ListTagsResponse = listTagsResponse IsRetrievableResponse = isRetrievableResponse - SecurityTokenResponse = securityTokenRsp - SecurityTokenRequest = securityTokenReq ) var ( diff --git a/pkg/api/health.go b/pkg/api/health.go index 33b6481b6ee..e153b9114f0 100644 --- a/pkg/api/health.go +++ b/pkg/api/health.go @@ -12,18 +12,16 @@ import ( ) type healthStatusResponse struct { - Status string `json:"status"` - Version string `json:"version"` - APIVersion string `json:"apiVersion"` - DebugAPIVersion string `json:"debugApiVersion"` + Status string `json:"status"` + Version string `json:"version"` + APIVersion string `json:"apiVersion"` } func (s *Service) healthHandler(w http.ResponseWriter, _ *http.Request) { status := s.probe.Healthy() jsonhttp.OK(w, healthStatusResponse{ - Status: status.String(), - Version: bee.Version, - APIVersion: Version, - DebugAPIVersion: DebugVersion, + Status: status.String(), + Version: bee.Version, + APIVersion: Version, }) } diff --git a/pkg/api/health_test.go b/pkg/api/health_test.go index 3446e167895..11c79f5366c 100644 --- a/pkg/api/health_test.go +++ b/pkg/api/health_test.go @@ -23,10 +23,9 @@ func TestHealth(t *testing.T) { // When probe is not set health endpoint should indicate that node is not healthy jsonhttptest.Request(t, testServer, http.MethodGet, "/health", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(api.HealthStatusResponse{ - Status: "nok", - Version: bee.Version, - APIVersion: api.Version, - DebugAPIVersion: api.Version, + Status: "nok", + Version: bee.Version, + APIVersion: api.Version, })) }) @@ -40,28 +39,25 @@ func TestHealth(t *testing.T) { // Current health probe is pending which should indicate that API is not healthy jsonhttptest.Request(t, testServer, http.MethodGet, "/health", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(api.HealthStatusResponse{ - Status: "nok", - Version: bee.Version, - APIVersion: api.Version, - DebugAPIVersion: api.Version, + Status: "nok", + Version: bee.Version, + APIVersion: api.Version, })) // When we set health probe to OK it should indicate that node is healthy probe.SetHealthy(api.ProbeStatusOK) jsonhttptest.Request(t, testServer, http.MethodGet, "/health", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(api.HealthStatusResponse{ - Status: "ok", - Version: bee.Version, - APIVersion: api.Version, - DebugAPIVersion: api.Version, + Status: "ok", + Version: bee.Version, + APIVersion: api.Version, })) // When we set health probe to NOK it should indicate that node is not healthy probe.SetHealthy(api.ProbeStatusNOK) jsonhttptest.Request(t, testServer, http.MethodGet, "/health", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(api.HealthStatusResponse{ - Status: "nok", - Version: bee.Version, - APIVersion: api.Version, - DebugAPIVersion: api.Version, + Status: "nok", + Version: bee.Version, + APIVersion: api.Version, })) }) } diff --git a/pkg/api/logger_test.go b/pkg/api/logger_test.go index b8420b79067..4a3349f6681 100644 --- a/pkg/api/logger_test.go +++ b/pkg/api/logger_test.go @@ -72,7 +72,7 @@ func TestGetLoggers(t *testing.T) { t.Fatalf("unexpected error: %v", err) } - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) jsonhttptest.Request(t, client, http.MethodGet, "/loggers", http.StatusOK, jsonhttptest.WithUnmarshalJSONResponse(&have), ) @@ -88,7 +88,7 @@ func TestSetLoggerVerbosity(t *testing.T) { api.ReplaceLogSetVerbosityByExp(fn) }(api.LogSetVerbosityByExp) - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) type data struct { exp string @@ -143,7 +143,7 @@ func TestSetLoggerVerbosity(t *testing.T) { func Test_loggerGetHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -192,7 +192,7 @@ func Test_loggerGetHandler_invalidInputs(t *testing.T) { func Test_loggerSetVerbosityHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/p2p_test.go b/pkg/api/p2p_test.go index 5cf9de6124c..933596afff7 100644 --- a/pkg/api/p2p_test.go +++ b/pkg/api/p2p_test.go @@ -40,7 +40,6 @@ func TestAddresses(t *testing.T) { ethereumAddress := common.HexToAddress("abcd") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PublicKey: privateKey.PublicKey, PSSPublicKey: pssPrivateKey.PublicKey, Overlay: overlay, @@ -79,7 +78,6 @@ func TestAddresses_error(t *testing.T) { testErr := errors.New("test error") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithAddressesFunc(func() ([]multiaddr.Multiaddr, error) { return nil, testErr })), diff --git a/pkg/api/peer_test.go b/pkg/api/peer_test.go index 0697a6277d2..fdda7b8edf4 100644 --- a/pkg/api/peer_test.go +++ b/pkg/api/peer_test.go @@ -51,7 +51,6 @@ func TestConnect(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithConnectFunc(func(ctx context.Context, addr ma.Multiaddr) (*bzz.Address, error) { if addr.String() == errorUnderlay { return nil, testErr @@ -82,7 +81,6 @@ func TestConnect(t *testing.T) { t.Run("error - add peer", func(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithConnectFunc(func(ctx context.Context, addr ma.Multiaddr) (*bzz.Address, error) { if addr.String() == errorUnderlay { return nil, testErr @@ -109,7 +107,6 @@ func TestDisconnect(t *testing.T) { testErr := errors.New("test error") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithDisconnectFunc(func(addr swarm.Address, reason string) error { if reason != "user requested disconnect" { return testErr @@ -166,7 +163,6 @@ func TestPeer(t *testing.T) { overlay := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithPeersFunc(func() []p2p.Peer { return []p2p.Peer{{Address: overlay}} })), @@ -188,7 +184,6 @@ func TestBlocklistedPeers(t *testing.T) { overlay := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithBlocklistedPeersFunc(func() ([]p2p.BlockListedPeer, error) { return []p2p.BlockListedPeer{{Peer: p2p.Peer{Address: overlay}}}, nil })), @@ -206,7 +201,6 @@ func TestBlocklistedPeersErr(t *testing.T) { overlay := swarm.MustParseHexAddress("ca1e9f3938cc1425c6061b96ad9eb93e134dfe8734ad490164ef20af9d1cf59c") testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithBlocklistedPeersFunc(func() ([]p2p.BlockListedPeer, error) { return []p2p.BlockListedPeer{{Peer: p2p.Peer{Address: overlay}}}, errors.New("some error") })), @@ -224,7 +218,7 @@ func TestBlocklistedPeersErr(t *testing.T) { func Test_peerConnectHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -260,7 +254,7 @@ func Test_peerConnectHandler_invalidInputs(t *testing.T) { func Test_peerDisconnectHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/pingpong_test.go b/pkg/api/pingpong_test.go index 4dffae5b0e6..9de99103619 100644 --- a/pkg/api/pingpong_test.go +++ b/pkg/api/pingpong_test.go @@ -39,7 +39,6 @@ func TestPingpong(t *testing.T) { }) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, Pingpong: pingpongService, }) @@ -79,7 +78,7 @@ func TestPingpong(t *testing.T) { func Test_pingpongHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/postage_test.go b/pkg/api/postage_test.go index ebf808c1c7a..13e3dda13d6 100644 --- a/pkg/api/postage_test.go +++ b/pkg/api/postage_test.go @@ -65,7 +65,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -90,7 +89,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -111,7 +109,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -132,7 +129,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -161,7 +157,6 @@ func TestPostageCreateStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -182,7 +177,6 @@ func TestPostageCreateStamp(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SyncStatus: func() (bool, error) { return false, nil }, }) @@ -197,7 +191,6 @@ func TestPostageCreateStamp(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SyncStatus: func() (bool, error) { return true, errors.New("oops") }, }) @@ -223,7 +216,7 @@ func TestPostageGetStamps(t *testing.T) { t.Parallel() bs := mock.New(mock.WithChainState(cs), mock.WithBatch(b)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) jsonhttptest.Request(t, ts, http.MethodGet, "/stamps", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(&api.PostageStampsResponse{ @@ -259,7 +252,7 @@ func TestPostageGetStamps(t *testing.T) { } ecs := &postage.ChainState{Block: 10, TotalAmount: big.NewInt(15), CurrentPrice: big.NewInt(12)} ebs := mock.New(mock.WithChainState(ecs)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: emp, BatchStore: ebs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: emp, BatchStore: ebs, BlockTime: 2 * time.Second}) jsonhttptest.Request(t, ts, http.MethodGet, "/stamps/"+hex.EncodeToString(eb.ID), http.StatusNotFound, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{ @@ -281,7 +274,7 @@ func TestGetAllBatches(t *testing.T) { mp := mockpost.New(mockpost.WithIssuer(si)) cs := &postage.ChainState{Block: 10, TotalAmount: big.NewInt(5), CurrentPrice: big.NewInt(2)} bs := mock.New(mock.WithChainState(cs), mock.WithBatch(b)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) oneBatch := struct { Batches []api.PostageBatchResponse `json:"batches"` @@ -318,7 +311,7 @@ func TestPostageGetStamp(t *testing.T) { mp := mockpost.New(mockpost.WithIssuer(si)) cs := &postage.ChainState{Block: 10, TotalAmount: big.NewInt(5), CurrentPrice: big.NewInt(2)} bs := mock.New(mock.WithChainState(cs), mock.WithBatch(b)) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, BatchStore: bs, BlockTime: 2 * time.Second}) t.Run("ok", func(t *testing.T) { t.Parallel() @@ -346,7 +339,7 @@ func TestPostageGetBuckets(t *testing.T) { si := postage.NewStampIssuer("", "", batchOk, big.NewInt(3), 11, 10, 1000, true) mp := mockpost.New(mockpost.WithIssuer(si)) - ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp, DebugAPI: true}) + ts, _, _, _ := newTestServer(t, testServerOptions{Post: mp}) buckets := make([]api.BucketData, 1024) for i := range buckets { buckets[i] = api.BucketData{BucketID: uint32(i)} @@ -369,7 +362,7 @@ func TestPostageGetBuckets(t *testing.T) { t.Parallel() mpNotFound := mockpost.New() - tsNotFound, _, _, _ := newTestServer(t, testServerOptions{Post: mpNotFound, DebugAPI: true}) + tsNotFound, _, _, _ := newTestServer(t, testServerOptions{Post: mpNotFound}) jsonhttptest.Request(t, tsNotFound, http.MethodGet, "/stamps/"+batchOkStr+"/buckets", http.StatusNotFound) }) @@ -383,7 +376,6 @@ func TestReserveState(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BatchStore: mock.New(mock.WithRadius(5)), Storer: mockstorer.New(), }) @@ -397,7 +389,6 @@ func TestReserveState(t *testing.T) { t.Parallel() ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BatchStore: mock.New(), Storer: mockstorer.New(), }) @@ -418,7 +409,6 @@ func TestChainState(t *testing.T) { CurrentPrice: big.NewInt(5), } ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BatchStore: mock.New(mock.WithChainState(cs)), BackendOpts: []backendmock.Option{backendmock.WithBlockNumberFunc(func(ctx context.Context) (uint64, error) { return 1, nil @@ -460,7 +450,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -490,7 +479,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -512,7 +500,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -533,7 +520,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -557,7 +543,6 @@ func TestPostageTopUpStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -595,7 +580,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -625,7 +609,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -647,7 +630,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -668,7 +650,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -692,7 +673,6 @@ func TestPostageDiluteStamp(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -812,7 +792,6 @@ func TestPostageAccessHandler(t *testing.T) { ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, PostageContract: contract, }) @@ -837,7 +816,7 @@ func TestPostageAccessHandler(t *testing.T) { func Test_postageCreateHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -887,7 +866,7 @@ func Test_postageCreateHandler_invalidInputs(t *testing.T) { func Test_postageGetStampBucketsHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -949,7 +928,7 @@ func Test_postageGetStampBucketsHandler_invalidInputs(t *testing.T) { func Test_postageGetStampHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -1012,7 +991,7 @@ func Test_postageGetStampHandler_invalidInputs(t *testing.T) { func Test_postageTopUpHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -1091,7 +1070,7 @@ func Test_postageTopUpHandler_invalidInputs(t *testing.T) { func Test_postageDiluteHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string diff --git a/pkg/api/redistribution_test.go b/pkg/api/redistribution_test.go index 88bf00abe51..07b4bc28cfe 100644 --- a/pkg/api/redistribution_test.go +++ b/pkg/api/redistribution_test.go @@ -36,7 +36,6 @@ func TestRedistributionStatus(t *testing.T) { t.Errorf("redistribution put state: %v", err) } srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, StateStorer: store, TransactionOpts: []mock.Option{ mock.WithTransactionFeeFunc(func(ctx context.Context, txHash common.Hash) (*big.Int, error) { @@ -61,7 +60,6 @@ func TestRedistributionStatus(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BeeMode: api.LightMode, StateStorer: statestore.NewStateStore(), TransactionOpts: []mock.Option{ diff --git a/pkg/api/router.go b/pkg/api/router.go index 609ffff573e..19f4b4fbd04 100644 --- a/pkg/api/router.go +++ b/pkg/api/router.go @@ -11,7 +11,6 @@ import ( "net/http/pprof" "strings" - "github.com/ethersphere/bee/v2/pkg/auth" "github.com/ethersphere/bee/v2/pkg/jsonhttp" "github.com/ethersphere/bee/v2/pkg/log/httpaccess" "github.com/ethersphere/bee/v2/pkg/swarm" @@ -34,7 +33,7 @@ func (s *Service) MountTechnicalDebug() { s.mountTechnicalDebug() s.Handler = web.ChainHandlers( - httpaccess.NewHTTPAccessLogHandler(s.logger, s.tracer, "debug api access"), + httpaccess.NewHTTPAccessLogHandler(s.logger, s.tracer, "api access"), handlers.CompressHandler, s.corsHandler, web.NoCacheHeadersHandler, @@ -46,7 +45,7 @@ func (s *Service) MountDebug() { s.mountBusinessDebug() s.Handler = web.ChainHandlers( - httpaccess.NewHTTPAccessLogHandler(s.logger, s.tracer, "debug api access"), + httpaccess.NewHTTPAccessLogHandler(s.logger, s.tracer, "api access"), handlers.CompressHandler, s.corsHandler, web.NoCacheHeadersHandler, @@ -142,11 +141,7 @@ func (s *Service) mountTechnicalDebug() { s.router.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol)) s.router.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace)) - pprofRootHandlerF := pprof.Index - if s.Restricted { - pprofRootHandlerF = web.ChainHandlers(auth.PermissionCheckHandler(s.auth), web.FinalHandler(http.HandlerFunc(pprof.Index))).ServeHTTP - } - s.router.PathPrefix("/debug/pprof/").Handler(http.HandlerFunc(pprofRootHandlerF)) + s.router.PathPrefix("/debug/pprof/").Handler(http.HandlerFunc(pprof.Index)) s.router.Handle("/debug/vars", expvar.Handler()) s.router.Handle("/loggers", jsonhttp.MethodHandler{ @@ -376,29 +371,10 @@ func (s *Service) mountAPI() { httpaccess.NewHTTPAccessSuppressLogHandler(), web.FinalHandlerFunc(s.healthHandler), )) - - if s.Restricted { - handle("/auth", jsonhttp.MethodHandler{ - "POST": web.ChainHandlers( - jsonhttp.NewMaxBodyBytesHandler(512), - web.FinalHandlerFunc(s.authHandler), - ), - }) - handle("/refresh", jsonhttp.MethodHandler{ - "POST": web.ChainHandlers( - jsonhttp.NewMaxBodyBytesHandler(512), - web.FinalHandlerFunc(s.refreshHandler), - ), - }) - } } func (s *Service) mountBusinessDebug() { handle := func(path string, handler http.Handler) { - s.logger.Warning("DEPRECATION NOTICE: This endpoint is now part of the main Bee API. The Debug API will be removed in the next release, version [2.2.0]. Update your integrations to use the main Bee API to avoid service disruptions.") - if s.Restricted { - handler = web.ChainHandlers(auth.PermissionCheckHandler(s.auth), web.FinalHandler(handler)) - } s.router.Handle(path, handler) s.router.Handle(rootPath+path, handler) } @@ -438,12 +414,9 @@ func (s *Service) mountBusinessDebug() { "DELETE": http.HandlerFunc(s.peerDisconnectHandler), }) - handle("/chunks/{address}", jsonhttp.MethodHandler{ - "GET": web.ChainHandlers( - s.actDecryptionHandler(), - web.FinalHandlerFunc(s.hasChunkHandler), - ), - }) + //handle("/chunks/{address}", jsonhttp.MethodHandler{ + // "GET": http.HandlerFunc(s.hasChunkHandler), + //}) handle("/topology", jsonhttp.MethodHandler{ "GET": http.HandlerFunc(s.topologyHandler), diff --git a/pkg/api/settlements_test.go b/pkg/api/settlements_test.go index 86f2e2e42e1..f76997e1b8c 100644 --- a/pkg/api/settlements_test.go +++ b/pkg/api/settlements_test.go @@ -39,7 +39,6 @@ func TestSettlements(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementsSentFunc(settlementsSentFunc), mock.WithSettlementsRecvFunc(settlementsRecvFunc)}, }) @@ -90,7 +89,6 @@ func TestSettlementsError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementsSentFunc(settlementsSentFunc)}, }) @@ -110,7 +108,6 @@ func TestSettlementsPeers(t *testing.T) { return big.NewInt(1000000000000000000), nil } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementSentFunc(settlementSentFunc)}, }) @@ -138,7 +135,6 @@ func TestSettlementsPeersNoSettlements(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{ mock.WithSettlementSentFunc(errFunc), mock.WithSettlementRecvFunc(noErrFunc), @@ -158,7 +154,6 @@ func TestSettlementsPeersNoSettlements(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{ mock.WithSettlementSentFunc(noErrFunc), mock.WithSettlementRecvFunc(errFunc), @@ -178,7 +173,7 @@ func TestSettlementsPeersNoSettlements(t *testing.T) { func Test_peerSettlementsHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -233,7 +228,6 @@ func TestSettlementsPeersError(t *testing.T) { return nil, wantErr } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, SwapOpts: []mock.Option{mock.WithSettlementSentFunc(settlementSentFunc)}, }) diff --git a/pkg/api/staking_test.go b/pkg/api/staking_test.go index e6f4d0b2296..0d6dac27587 100644 --- a/pkg/api/staking_test.go +++ b/pkg/api/staking_test.go @@ -39,7 +39,7 @@ func TestDepositStake(t *testing.T) { return txHash, nil }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(minStake), http.StatusOK) }) @@ -52,7 +52,7 @@ func TestDepositStake(t *testing.T) { return common.Hash{}, staking.ErrInsufficientStakeAmount }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(invalidMinStake), http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusBadRequest, Message: "insufficient stake amount"})) }) @@ -65,7 +65,7 @@ func TestDepositStake(t *testing.T) { return common.Hash{}, staking.ErrInsufficientFunds }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(minStake), http.StatusBadRequest) jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusBadRequest, Message: "out of funds"}) }) @@ -78,7 +78,7 @@ func TestDepositStake(t *testing.T) { return common.Hash{}, fmt.Errorf("some error") }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodPost, depositStake(minStake), http.StatusInternalServerError) jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusInternalServerError, Message: "cannot stake"}) }) @@ -96,7 +96,6 @@ func TestDepositStake(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, StakingContract: contract, }) @@ -117,7 +116,7 @@ func TestGetStake(t *testing.T) { return big.NewInt(1), nil }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodGet, "/stake", http.StatusOK, jsonhttptest.WithExpectedJSONResponse(&api.GetStakeResponse{StakedAmount: bigint.Wrap(big.NewInt(1))})) }) @@ -130,7 +129,7 @@ func TestGetStake(t *testing.T) { return big.NewInt(0), fmt.Errorf("get stake failed") }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contractWithError}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contractWithError}) jsonhttptest.Request(t, ts, http.MethodGet, "/stake", http.StatusInternalServerError, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusInternalServerError, Message: "get staked amount failed"})) }) @@ -139,7 +138,7 @@ func TestGetStake(t *testing.T) { func Test_stakingDepositHandler_invalidInputs(t *testing.T) { t.Parallel() - client, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + client, _, _, _ := newTestServer(t, testServerOptions{}) tests := []struct { name string @@ -185,7 +184,7 @@ func TestWithdrawAllStake(t *testing.T) { return txHash, nil }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodDelete, "/stake", http.StatusOK, jsonhttptest.WithExpectedJSONResponse( &api.WithdrawAllStakeResponse{TxHash: txHash.String()})) }) @@ -198,7 +197,7 @@ func TestWithdrawAllStake(t *testing.T) { return common.Hash{}, staking.ErrInsufficientStake }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodDelete, "/stake", http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusBadRequest, Message: "insufficient stake to withdraw"})) }) @@ -211,7 +210,7 @@ func TestWithdrawAllStake(t *testing.T) { return common.Hash{}, fmt.Errorf("some error") }), ) - ts, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true, StakingContract: contract}) + ts, _, _, _ := newTestServer(t, testServerOptions{StakingContract: contract}) jsonhttptest.Request(t, ts, http.MethodDelete, "/stake", http.StatusInternalServerError) jsonhttptest.WithExpectedJSONResponse(&jsonhttp.StatusResponse{Code: http.StatusInternalServerError, Message: "cannot withdraw stake"}) }) @@ -229,7 +228,6 @@ func TestWithdrawAllStake(t *testing.T) { }), ) ts, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, StakingContract: contract, }) diff --git a/pkg/api/status_test.go b/pkg/api/status_test.go index cc2c568abf4..8dadff7484c 100644 --- a/pkg/api/status_test.go +++ b/pkg/api/status_test.go @@ -58,7 +58,6 @@ func TestGetStatus(t *testing.T) { client, _, _, _ := newTestServer(t, testServerOptions{ BeeMode: mode, - DebugAPI: true, NodeStatus: statusSvc, }) @@ -71,8 +70,7 @@ func TestGetStatus(t *testing.T) { t.Parallel() client, _, _, _ := newTestServer(t, testServerOptions{ - BeeMode: api.DevMode, - DebugAPI: true, + BeeMode: api.DevMode, NodeStatus: status.NewService( log.Noop, nil, diff --git a/pkg/api/topology_test.go b/pkg/api/topology_test.go index ebd22532f3b..11dd6703791 100644 --- a/pkg/api/topology_test.go +++ b/pkg/api/topology_test.go @@ -14,7 +14,7 @@ import ( func TestTopologyOK(t *testing.T) { t.Parallel() - testServer, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + testServer, _, _, _ := newTestServer(t, testServerOptions{}) var body []byte opts := jsonhttptest.WithPutResponseBody(&body) diff --git a/pkg/api/transaction_test.go b/pkg/api/transaction_test.go index 46e066c4091..c23cc9cf3f5 100644 --- a/pkg/api/transaction_test.go +++ b/pkg/api/transaction_test.go @@ -42,7 +42,6 @@ func TestTransactionStoredTransaction(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithStoredTransactionFunc(func(txHash common.Hash) (*transaction.StoredTransaction, error) { return &transaction.StoredTransaction{ @@ -84,7 +83,6 @@ func TestTransactionStoredTransaction(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithStoredTransactionFunc(func(txHash common.Hash) (*transaction.StoredTransaction, error) { return nil, transaction.ErrUnknownTransaction @@ -103,7 +101,6 @@ func TestTransactionStoredTransaction(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithStoredTransactionFunc(func(txHash common.Hash) (*transaction.StoredTransaction, error) { return nil, errors.New("err") @@ -155,7 +152,6 @@ func TestTransactionList(t *testing.T) { } testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return []common.Hash{txHash1, txHash2}, nil @@ -210,7 +206,6 @@ func TestTransactionListError(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return nil, errors.New("err") @@ -233,7 +228,6 @@ func TestTransactionListError(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return []common.Hash{txHash1}, nil @@ -261,7 +255,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return nil @@ -280,7 +273,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return transaction.ErrUnknownTransaction @@ -300,7 +292,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return transaction.ErrAlreadyImported @@ -320,7 +311,6 @@ func TestTransactionResend(t *testing.T) { t.Parallel() testServer, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, TransactionOpts: []mock.Option{ mock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { return errors.New("err") diff --git a/pkg/api/version.go b/pkg/api/version.go index b9bf36154c4..44086d8bc47 100644 --- a/pkg/api/version.go +++ b/pkg/api/version.go @@ -6,4 +6,3 @@ package api // Version is set in the build process. var Version = "0.0.0" -var DebugVersion = "0.0.0" diff --git a/pkg/api/wallet_test.go b/pkg/api/wallet_test.go index c6f7449d51a..d5c09efaeeb 100644 --- a/pkg/api/wallet_test.go +++ b/pkg/api/wallet_test.go @@ -28,7 +28,6 @@ func TestWallet(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { return big.NewInt(10000000000000000), nil @@ -54,7 +53,6 @@ func TestWallet(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { return new(big.Int), nil @@ -73,7 +71,6 @@ func TestWallet(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { return new(big.Int), nil @@ -95,7 +92,7 @@ func TestWalletWithdraw(t *testing.T) { t.Run("address not whitelisted", func(t *testing.T) { t.Parallel() - srv, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + srv, _, _, _ := newTestServer(t, testServerOptions{}) jsonhttptest.Request(t, srv, http.MethodPost, "/wallet/withdraw/BZZ?address=0xaf&amount=99999999", http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ @@ -107,7 +104,7 @@ func TestWalletWithdraw(t *testing.T) { t.Run("invalid coin type", func(t *testing.T) { t.Parallel() - srv, _, _, _ := newTestServer(t, testServerOptions{DebugAPI: true}) + srv, _, _, _ := newTestServer(t, testServerOptions{}) jsonhttptest.Request(t, srv, http.MethodPost, "/wallet/withdraw/BTC?address=0xaf&amount=99999999", http.StatusBadRequest, jsonhttptest.WithExpectedJSONResponse(jsonhttp.StatusResponse{ @@ -120,7 +117,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", }) @@ -135,7 +131,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { @@ -155,7 +150,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { @@ -177,7 +171,6 @@ func TestWalletWithdraw(t *testing.T) { txHash := common.HexToHash("0x00f") srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", Erc20Opts: []erc20mock.Option{ erc20mock.WithBalanceOfFunc(func(ctx context.Context, address common.Address) (*big.Int, error) { @@ -205,7 +198,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", }) @@ -220,7 +212,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { @@ -240,7 +231,6 @@ func TestWalletWithdraw(t *testing.T) { t.Parallel() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { @@ -262,7 +252,6 @@ func TestWalletWithdraw(t *testing.T) { txHash := common.HexToHash("0x00f") srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, WhitelistedAddr: "0xaf", BackendOpts: []backendmock.Option{ backendmock.WithBalanceAt(func(ctx context.Context, address common.Address, block *big.Int) (*big.Int, error) { diff --git a/pkg/api/welcome_message_test.go b/pkg/api/welcome_message_test.go index 39d7c19a039..6eb6670e8ab 100644 --- a/pkg/api/welcome_message_test.go +++ b/pkg/api/welcome_message_test.go @@ -23,7 +23,6 @@ func TestGetWelcomeMessage(t *testing.T) { const DefaultTestWelcomeMessage = "Hello World!" srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithGetWelcomeMessageFunc(func() string { return DefaultTestWelcomeMessage }))}) @@ -75,8 +74,7 @@ func TestSetWelcomeMessage(t *testing.T) { mockP2P := mock.New() srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, - P2P: mockP2P, + P2P: mockP2P, }) if tC.wantMessage == "" { @@ -112,7 +110,6 @@ func TestSetWelcomeMessageInternalServerError(t *testing.T) { testURL := "/welcome-message" srv, _, _, _ := newTestServer(t, testServerOptions{ - DebugAPI: true, P2P: mock.New(mock.WithSetWelcomeMessageFunc(func(string) error { return testError })), diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go deleted file mode 100644 index a5aaec89dd2..00000000000 --- a/pkg/auth/auth.go +++ /dev/null @@ -1,335 +0,0 @@ -// Copyright 2021 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package auth - -import ( - "crypto/aes" - "crypto/cipher" - "crypto/md5" - "crypto/rand" - "encoding/base64" - "encoding/hex" - "encoding/json" - "errors" - "io" - "time" - - "github.com/casbin/casbin/v2" - "github.com/casbin/casbin/v2/model" - "github.com/ethersphere/bee/v2/pkg/log" - "golang.org/x/crypto/bcrypt" -) - -// loggerName is the tree path name of the logger for this package. -const loggerName = "auth" - -type Authenticator interface { - Authorize(string) bool - GenerateKey(string, time.Duration) (string, error) - RefreshKey(string, time.Duration) (string, error) - Enforce(string, string, string) (bool, error) -} - -type authRecord struct { - Role string `json:"r"` - Expiry time.Time `json:"e"` -} - -type authenticator struct { - passwordHash []byte - ciph *encrypter - enforcer *casbin.Enforcer - log log.Logger -} - -func New(encryptionKey, passwordHash string, logger log.Logger) (*authenticator, error) { - m, err := model.NewModelFromString(` - [request_definition] - r = sub, obj, act - - [role_definition] - g = _, _ - - [policy_definition] - p = sub, obj, act - - [policy_effect] - e = some(where (p.eft == allow)) - - [matchers] - m = (g(r.sub, p.sub) || r.sub == p.sub) && (keyMatch(r.obj, p.obj) || keyMatch(r.obj, '/v1'+p.obj)) && regexMatch(r.act, p.act)`) - - if err != nil { - return nil, err - } - - e, err := casbin.NewEnforcer(m) - if err != nil { - return nil, err - } - - if err := applyPolicies(e); err != nil { - return nil, err - } - - ciph, err := newEncrypter([]byte(encryptionKey)) - if err != nil { - return nil, err - } - - auth := authenticator{ - enforcer: e, - ciph: ciph, - passwordHash: []byte(passwordHash), - log: logger.WithName(loggerName).Register(), - } - - return &auth, nil -} - -func (a *authenticator) Authorize(password string) bool { - return nil == bcrypt.CompareHashAndPassword(a.passwordHash, []byte(password)) -} - -var ErrExpiry = errors.New("expiry duration must be a positive number") - -func (a *authenticator) GenerateKey(role string, expiryDuration time.Duration) (string, error) { - if expiryDuration == 0 { - return "", ErrExpiry - } - - ar := authRecord{ - Role: role, - Expiry: time.Now().Add(expiryDuration), - } - - data, err := json.Marshal(ar) - if err != nil { - return "", err - } - - encryptedBytes, err := a.ciph.encrypt(data) - if err != nil { - return "", err - } - - apiKey := base64.StdEncoding.EncodeToString(encryptedBytes) - - return apiKey, nil -} - -var ErrTokenExpired = errors.New("token expired") - -func (a *authenticator) RefreshKey(apiKey string, expiryDuration time.Duration) (string, error) { - if expiryDuration == 0 { - return "", ErrExpiry - } - - decoded, err := base64.StdEncoding.DecodeString(apiKey) - if err != nil { - return "", err - } - - decryptedBytes, err := a.ciph.decrypt(decoded) - if err != nil { - return "", err - } - - var ar authRecord - if err := json.Unmarshal(decryptedBytes, &ar); err != nil { - return "", err - } - - if time.Now().After(ar.Expiry) { - return "", ErrTokenExpired - } - - ar.Expiry = time.Now().Add(expiryDuration) - - data, err := json.Marshal(ar) - if err != nil { - return "", err - } - - encryptedBytes, err := a.ciph.encrypt(data) - if err != nil { - return "", err - } - - apiKey = base64.StdEncoding.EncodeToString(encryptedBytes) - - return apiKey, nil -} - -func (a *authenticator) Enforce(apiKey, obj, act string) (bool, error) { - decoded, err := base64.StdEncoding.DecodeString(apiKey) - if err != nil { - a.log.Error(err, "decode token failed") - return false, err - } - - decryptedBytes, err := a.ciph.decrypt(decoded) - if err != nil { - a.log.Error(err, "decrypt token failed") - return false, err - } - - var ar authRecord - if err := json.Unmarshal(decryptedBytes, &ar); err != nil { - a.log.Error(err, "unmarshal token failed") - return false, err - } - - if time.Now().After(ar.Expiry) { - a.log.Error(nil, "token expired") - return false, ErrTokenExpired - } - - allow, err := a.enforcer.Enforce(ar.Role, obj, act) - if err != nil { - a.log.Error(err, "enforce failed") - return false, err - } - - return allow, nil -} - -type encrypter struct { - gcm cipher.AEAD -} - -func newEncrypter(key []byte) (*encrypter, error) { - hasher := md5.New() - _, err := hasher.Write(key) - if err != nil { - return nil, err - } - hash := hex.EncodeToString(hasher.Sum(nil)) - block, err := aes.NewCipher([]byte(hash)) - if err != nil { - return nil, err - } - gcm, err := cipher.NewGCM(block) - if err != nil { - return nil, err - } - - return &encrypter{ - gcm: gcm, - }, nil -} - -func (e encrypter) encrypt(data []byte) ([]byte, error) { - nonce := make([]byte, e.gcm.NonceSize()) - if _, err := io.ReadFull(rand.Reader, nonce); err != nil { - return nil, err - } - ciphertext := e.gcm.Seal(nonce, nonce, data, nil) - return ciphertext, nil -} - -func (e encrypter) decrypt(data []byte) ([]byte, error) { - nonceSize := e.gcm.NonceSize() - nonce, ciphertext := data[:nonceSize], data[nonceSize:] - plaintext, err := e.gcm.Open(nil, nonce, ciphertext, nil) - if err != nil { - return nil, err - } - return plaintext, nil -} - -func applyPolicies(e *casbin.Enforcer) error { - _, err := e.AddPolicies([][]string{ - {"consumer", "/bytes/*", "(GET)|(HEAD)"}, - {"creator", "/bytes", "POST"}, - {"consumer", "/chunks/*", "GET"}, - {"creator", "/chunks", "POST"}, - {"consumer", "/bzz/*", "GET"}, - {"creator", "/bzz/*", "PATCH"}, - {"creator", "/bzz", "POST"}, - {"creator", "/bzz?*", "POST"}, - {"consumer", "/bzz/*/*", "(GET)|(HEAD)"}, - {"creator", "/tags", "GET"}, - {"creator", "/tags?*", "GET"}, - {"creator", "/tags", "POST"}, - {"creator", "/tags/*", "(GET)|(DELETE)|(PATCH)"}, - {"creator", "/pins/*", "(GET)|(DELETE)|(POST)"}, - {"maintainer", "/pins", "GET"}, - {"creator", "/pss/send/*", "POST"}, - {"consumer", "/pss/subscribe/*", "GET"}, - {"creator", "/soc/*/*", "POST"}, - {"creator", "/feeds/*/*", "POST"}, - {"consumer", "/feeds/*/*", "GET"}, - {"maintainer", "/stamps", "GET"}, - {"maintainer", "/stamps/*", "GET"}, - {"maintainer", "/stamps/*/*", "POST"}, - {"maintainer", "/stamps/topup/*/*", "PATCH"}, - {"maintainer", "/stamps/dilute/*/*", "PATCH"}, - {"maintainer", "/stake", "(GET)|(DELETE)"}, - {"maintainer", "/stake/*", "POST"}, - {"maintainer", "/addresses", "GET"}, - {"maintainer", "/blocklist", "GET"}, - {"maintainer", "/connect/*", "POST"}, - {"maintainer", "/peers", "GET"}, - {"maintainer", "/peers/*", "DELETE"}, - {"maintainer", "/pingpong/*", "POST"}, - {"maintainer", "/topology", "GET"}, - {"maintainer", "/welcome-message", "(GET)|(POST)"}, - {"maintainer", "/balances", "GET"}, - {"maintainer", "/balances/*", "GET"}, - {"maintainer", "/accounting", "GET"}, - {"maintainer", "/chequebook/cashout/*", "GET"}, - {"accountant", "/chequebook/cashout/*", "POST"}, - {"accountant", "/chequebook/withdraw", "POST"}, - {"accountant", "/chequebook/withdraw?*", "POST"}, - {"accountant", "/chequebook/deposit", "POST"}, - {"accountant", "/chequebook/deposit?*", "POST"}, - {"maintainer", "/chequebook/cheque/*", "GET"}, - {"maintainer", "/chequebook/cheque", "GET"}, - {"maintainer", "/chequebook/address", "GET"}, - {"maintainer", "/chequebook/balance", "GET"}, - {"maintainer", "/wallet", "GET"}, - {"maintainer", "/wallet/withdraw/*", "POST"}, - {"maintainer", "/chunks/*", "(GET)|(DELETE)"}, - {"maintainer", "/reservestate", "GET"}, - {"maintainer", "/chainstate", "GET"}, - {"maintainer", "/settlements/*", "GET"}, - {"maintainer", "/settlements", "GET"}, - {"maintainer", "/transactions", "GET"}, - {"consumer", "/transactions/*", "GET"}, - {"accountant", "/transactions/*", "(POST)|(DELETE)"}, - {"consumer", "/consumed", "GET"}, - {"consumer", "/consumed/*", "GET"}, - {"consumer", "/chunks/stream", "GET"}, - {"creator", "/stewardship/*", "GET"}, - {"consumer", "/stewardship/*", "PUT"}, - {"maintainer", "/redistributionstate", "GET"}, - {"maintainer", "/debugstore", "GET"}, - {"consumer", "/rchash", "GET"}, - {"maintainer", "/debug/*", "GET"}, - {"maintainer", "/metrics", "GET"}, - {"maintainer", "/node", "GET"}, - {"maintainer", "/loggers", "GET"}, - {"maintainer", "/loggers/*", "(GET)|(PUT)"}, - {"maintainer", "/status", "GET"}, - {"maintainer", "/status/peers", "GET"}, - {"maintainer", "/rcash/*", "GET"}, - {"maintainer", "/batches", "GET"}, - {"maintainer", "/timesettlements", "GET"}, - }) - - if err != nil { - return err - } - - // consumer > creator > accountant > maintainer - _, err = e.AddGroupingPolicies([][]string{ - {"creator", "consumer"}, - {"accountant", "creator"}, - {"maintainer", "accountant"}, - }) - - return err -} diff --git a/pkg/auth/auth_test.go b/pkg/auth/auth_test.go deleted file mode 100644 index 0d107a764a2..00000000000 --- a/pkg/auth/auth_test.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2021 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package auth_test - -import ( - "errors" - "testing" - "time" - - "github.com/ethersphere/bee/v2/pkg/auth" - "github.com/ethersphere/bee/v2/pkg/log" -) - -const ( - encryptionKey = "mZIODMvjsiS2VdK1xgI1cOTizhGVNoVz" - passwordHash = "$2a$12$mZIODMvjsiS2VdK1xgI1cOTizhGVNoVz2Xn48H8ddFFLzX2B3lD3m" -) - -func TestAuthorize(t *testing.T) { - t.Parallel() - - a, err := auth.New(encryptionKey, passwordHash, log.Noop) - if err != nil { - t.Error(err) - } - - tt := []struct { - desc string - pass string - expected bool - }{ - { - desc: "correct credentials", - pass: "test", - expected: true, - }, { - desc: "wrong password", - pass: "notTest", - expected: false, - }, - } - for _, tC := range tt { - tC := tC - t.Run(tC.desc, func(t *testing.T) { - t.Parallel() - - res := a.Authorize(tC.pass) - if res != tC.expected { - t.Error("unexpected result", res) - } - }) - } -} - -func TestExpiry(t *testing.T) { - t.Parallel() - - const expiryDuration = time.Millisecond * 10 - - a, err := auth.New(encryptionKey, passwordHash, log.Noop) - if err != nil { - t.Error(err) - } - - key, err := a.GenerateKey("consumer", expiryDuration) - if err != nil { - t.Errorf("expected no error, got: %v", err) - } - - time.Sleep(expiryDuration * 2) - - result, err := a.Enforce(key, "/bytes/1", "GET") - if !errors.Is(err, auth.ErrTokenExpired) { - t.Errorf("expected token expired error, got: %v", err) - } - - if result { - t.Errorf("expected %v, got %v", false, result) - } -} - -func TestEnforce(t *testing.T) { - t.Parallel() - - const expiryDuration = time.Second - - a, err := auth.New(encryptionKey, passwordHash, log.Noop) - if err != nil { - t.Error(err) - } - - tt := []struct { - desc string - role, resource, action string - expected bool - }{ - { - desc: "success", - role: "maintainer", - resource: "/pingpong/someone", - action: "POST", - expected: true, - }, { - desc: "success with query param", - role: "creator", - resource: "/bzz?name=some-name", - action: "POST", - expected: true, - }, - { - desc: "bad role", - role: "consumer", - resource: "/pingpong/some-other-peer", - action: "POST", - }, - { - desc: "bad resource", - role: "maintainer", - resource: "/i-dont-exist", - action: "POST", - }, - { - desc: "bad action", - role: "maintainer", - resource: "/pingpong/someone", - action: "DELETE", - }, - } - - for _, tC := range tt { - tC := tC - t.Run(tC.desc, func(t *testing.T) { - t.Parallel() - - apiKey, err := a.GenerateKey(tC.role, expiryDuration) - - if err != nil { - t.Errorf("expected no error, got: %v", err) - } - - result, err := a.Enforce(apiKey, tC.resource, tC.action) - - if err != nil { - t.Errorf("expected no error, got: %v", err) - } - - if result != tC.expected { - t.Errorf("request from user with %s on object %s: expected %v, got %v", tC.role, tC.resource, tC.expected, result) - } - }) - } -} diff --git a/pkg/auth/handler.go b/pkg/auth/handler.go deleted file mode 100644 index 6a54b9269be..00000000000 --- a/pkg/auth/handler.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package auth - -import ( - "errors" - "net/http" - "strings" - - "github.com/ethersphere/bee/v2/pkg/jsonhttp" -) - -type auth interface { - Enforce(string, string, string) (bool, error) -} - -func PermissionCheckHandler(auth auth) func(h http.Handler) http.Handler { - return func(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - reqToken := r.Header.Get("Authorization") - if !strings.HasPrefix(reqToken, "Bearer ") { - jsonhttp.Forbidden(w, "Missing bearer token") - return - } - - keys := strings.Split(reqToken, "Bearer ") - - if len(keys) != 2 || strings.Trim(keys[1], " ") == "" { - jsonhttp.Unauthorized(w, "Missing security token") - return - } - - apiKey := keys[1] - - allowed, err := auth.Enforce(apiKey, r.URL.Path, r.Method) - if errors.Is(err, ErrTokenExpired) { - jsonhttp.Unauthorized(w, "Token expired") - return - } - - if err != nil { - jsonhttp.InternalServerError(w, "Error occurred while validating the security token") - return - } - - if !allowed { - jsonhttp.Forbidden(w, "Provided security token does not grant access to the resource") - return - } - - h.ServeHTTP(w, r) - }) - } -} diff --git a/pkg/auth/main_test.go b/pkg/auth/main_test.go deleted file mode 100644 index be220f06760..00000000000 --- a/pkg/auth/main_test.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2022 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package auth_test - -import ( - "testing" - - "go.uber.org/goleak" -) - -func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) -} diff --git a/pkg/auth/mock/auth.go b/pkg/auth/mock/auth.go deleted file mode 100644 index ef8ebd30b75..00000000000 --- a/pkg/auth/mock/auth.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2021 The Swarm Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mock - -import "time" - -type Auth struct { - AuthorizeFunc func(string) bool - GenerateKeyFunc func(string) (string, error) - EnforceFunc func(string, string, string) (bool, error) -} - -func (ma *Auth) Authorize(u string) bool { - if ma.AuthorizeFunc == nil { - return true - } - return ma.AuthorizeFunc(u) -} -func (ma *Auth) GenerateKey(k string, _ time.Duration) (string, error) { - if ma.GenerateKeyFunc == nil { - return "", nil - } - return ma.GenerateKeyFunc(k) -} -func (ma *Auth) RefreshKey(k string, _ time.Duration) (string, error) { - if ma.GenerateKeyFunc == nil { - return "", nil - } - return ma.GenerateKeyFunc(k) -} -func (ma *Auth) Enforce(a1 string, a2 string, a3 string) (bool, error) { - return ma.EnforceFunc(a1, a2, a3) -} diff --git a/pkg/node/devnode.go b/pkg/node/devnode.go index 853eff94807..016c762af77 100644 --- a/pkg/node/devnode.go +++ b/pkg/node/devnode.go @@ -20,7 +20,6 @@ import ( "github.com/ethersphere/bee/v2/pkg/accesscontrol" mockAccounting "github.com/ethersphere/bee/v2/pkg/accounting/mock" "github.com/ethersphere/bee/v2/pkg/api" - "github.com/ethersphere/bee/v2/pkg/auth" "github.com/ethersphere/bee/v2/pkg/bzz" "github.com/ethersphere/bee/v2/pkg/crypto" "github.com/ethersphere/bee/v2/pkg/feeds/factory" @@ -70,22 +69,17 @@ type DevBee struct { accesscontrolCloser io.Closer errorLogWriter io.Writer apiServer *http.Server - debugAPIServer *http.Server } type DevOptions struct { Logger log.Logger APIAddr string - DebugAPIAddr string CORSAllowedOrigins []string DBOpenFilesLimit uint64 ReserveCapacity uint64 DBWriteBufferSize uint64 DBBlockCacheCapacity uint64 DBDisableSeeksCompaction bool - Restricted bool - TokenEncryptionKey string - AdminPasswordHash string } // NewDevBee starts the bee instance in 'development' mode @@ -143,15 +137,6 @@ func NewDevBee(logger log.Logger, o *DevOptions) (b *DevBee, err error) { return nil, fmt.Errorf("blockchain address: %w", err) } - var authenticator auth.Authenticator - - if o.Restricted { - if authenticator, err = auth.New(o.TokenEncryptionKey, o.AdminPasswordHash, logger); err != nil { - return nil, fmt.Errorf("authenticator: %w", err) - } - logger.Info("starting with restricted APIs") - } - var mockTransaction = transactionmock.New(transactionmock.WithPendingTransactionsFunc(func() ([]common.Hash, error) { return []common.Hash{common.HexToHash("abcd")}, nil }), transactionmock.WithResendTransactionFunc(func(ctx context.Context, txHash common.Hash) error { @@ -196,37 +181,6 @@ func NewDevBee(logger log.Logger, o *DevOptions) (b *DevBee, err error) { } }(probe) - var debugApiService *api.Service - - if o.DebugAPIAddr != "" { - debugAPIListener, err := net.Listen("tcp", o.DebugAPIAddr) - if err != nil { - return nil, fmt.Errorf("debug api listener: %w", err) - } - - debugApiService = api.New(mockKey.PublicKey, mockKey.PublicKey, overlayEthAddress, nil, logger, mockTransaction, batchStore, api.DevMode, true, true, chainBackend, o.CORSAllowedOrigins, inmemstore.New()) - debugAPIServer := &http.Server{ - IdleTimeout: 30 * time.Second, - ReadHeaderTimeout: 3 * time.Second, - Handler: debugApiService, - ErrorLog: stdlog.New(b.errorLogWriter, "", 0), - } - - debugApiService.MountTechnicalDebug() - debugApiService.SetProbe(probe) - - go func() { - logger.Info("starting debug api server", "address", debugAPIListener.Addr()) - - if err := debugAPIServer.Serve(debugAPIListener); err != nil && !errors.Is(err, http.ErrServerClosed) { - logger.Debug("debug api server failed to start", "error", err) - logger.Error(nil, "debug api server failed to start") - } - }() - - b.debugAPIServer = debugAPIServer - } - localStore, err := storer.New(context.Background(), "", &storer.Options{ Logger: logger, CacheCapacity: 1_000_000, @@ -408,30 +362,17 @@ func NewDevBee(logger log.Logger, o *DevOptions) (b *DevBee, err error) { apiService := api.New(mockKey.PublicKey, mockKey.PublicKey, overlayEthAddress, nil, logger, mockTransaction, batchStore, api.DevMode, true, true, chainBackend, o.CORSAllowedOrigins, inmemstore.New()) - apiService.Configure(signer, authenticator, tracer, api.Options{ + apiService.Configure(signer, tracer, api.Options{ CORSAllowedOrigins: o.CORSAllowedOrigins, WsPingPeriod: 60 * time.Second, - Restricted: o.Restricted, }, debugOpts, 1, erc20) apiService.MountTechnicalDebug() + apiService.MountDebug() apiService.MountAPI() - apiService.SetProbe(probe) + apiService.SetProbe(probe) apiService.SetP2P(p2ps) apiService.SetSwarmAddress(&swarmAddress) - apiService.MountDebug() - - if o.DebugAPIAddr != "" { - debugApiService.SetP2P(p2ps) - debugApiService.SetSwarmAddress(&swarmAddress) - debugApiService.MountDebug() - - debugApiService.Configure(signer, authenticator, tracer, api.Options{ - CORSAllowedOrigins: o.CORSAllowedOrigins, - WsPingPeriod: 60 * time.Second, - Restricted: o.Restricted, - }, debugOpts, 1, erc20) - } apiListener, err := net.Listen("tcp", o.APIAddr) if err != nil { @@ -485,15 +426,6 @@ func (b *DevBee) Shutdown() error { return nil }) } - if b.debugAPIServer != nil { - eg.Go(func() error { - if err := b.debugAPIServer.Shutdown(ctx); err != nil { - return fmt.Errorf("debug api server: %w", err) - } - return nil - }) - } - if err := eg.Wait(); err != nil { mErr = multierror.Append(mErr, err) } diff --git a/pkg/node/node.go b/pkg/node/node.go index 09fa43b4589..198b02ad6cb 100644 --- a/pkg/node/node.go +++ b/pkg/node/node.go @@ -28,7 +28,6 @@ import ( "github.com/ethersphere/bee/v2/pkg/accounting" "github.com/ethersphere/bee/v2/pkg/addressbook" "github.com/ethersphere/bee/v2/pkg/api" - "github.com/ethersphere/bee/v2/pkg/auth" "github.com/ethersphere/bee/v2/pkg/config" "github.com/ethersphere/bee/v2/pkg/crypto" "github.com/ethersphere/bee/v2/pkg/feeds/factory" @@ -90,7 +89,6 @@ type Bee struct { ctxCancel context.CancelFunc apiCloser io.Closer apiServer *http.Server - debugAPIServer *http.Server resolverCloser io.Closer errorLogWriter io.Writer tracerCloser io.Closer @@ -129,7 +127,6 @@ type Options struct { DBBlockCacheCapacity uint64 DBDisableSeeksCompaction bool APIAddr string - DebugAPIAddr string Addr string NATAddr string EnableWS bool @@ -166,9 +163,6 @@ type Options struct { MutexProfile bool StaticNodes []swarm.Address AllowPrivateCIDRs bool - Restricted bool - TokenEncryptionKey string - AdminPasswordHash string UsePostageSnapshot bool EnableStorageIncentives bool StatestoreCacheCapacity uint64 @@ -373,16 +367,6 @@ func NewBee( b.transactionCloser = tracerCloser b.transactionMonitorCloser = transactionMonitor - var authenticator auth.Authenticator - - if o.Restricted { - if authenticator, err = auth.New(o.TokenEncryptionKey, o.AdminPasswordHash, logger); err != nil { - return nil, fmt.Errorf("authenticator: %w", err) - } - logger.Info("starting with restricted APIs") - } - - // set up basic debug api endpoints for debugging and /health endpoint beeNodeMode := api.LightMode if o.FullNodeMode { beeNodeMode = api.FullMode @@ -408,59 +392,6 @@ func NewBee( b.stamperStoreCloser = stamperStore var apiService *api.Service - var debugService *api.Service - - if o.DebugAPIAddr != "" { - if o.MutexProfile { - _ = runtime.SetMutexProfileFraction(1) - } - - if o.BlockProfile { - runtime.SetBlockProfileRate(1) - } - - debugAPIListener, err := net.Listen("tcp", o.DebugAPIAddr) - if err != nil { - return nil, fmt.Errorf("debug api listener: %w", err) - } - - debugService = api.New( - *publicKey, - pssPrivateKey.PublicKey, - overlayEthAddress, - o.WhitelistedWithdrawalAddress, - logger, - transactionService, - batchStore, - beeNodeMode, - o.ChequebookEnable, - o.SwapEnable, - chainBackend, - o.CORSAllowedOrigins, - stamperStore, - ) - debugService.Restricted = o.Restricted - debugService.MountTechnicalDebug() - debugService.SetProbe(probe) - - debugAPIServer := &http.Server{ - IdleTimeout: 30 * time.Second, - ReadHeaderTimeout: 3 * time.Second, - Handler: debugService, - ErrorLog: stdlog.New(b.errorLogWriter, "", 0), - } - - go func() { - logger.Info("starting debug server", "address", debugAPIListener.Addr()) - - if err := debugAPIServer.Serve(debugAPIListener); err != nil && !errors.Is(err, http.ErrServerClosed) { - logger.Debug("debug api server failed to start", "error", err) - logger.Error(nil, "debug api server failed to start") - } - }() - - b.debugAPIServer = debugAPIServer - } if o.APIAddr != "" { if o.MutexProfile { @@ -490,7 +421,6 @@ func NewBee( o.CORSAllowedOrigins, stamperStore, ) - apiService.Restricted = o.Restricted apiService.MountTechnicalDebug() apiService.SetProbe(probe) @@ -638,9 +568,7 @@ func NewBee( var registry *promc.Registry - if debugService != nil { - registry = debugService.MetricsRegistry() - } else if apiService != nil { + if apiService != nil { registry = apiService.MetricsRegistry() } @@ -1155,79 +1083,18 @@ func NewBee( apiService.MustRegisterMetrics(swapService.Metrics()...) } - apiService.Configure(signer, authenticator, tracer, api.Options{ + apiService.Configure(signer, tracer, api.Options{ CORSAllowedOrigins: o.CORSAllowedOrigins, WsPingPeriod: 60 * time.Second, - Restricted: o.Restricted, }, extraOpts, chainID, erc20Service) - apiService.MountAPI() apiService.MountDebug() + apiService.MountAPI() apiService.SetSwarmAddress(&swarmAddress) apiService.SetRedistributionAgent(agent) } - if o.DebugAPIAddr != "" { - // register metrics from components - debugService.MustRegisterMetrics(p2ps.Metrics()...) - debugService.MustRegisterMetrics(pingPong.Metrics()...) - debugService.MustRegisterMetrics(acc.Metrics()...) - debugService.MustRegisterMetrics(localStore.Metrics()...) - debugService.MustRegisterMetrics(kad.Metrics()...) - debugService.MustRegisterMetrics(saludService.Metrics()...) - debugService.MustRegisterMetrics(stateStoreMetrics.Metrics()...) - - if pullerService != nil { - debugService.MustRegisterMetrics(pullerService.Metrics()...) - } - - if agent != nil { - debugService.MustRegisterMetrics(agent.Metrics()...) - } - - debugService.MustRegisterMetrics(pushSyncProtocol.Metrics()...) - debugService.MustRegisterMetrics(pusherService.Metrics()...) - debugService.MustRegisterMetrics(pullSyncProtocol.Metrics()...) - debugService.MustRegisterMetrics(retrieval.Metrics()...) - debugService.MustRegisterMetrics(lightNodes.Metrics()...) - debugService.MustRegisterMetrics(hive.Metrics()...) - - if bs, ok := batchStore.(metrics.Collector); ok { - debugService.MustRegisterMetrics(bs.Metrics()...) - } - if ls, ok := eventListener.(metrics.Collector); ok { - debugService.MustRegisterMetrics(ls.Metrics()...) - } - if pssServiceMetrics, ok := pssService.(metrics.Collector); ok { - debugService.MustRegisterMetrics(pssServiceMetrics.Metrics()...) - } - if swapBackendMetrics, ok := chainBackend.(metrics.Collector); ok { - debugService.MustRegisterMetrics(swapBackendMetrics.Metrics()...) - } - if apiService != nil { - debugService.MustRegisterMetrics(apiService.Metrics()...) - } - if l, ok := logger.(metrics.Collector); ok { - debugService.MustRegisterMetrics(l.Metrics()...) - } - debugService.MustRegisterMetrics(pseudosettleService.Metrics()...) - if swapService != nil { - debugService.MustRegisterMetrics(swapService.Metrics()...) - } - - debugService.Configure(signer, authenticator, tracer, api.Options{ - CORSAllowedOrigins: o.CORSAllowedOrigins, - WsPingPeriod: 60 * time.Second, - Restricted: o.Restricted, - }, extraOpts, chainID, erc20Service) - - debugService.SetP2P(p2ps) - debugService.SetSwarmAddress(&swarmAddress) - debugService.MountDebug() - debugService.SetRedistributionAgent(agent) - } - if err := kad.Start(ctx); err != nil { return nil, err } @@ -1291,15 +1158,6 @@ func (b *Bee) Shutdown() error { return nil }) } - if b.debugAPIServer != nil { - eg.Go(func() error { - if err := b.debugAPIServer.Shutdown(ctx); err != nil { - return fmt.Errorf("debug api server: %w", err) - } - return nil - }) - } - if err := eg.Wait(); err != nil { mErr = multierror.Append(mErr, err) } diff --git a/pkg/pushsync/pushsync.go b/pkg/pushsync/pushsync.go index 90af7cfe8eb..3feeed67bf4 100644 --- a/pkg/pushsync/pushsync.go +++ b/pkg/pushsync/pushsync.go @@ -339,7 +339,7 @@ func (ps *PushSync) pushToClosest(ctx context.Context, ch swarm.Chunk, origin bo resultChan := make(chan receiptResult) - retryC := make(chan struct{}, parallelForwards) + retryC := make(chan struct{}, max(1, parallelForwards)) retry := func() { select { diff --git a/pkg/retrieval/retrieval.go b/pkg/retrieval/retrieval.go index 0bb0668f700..53452cec757 100644 --- a/pkg/retrieval/retrieval.go +++ b/pkg/retrieval/retrieval.go @@ -263,7 +263,7 @@ func (s *Service) RetrieveChunk(ctx context.Context, chunkAddr, sourcePeerAddr s go func() { span, _, ctx := s.tracer.FollowSpanFromContext(spanCtx, "retrieve-chunk", s.logger, opentracing.Tag{Key: "address", Value: chunkAddr.String()}) defer span.Finish() - s.retrieveChunk(ctx, quit, chunkAddr, peer, resultC, action, origin, span) + s.retrieveChunk(ctx, quit, chunkAddr, peer, resultC, action, span) }() case res := <-resultC: @@ -297,7 +297,7 @@ func (s *Service) RetrieveChunk(ctx context.Context, chunkAddr, sourcePeerAddr s return v, nil } -func (s *Service) retrieveChunk(ctx context.Context, quit chan struct{}, chunkAddr, peer swarm.Address, result chan retrievalResult, action accounting.Action, isOrigin bool, span opentracing.Span) { +func (s *Service) retrieveChunk(ctx context.Context, quit chan struct{}, chunkAddr, peer swarm.Address, result chan retrievalResult, action accounting.Action, span opentracing.Span) { var ( startTime = time.Now() diff --git a/pkg/topology/kademlia/doc.go b/pkg/topology/kademlia/doc.go index 39fb7c25624..2407d289535 100644 --- a/pkg/topology/kademlia/doc.go +++ b/pkg/topology/kademlia/doc.go @@ -10,7 +10,7 @@ A thorough explanation of the logic in the `manage()` forever loop: The `manageC` channel gets triggered every time there's a change in the information regarding peers we know about. This can be a result of: (1) A peer has disconnected from us (2) A peer has been added to the list of -known peers (from discovery, debugapi, bootnode flag or just because it +known peers (from discovery, api, bootnode flag or just because it was persisted in the address book and the node has been restarted). So the information has been changed, and potentially upon disconnection,