Pick up leftovers for rebranding #467

Merged
fyrchik merged 7 commits from fyrchik/frostfs-node:rebranding-tails into master 2023-06-28 12:13:23 +00:00
28 changed files with 40 additions and 81 deletions

View file

@ -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"]

View file

@ -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

View file

@ -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)
}
})

View file

@ -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())
}
}

View file

@ -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())

View file

@ -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)

View file

@ -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)
}
}

View file

@ -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")
}

View file

@ -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, "+

5
go.mod
View file

@ -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.
)
Review


View file

@ -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")
}

View file

@ -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")
}

View file

@ -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)
}

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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
}

View file

@ -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.

View file

@ -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

View file

@ -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)
}
}

View file

@ -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")
}

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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.

View file

@ -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()))
}

View file

@ -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())