diff --git a/.docker/Dockerfile.storage-testnet b/.docker/Dockerfile.storage-testnet deleted file mode 100644 index 28bbf7a1b..000000000 --- a/.docker/Dockerfile.storage-testnet +++ /dev/null @@ -1,19 +0,0 @@ -FROM golang:1.20 as builder -ARG BUILD=now -ARG VERSION=dev -ARG REPO=repository -WORKDIR /src -COPY . /src - -RUN make bin/frostfs-node - -# Executable image -FROM alpine AS frostfs-node -RUN apk add --no-cache bash - -WORKDIR / - -COPY --from=builder /src/bin/frostfs-node /bin/frostfs-node -COPY --from=builder /src/config/testnet/config.yml /config.yml - -CMD ["frostfs-node", "--config", "/config.yml"] diff --git a/Makefile b/Makefile index cf2095ec0..e1b719206 100755 --- a/Makefile +++ b/Makefile @@ -95,7 +95,7 @@ image-%: -t $(HUB_IMAGE)-$*:$(HUB_TAG) . # Build all Docker images -images: image-storage image-ir image-cli image-adm image-storage-testnet +images: image-storage image-ir image-cli image-adm # Build dirty local Docker images dirty-images: image-dirty-storage image-dirty-ir image-dirty-cli image-dirty-adm diff --git a/cmd/frostfs-cli/modules/container/list.go b/cmd/frostfs-cli/modules/container/list.go index 1c9e4767f..189cc05c7 100644 --- a/cmd/frostfs-cli/modules/container/list.go +++ b/cmd/frostfs-cli/modules/container/list.go @@ -78,7 +78,8 @@ var listContainersCmd = &cobra.Command{ if flagVarListPrintAttr { cnr.IterateAttributes(func(key, val string) { if !strings.HasPrefix(key, container.SysAttributePrefix) && !strings.HasPrefix(key, container.SysAttributePrefixNeoFS) { - // FIXME(@cthulhu-rider): neofs-sdk-go#314 use dedicated method to skip system attributes + // FIXME(@cthulhu-rider): https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/97 + // Use dedicated method to skip system attributes. cmd.Printf(" %s: %s\n", key, val) } }) diff --git a/cmd/frostfs-cli/modules/container/list_objects.go b/cmd/frostfs-cli/modules/container/list_objects.go index e417560e8..d00cc3576 100644 --- a/cmd/frostfs-cli/modules/container/list_objects.go +++ b/cmd/frostfs-cli/modules/container/list_objects.go @@ -71,7 +71,8 @@ var listContainerObjectsCmd = &cobra.Command{ for i := range attrs { attrKey := attrs[i].Key() if !strings.HasPrefix(attrKey, v2object.SysAttributePrefix) && !strings.HasPrefix(attrKey, v2object.SysAttributePrefixNeoFS) { - // FIXME(@cthulhu-rider): neofs-sdk-go#226 use dedicated method to skip system attributes + // FIXME(@cthulhu-rider): https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/issues/97 + // Use dedicated method to skip system attributes. cmd.Printf(" %s: %s\n", attrKey, attrs[i].Value()) } } diff --git a/cmd/frostfs-cli/modules/control/util.go b/cmd/frostfs-cli/modules/control/util.go index fdf17244b..5ad675c0e 100644 --- a/cmd/frostfs-cli/modules/control/util.go +++ b/cmd/frostfs-cli/modules/control/util.go @@ -40,7 +40,7 @@ func verifyResponse(cmd *cobra.Command, commonCmd.ExitOnErr(cmd, "", errors.New("missing response signature")) } - // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion var sigV2 refs.Signature sigV2.SetScheme(refs.ECDSA_SHA512) sigV2.SetKey(sigControl.GetKey()) diff --git a/cmd/frostfs-cli/modules/object/head.go b/cmd/frostfs-cli/modules/object/head.go index 6fce04490..04467744d 100644 --- a/cmd/frostfs-cli/modules/object/head.go +++ b/cmd/frostfs-cli/modules/object/head.go @@ -163,7 +163,7 @@ func printHeader(cmd *cobra.Command, obj *object.Object) error { if signature := obj.Signature(); signature != nil { cmd.Print("ID signature:\n") - // TODO(@carpawell): #1387 implement and use another approach to avoid conversion + // TODO(@carpawell): #468 implement and use another approach to avoid conversion var sigV2 refs.Signature signature.WriteToV2(&sigV2) diff --git a/cmd/frostfs-node/config/engine/shard/blobstor/config.go b/cmd/frostfs-node/config/engine/shard/blobstor/config.go index a6e34e80f..f8b2e2e9b 100644 --- a/cmd/frostfs-node/config/engine/shard/blobstor/config.go +++ b/cmd/frostfs-node/config/engine/shard/blobstor/config.go @@ -5,8 +5,6 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/engine/shard/blobstor/storage" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/blobovniczatree" - "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/blobstor/fstree" ) // Config is a wrapper over the config section @@ -25,14 +23,11 @@ func (x *Config) Storages() []*storage.Config { typ := config.String( (*config.Config)(x), strconv.Itoa(i)+".type") - switch typ { - case "": + if typ == "" { return ss - case fstree.Type, blobovniczatree.Type: - sub := storage.From((*config.Config)(x).Sub(strconv.Itoa(i))) - ss = append(ss, sub) - default: - panic("invalid type") } + + sub := storage.From((*config.Config)(x).Sub(strconv.Itoa(i))) + ss = append(ss, sub) } } diff --git a/cmd/frostfs-node/object.go b/cmd/frostfs-node/object.go index 0476dbcac..afc4bcb41 100644 --- a/cmd/frostfs-node/object.go +++ b/cmd/frostfs-node/object.go @@ -435,7 +435,7 @@ func (s *morphEACLFetcher) GetEACL(cnr cid.ID) (*containercore.EACL, error) { } if !eaclInfo.Signature.Verify(binTable) { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return nil, errors.New("invalid signature of the eACL table") } diff --git a/cmd/frostfs-node/validate.go b/cmd/frostfs-node/validate.go index 3896fd6be..e07afb2ca 100644 --- a/cmd/frostfs-node/validate.go +++ b/cmd/frostfs-node/validate.go @@ -51,17 +51,13 @@ func validateConfig(c *config.Config) error { blobstor := sc.BlobStor().Storages() if len(blobstor) != 2 { - // TODO (@fyrcik): remove after #1522 return fmt.Errorf("blobstor section must have 2 components, got: %d", len(blobstor)) } for i := range blobstor { switch blobstor[i].Type() { case fstree.Type, blobovniczatree.Type: default: - // FIXME #1764 (@fyrchik): this line is currently unreachable, - // because we panic in `sc.BlobStor().Storages()`. - return fmt.Errorf("unexpected storage type: %s (shard %d)", - blobstor[i].Type(), shardNum) + return fmt.Errorf("unexpected storage type: %s (shard %d)", blobstor[i].Type(), shardNum) } if blobstor[i].Perm()&0600 != 0600 { return fmt.Errorf("invalid permissions for blobstor component: %s, "+ diff --git a/go.mod b/go.mod index 7a1c2f074..aca1d2d6f 100644 --- a/go.mod +++ b/go.mod @@ -119,8 +119,3 @@ require ( lukechampine.com/blake3 v1.2.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) - -retract ( - v1.22.1 // Contains retraction only. - v1.22.0 // Published accidentally. -) diff --git a/pkg/core/object/fmt.go b/pkg/core/object/fmt.go index 946cfc462..ba9868693 100644 --- a/pkg/core/object/fmt.go +++ b/pkg/core/object/fmt.go @@ -133,10 +133,9 @@ func (v *FormatValidator) Validate(ctx context.Context, obj *object.Object, unpr } func (v *FormatValidator) validateSignatureKey(obj *object.Object) error { - // FIXME(@cthulhu-rider): temp solution, see neofs-sdk-go#233 sig := obj.Signature() if sig == nil { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return errors.New("missing signature") } diff --git a/pkg/innerring/processors/container/common.go b/pkg/innerring/processors/container/common.go index 375e4c179..97eb6f559 100644 --- a/pkg/innerring/processors/container/common.go +++ b/pkg/innerring/processors/container/common.go @@ -63,7 +63,6 @@ func (cp *Processor) verifySignature(v signatureVerificationData) error { } if keyProvided { - // TODO(@cthulhu-rider): #1387 use another approach after neofs-sdk-go#233 var idFromKey user.ID user.IDFromKey(&idFromKey, (ecdsa.PublicKey)(key)) @@ -118,8 +117,6 @@ func (cp *Processor) verifyByTokenSession(v signatureVerificationData, key *fros return errors.New("invalid session token signature") } - // FIXME(@cthulhu-rider): #1387 check token is signed by container owner, see neofs-sdk-go#233 - if keyProvided && !tok.AssertAuthKey(key) { return errors.New("signed with a non-session key") } diff --git a/pkg/local_object_storage/metabase/select.go b/pkg/local_object_storage/metabase/select.go index 1f32d2cde..998ce9b94 100644 --- a/pkg/local_object_storage/metabase/select.go +++ b/pkg/local_object_storage/metabase/select.go @@ -84,7 +84,7 @@ func (db *DB) Select(ctx context.Context, prm SelectPrm) (res SelectRes, err err return res, ErrDegradedMode } - if blindlyProcess(prm.filters) { + if checkNonEmpty(prm.filters) { success = true return res, nil } @@ -556,15 +556,12 @@ func markAddressInCache(cache map[string]int, fNum int, addr string) { } } -// returns true if query leads to a deliberately empty result. -func blindlyProcess(fs object.SearchFilters) bool { +// Returns true if at least 1 object can satisfy fs. +func checkNonEmpty(fs object.SearchFilters) bool { for i := range fs { if fs[i].Operation() == object.MatchNotPresent && isSystemKey(fs[i].Header()) { return true } - - // TODO: #1148 check other cases - // e.g. (a == b) && (a != b) } return false @@ -572,6 +569,5 @@ func blindlyProcess(fs object.SearchFilters) bool { // returns true if string key is a reserved system filter key. func isSystemKey(key string) bool { - // FIXME: #1147 version-dependent approach return strings.HasPrefix(key, v2object.ReservedFilterPrefix) } diff --git a/pkg/morph/client/container/eacl.go b/pkg/morph/client/container/eacl.go index 56c36c179..54c83737d 100644 --- a/pkg/morph/client/container/eacl.go +++ b/pkg/morph/client/container/eacl.go @@ -86,7 +86,7 @@ func (c *Client) GetEACL(cnr cid.ID) (*container.EACL, error) { } } - // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion var sigV2 refs.Signature sigV2.SetKey(pub) sigV2.SetSign(sig) diff --git a/pkg/morph/client/container/eacl_set.go b/pkg/morph/client/container/eacl_set.go index 86eae4c2b..2d2ffb456 100644 --- a/pkg/morph/client/container/eacl_set.go +++ b/pkg/morph/client/container/eacl_set.go @@ -31,7 +31,7 @@ func PutEACL(c *Client, eaclInfo containercore.EACL) error { prm.SetToken(eaclInfo.Session.Marshal()) } - // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion var sigV2 refs.Signature eaclInfo.Signature.WriteToV2(&sigV2) diff --git a/pkg/morph/client/container/get.go b/pkg/morph/client/container/get.go index 009b22f3c..0513eea4b 100644 --- a/pkg/morph/client/container/get.go +++ b/pkg/morph/client/container/get.go @@ -105,7 +105,7 @@ func (c *Client) Get(cid []byte) (*containercore.Container, error) { } } - // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion var sigV2 refs.Signature sigV2.SetKey(pub) sigV2.SetSign(sigBytes) diff --git a/pkg/morph/client/container/put.go b/pkg/morph/client/container/put.go index 2c97446c6..5c23eb36d 100644 --- a/pkg/morph/client/container/put.go +++ b/pkg/morph/client/container/put.go @@ -28,7 +28,7 @@ func Put(c *Client, cnr containercore.Container) (*cid.ID, error) { prm.SetToken(cnr.Session.Marshal()) } - // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion var sigV2 refs.Signature cnr.Signature.WriteToV2(&sigV2) diff --git a/pkg/network/address.go b/pkg/network/address.go index 020882980..8ad285725 100644 --- a/pkg/network/address.go +++ b/pkg/network/address.go @@ -47,7 +47,7 @@ func (a Address) URIAddr() string { panic(fmt.Errorf("could not get host addr: %w", err)) } - if !a.isTLSEnabled() { + if !a.IsTLSEnabled() { return host } diff --git a/pkg/network/group.go b/pkg/network/group.go index c18feac27..a6de0653e 100644 --- a/pkg/network/group.go +++ b/pkg/network/group.go @@ -57,7 +57,7 @@ func (x AddressGroup) Len() int { // Less returns true if i-th address in AddressGroup supports TLS // and j-th one doesn't. func (x AddressGroup) Less(i, j int) bool { - return x[i].isTLSEnabled() && !x[j].isTLSEnabled() + return x[i].IsTLSEnabled() && !x[j].IsTLSEnabled() } // Swap swaps i-th and j-th addresses in AddressGroup. diff --git a/pkg/network/tls.go b/pkg/network/tls.go index de2c93694..9aac89c47 100644 --- a/pkg/network/tls.go +++ b/pkg/network/tls.go @@ -11,8 +11,8 @@ const ( // tls var is used for (un)wrapping other multiaddrs around TLS multiaddr. var tls, _ = multiaddr.NewMultiaddr("/" + tlsProtocolName) -// isTLSEnabled searches for wrapped TLS protocol in multiaddr. -func (a Address) isTLSEnabled() bool { +// IsTLSEnabled searches for wrapped TLS protocol in multiaddr. +func (a Address) IsTLSEnabled() bool { for _, protoc := range a.ma.Protocols() { if protoc.Code == multiaddr.P_TLS { return true diff --git a/pkg/network/tls_test.go b/pkg/network/tls_test.go index 25775eaf1..d93ea6a12 100644 --- a/pkg/network/tls_test.go +++ b/pkg/network/tls_test.go @@ -24,6 +24,6 @@ func TestAddress_TLSEnabled(t *testing.T) { err := addr.FromString(test.input) require.NoError(t, err) - require.Equal(t, test.wantTLS, addr.isTLSEnabled(), test.input) + require.Equal(t, test.wantTLS, addr.IsTLSEnabled(), test.input) } } diff --git a/pkg/services/container/morph/executor.go b/pkg/services/container/morph/executor.go index ae37da520..dec022219 100644 --- a/pkg/services/container/morph/executor.go +++ b/pkg/services/container/morph/executor.go @@ -52,7 +52,7 @@ func NewExecutor(rdr Reader, wrt Writer) containerSvc.ServiceExecutor { func (s *morphExecutor) Put(_ context.Context, tokV2 *sessionV2.Token, body *container.PutRequestBody) (*container.PutResponseBody, error) { sigV2 := body.GetSignature() if sigV2 == nil { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return nil, errors.New("missing signature") } @@ -206,7 +206,7 @@ func (s *morphExecutor) List(_ context.Context, body *container.ListRequestBody) func (s *morphExecutor) SetExtendedACL(_ context.Context, tokV2 *sessionV2.Token, body *container.SetExtendedACLRequestBody) (*container.SetExtendedACLResponseBody, error) { sigV2 := body.GetSignature() if sigV2 == nil { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return nil, errors.New("missing signature") } diff --git a/pkg/services/control/ir/server/sign.go b/pkg/services/control/ir/server/sign.go index 4ada98468..f72d51f9e 100644 --- a/pkg/services/control/ir/server/sign.go +++ b/pkg/services/control/ir/server/sign.go @@ -24,7 +24,7 @@ var errDisallowedKey = errors.New("key is not in the allowed list") func (s *Server) isValidRequest(req SignedMessage) error { sign := req.GetSignature() if sign == nil { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return errors.New("missing signature") } @@ -50,7 +50,7 @@ func (s *Server) isValidRequest(req SignedMessage) error { return fmt.Errorf("marshal request body: %w", err) } - // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion var sigV2 refs.Signature sigV2.SetKey(sign.GetKey()) sigV2.SetSign(sign.GetSign()) @@ -62,7 +62,7 @@ func (s *Server) isValidRequest(req SignedMessage) error { } if !sig.Verify(binBody) { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return errors.New("invalid signature") } @@ -83,7 +83,7 @@ func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error { return fmt.Errorf("calculate signature: %w", err) } - // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion var sigV2 refs.Signature sig.WriteToV2(&sigV2) diff --git a/pkg/services/control/server/sign.go b/pkg/services/control/server/sign.go index 726cdf341..acc405821 100644 --- a/pkg/services/control/server/sign.go +++ b/pkg/services/control/server/sign.go @@ -24,7 +24,7 @@ var errDisallowedKey = errors.New("key is not in the allowed list") func (s *Server) isValidRequest(req SignedMessage) error { sign := req.GetSignature() if sign == nil { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return errors.New("missing signature") } @@ -50,7 +50,7 @@ func (s *Server) isValidRequest(req SignedMessage) error { return fmt.Errorf("marshal request body: %w", err) } - // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion var sigV2 refs.Signature sigV2.SetKey(sign.GetKey()) sigV2.SetSign(sign.GetSign()) @@ -62,7 +62,7 @@ func (s *Server) isValidRequest(req SignedMessage) error { } if !sig.Verify(binBody) { - // TODO(@cthulhu-rider): #1387 use "const" error + // TODO(@cthulhu-rider): #468 use "const" error return errors.New("invalid signature") } @@ -83,7 +83,7 @@ func SignMessage(key *ecdsa.PrivateKey, msg SignedMessage) error { return fmt.Errorf("calculate signature: %w", err) } - // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion var sigV2 refs.Signature sig.WriteToV2(&sigV2) diff --git a/pkg/services/object/acl/v2/util.go b/pkg/services/object/acl/v2/util.go index aa5d67584..cd45b63fc 100644 --- a/pkg/services/object/acl/v2/util.go +++ b/pkg/services/object/acl/v2/util.go @@ -118,7 +118,7 @@ func ownerFromToken(token *sessionSDK.Object) (*user.ID, *keys.PublicKey, error) } // 2. Then check if session token owner issued the session token - // TODO(@cthulhu-rider): #1387 implement and use another approach to avoid conversion + // TODO(@cthulhu-rider): #468 implement and use another approach to avoid conversion var tokV2 sessionV2.Token token.WriteToV2(&tokV2) diff --git a/pkg/services/object/internal/client/client.go b/pkg/services/object/internal/client/client.go index 8214c784d..17bf6a40f 100644 --- a/pkg/services/object/internal/client/client.go +++ b/pkg/services/object/internal/client/client.go @@ -81,7 +81,7 @@ type readPrmCommon struct { // // By default current epoch on the server will be used. func (x *readPrmCommon) SetNetmapEpoch(_ uint64) { - // FIXME: (neofs-node#1194) not supported by client + // FIXME(@fyrchik): https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/465 } // GetObjectPrm groups parameters of GetObject operation. diff --git a/pkg/services/tree/cache.go b/pkg/services/tree/cache.go index 97218da08..ef0c4b465 100644 --- a/pkg/services/tree/cache.go +++ b/pkg/services/tree/cache.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "strings" "sync" "time" @@ -100,8 +99,7 @@ func dialTreeService(ctx context.Context, netmapAddr string) (*grpc.ClientConn, ), } - // FIXME(@fyrchik): ugly hack #1322 - if !strings.HasPrefix(netAddr.URIAddr(), "grpcs:") { + if netAddr.IsTLSEnabled() { opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials())) } diff --git a/pkg/services/tree/signature.go b/pkg/services/tree/signature.go index 976fc8d07..08aa226fa 100644 --- a/pkg/services/tree/signature.go +++ b/pkg/services/tree/signature.go @@ -159,7 +159,7 @@ func verifyMessage(m message) error { sig := m.GetSignature() - // TODO(@cthulhu-rider): #1387 use Signature message from NeoFS API to avoid conversion + // TODO(@cthulhu-rider): #468 use Signature message from FrostFS API to avoid conversion var sigV2 refs.Signature sigV2.SetKey(sig.GetKey()) sigV2.SetSign(sig.GetSign())