Update neofs-api to latest jindo version

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-08-18 15:48:39 +03:00 committed by Stanislav Bogatyrev
parent c3604d00f0
commit c94cb44b58
17 changed files with 68 additions and 91 deletions

Binary file not shown.

Binary file not shown.

View file

@ -116,8 +116,9 @@ func PutRequestBodyToGRPCMessage(r *PutRequestBody) *container.PutRequest_Body {
ContainerToGRPCMessage(r.GetContainer()), ContainerToGRPCMessage(r.GetContainer()),
) )
m.SetPublicKey(r.GetPublicKey()) m.SetSignature(
m.SetSignature(r.GetSignature()) service.SignatureToGRPCMessage(r.GetSignature()),
)
return m return m
} }
@ -133,8 +134,9 @@ func PutRequestBodyFromGRPCMessage(m *container.PutRequest_Body) *PutRequestBody
ContainerFromGRPCMessage(m.GetContainer()), ContainerFromGRPCMessage(m.GetContainer()),
) )
r.SetPublicKey(m.GetPublicKey()) r.SetSignature(
r.SetSignature(m.GetSignature()) service.SignatureFromGRPCMessage(m.GetSignature()),
)
return r return r
} }
@ -362,7 +364,9 @@ func DeleteRequestBodyToGRPCMessage(r *DeleteRequestBody) *container.DeleteReque
refs.ContainerIDToGRPCMessage(r.GetContainerID()), refs.ContainerIDToGRPCMessage(r.GetContainerID()),
) )
m.SetSignature(r.GetSignature()) m.SetSignature(
service.SignatureToGRPCMessage(r.GetSignature()),
)
return m return m
} }
@ -378,7 +382,9 @@ func DeleteRequestBodyFromGRPCMessage(m *container.DeleteRequest_Body) *DeleteRe
refs.ContainerIDFromGRPCMessage(m.GetContainerId()), refs.ContainerIDFromGRPCMessage(m.GetContainerId()),
) )
r.SetSignature(m.GetSignature()) r.SetSignature(
service.SignatureFromGRPCMessage(m.GetSignature()),
)
return r return r
} }
@ -608,7 +614,8 @@ func SetExtendedACLRequestBodyToGRPCMessage(r *SetExtendedACLRequestBody) *conta
acl.TableToGRPCMessage(r.GetEACL()), acl.TableToGRPCMessage(r.GetEACL()),
) )
m.SetSignature(r.GetSignature()) m.SetSignature(
service.SignatureToGRPCMessage(r.GetSignature()))
return m return m
} }
@ -624,6 +631,10 @@ func SetExtendedACLRequestBodyFromGRPCMessage(m *container.SetExtendedACLRequest
acl.TableFromGRPCMessage(m.GetEacl()), acl.TableFromGRPCMessage(m.GetEacl()),
) )
r.SetSignature(
service.SignatureFromGRPCMessage(m.GetSignature()),
)
return r return r
} }
@ -782,7 +793,9 @@ func GetExtendedACLResponseBodyToGRPCMessage(r *GetExtendedACLResponseBody) *con
acl.TableToGRPCMessage(r.GetEACL()), acl.TableToGRPCMessage(r.GetEACL()),
) )
m.SetSignature(r.GetSignature()) m.SetSignature(
service.SignatureToGRPCMessage(r.GetSignature()),
)
return m return m
} }
@ -798,7 +811,9 @@ func GetExtendedACLResponseBodyFromGRPCMessage(m *container.GetExtendedACLRespon
acl.TableFromGRPCMessage(m.GetEacl()), acl.TableFromGRPCMessage(m.GetEacl()),
) )
r.SetSignature(m.GetSignature()) r.SetSignature(
service.SignatureFromGRPCMessage(m.GetSignature()),
)
return r return r
} }

View file

@ -13,15 +13,8 @@ func (m *PutRequest_Body) SetContainer(v *Container) {
} }
} }
// SetPublicKey sets public key of the container owner.
func (m *PutRequest_Body) SetPublicKey(v []byte) {
if m != nil {
m.PublicKey = v
}
}
// SetSignature sets signature of the container structure. // SetSignature sets signature of the container structure.
func (m *PutRequest_Body) SetSignature(v []byte) { func (m *PutRequest_Body) SetSignature(v *service.Signature) {
if m != nil { if m != nil {
m.Signature = v m.Signature = v
} }
@ -84,7 +77,7 @@ func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) {
} }
// SetSignature sets signature of the container identifier. // SetSignature sets signature of the container identifier.
func (m *DeleteRequest_Body) SetSignature(v []byte) { func (m *DeleteRequest_Body) SetSignature(v *service.Signature) {
if m != nil { if m != nil {
m.Signature = v m.Signature = v
} }
@ -250,7 +243,7 @@ func (m *SetExtendedACLRequest_Body) SetEacl(v *acl.EACLTable) {
} }
// SetSignature sets signature of the eACL table. // SetSignature sets signature of the eACL table.
func (m *SetExtendedACLRequest_Body) SetSignature(v []byte) { func (m *SetExtendedACLRequest_Body) SetSignature(v *service.Signature) {
if m != nil { if m != nil {
m.Signature = v m.Signature = v
} }
@ -334,7 +327,7 @@ func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) {
} }
// SetSignature sets signature of the eACL table. // SetSignature sets signature of the eACL table.
func (m *GetExtendedACLResponse_Body) SetSignature(v []byte) { func (m *GetExtendedACLResponse_Body) SetSignature(v *service.Signature) {
if m != nil { if m != nil {
m.Signature = v m.Signature = v
} }

Binary file not shown.

Binary file not shown.

View file

@ -28,9 +28,7 @@ type Container struct {
type PutRequestBody struct { type PutRequestBody struct {
cnr *Container cnr *Container
pubKey []byte sig *service.Signature
sig []byte
} }
type PutRequest struct { type PutRequest struct {
@ -80,7 +78,7 @@ type GetResponse struct {
type DeleteRequestBody struct { type DeleteRequestBody struct {
cid *refs.ContainerID cid *refs.ContainerID
sig []byte sig *service.Signature
} }
type DeleteRequest struct { type DeleteRequest struct {
@ -128,7 +126,7 @@ type ListResponse struct {
type SetExtendedACLRequestBody struct { type SetExtendedACLRequestBody struct {
eacl *acl.Table eacl *acl.Table
sig []byte sig *service.Signature
} }
type SetExtendedACLRequest struct { type SetExtendedACLRequest struct {
@ -164,7 +162,7 @@ type GetExtendedACLRequest struct {
type GetExtendedACLResponseBody struct { type GetExtendedACLResponseBody struct {
eacl *acl.Table eacl *acl.Table
sig []byte sig *service.Signature
} }
type GetExtendedACLResponse struct { type GetExtendedACLResponse struct {
@ -301,21 +299,7 @@ func (r *PutRequestBody) SetContainer(v *Container) {
} }
} }
func (r *PutRequestBody) GetPublicKey() []byte { func (r *PutRequestBody) GetSignature() *service.Signature {
if r != nil {
return r.pubKey
}
return nil
}
func (r *PutRequestBody) SetPublicKey(v []byte) {
if r != nil {
r.pubKey = v
}
}
func (r *PutRequestBody) GetSignature() []byte {
if r != nil { if r != nil {
return r.sig return r.sig
} }
@ -323,7 +307,7 @@ func (r *PutRequestBody) GetSignature() []byte {
return nil return nil
} }
func (r *PutRequestBody) SetSignature(v []byte) { func (r *PutRequestBody) SetSignature(v *service.Signature) {
if r != nil { if r != nil {
r.sig = v r.sig = v
} }
@ -553,7 +537,7 @@ func (r *DeleteRequestBody) SetContainerID(v *refs.ContainerID) {
} }
} }
func (r *DeleteRequestBody) GetSignature() []byte { func (r *DeleteRequestBody) GetSignature() *service.Signature {
if r != nil { if r != nil {
return r.sig return r.sig
} }
@ -561,7 +545,7 @@ func (r *DeleteRequestBody) GetSignature() []byte {
return nil return nil
} }
func (r *DeleteRequestBody) SetSignature(v []byte) { func (r *DeleteRequestBody) SetSignature(v *service.Signature) {
if r != nil { if r != nil {
r.sig = v r.sig = v
} }
@ -777,7 +761,7 @@ func (r *SetExtendedACLRequestBody) SetEACL(v *acl.Table) {
} }
} }
func (r *SetExtendedACLRequestBody) GetSignature() []byte { func (r *SetExtendedACLRequestBody) GetSignature() *service.Signature {
if r != nil { if r != nil {
return r.sig return r.sig
} }
@ -785,7 +769,7 @@ func (r *SetExtendedACLRequestBody) GetSignature() []byte {
return nil return nil
} }
func (r *SetExtendedACLRequestBody) SetSignature(v []byte) { func (r *SetExtendedACLRequestBody) SetSignature(v *service.Signature) {
if r != nil { if r != nil {
r.sig = v r.sig = v
} }
@ -945,7 +929,7 @@ func (r *GetExtendedACLResponseBody) SetEACL(v *acl.Table) {
} }
} }
func (r *GetExtendedACLResponseBody) GetSignature() []byte { func (r *GetExtendedACLResponseBody) GetSignature() *service.Signature {
if r != nil { if r != nil {
return r.sig return r.sig
} }
@ -953,7 +937,7 @@ func (r *GetExtendedACLResponseBody) GetSignature() []byte {
return nil return nil
} }
func (r *GetExtendedACLResponseBody) SetSignature(v []byte) { func (r *GetExtendedACLResponseBody) SetSignature(v *service.Signature) {
if r != nil { if r != nil {
r.sig = v r.sig = v
} }

View file

@ -758,10 +758,6 @@ func DeleteRequestBodyToGRPCMessage(r *DeleteRequestBody) *object.DeleteRequest_
refs.AddressToGRPCMessage(r.GetAddress()), refs.AddressToGRPCMessage(r.GetAddress()),
) )
m.SetOwnerId(
refs.OwnerIDToGRPCMessage(r.GetOwnerID()),
)
return m return m
} }
@ -776,10 +772,6 @@ func DeleteRequestBodyFromGRPCMessage(m *object.DeleteRequest_Body) *DeleteReque
refs.AddressFromGRPCMessage(m.GetAddress()), refs.AddressFromGRPCMessage(m.GetAddress()),
) )
r.SetOwnerID(
refs.OwnerIDFromGRPCMessage(m.GetOwnerId()),
)
return r return r
} }

View file

@ -230,13 +230,6 @@ func (m *DeleteRequest_Body) SetAddress(v *refs.Address) {
} }
} }
// SetOwnerId sets identifier of the removing object owner.
func (m *DeleteRequest_Body) SetOwnerId(v *refs.OwnerID) {
if m != nil {
m.OwnerId = v
}
}
// SetBody sets body of the request. // SetBody sets body of the request.
func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) {
if m != nil { if m != nil {

Binary file not shown.

Binary file not shown.

View file

@ -546,54 +546,54 @@ func ResponseHeadersFromGRPC(
) )
} }
func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) service.ObjectServiceContext_Verb { func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) service.ObjectSessionContext_Verb {
switch v { switch v {
case ObjectVerbPut: case ObjectVerbPut:
return service.ObjectServiceContext_PUT return service.ObjectSessionContext_PUT
case ObjectVerbGet: case ObjectVerbGet:
return service.ObjectServiceContext_GET return service.ObjectSessionContext_GET
case ObjectVerbHead: case ObjectVerbHead:
return service.ObjectServiceContext_HEAD return service.ObjectSessionContext_HEAD
case ObjectVerbSearch: case ObjectVerbSearch:
return service.ObjectServiceContext_SEARCH return service.ObjectSessionContext_SEARCH
case ObjectVerbDelete: case ObjectVerbDelete:
return service.ObjectServiceContext_DELETE return service.ObjectSessionContext_DELETE
case ObjectVerbRange: case ObjectVerbRange:
return service.ObjectServiceContext_RANGE return service.ObjectSessionContext_RANGE
case ObjectVerbRangeHash: case ObjectVerbRangeHash:
return service.ObjectServiceContext_RANGEHASH return service.ObjectSessionContext_RANGEHASH
default: default:
return service.ObjectServiceContext_VERB_UNSPECIFIED return service.ObjectSessionContext_VERB_UNSPECIFIED
} }
} }
func ObjectSessionVerbFromGRPCField(v service.ObjectServiceContext_Verb) ObjectSessionVerb { func ObjectSessionVerbFromGRPCField(v service.ObjectSessionContext_Verb) ObjectSessionVerb {
switch v { switch v {
case service.ObjectServiceContext_PUT: case service.ObjectSessionContext_PUT:
return ObjectVerbPut return ObjectVerbPut
case service.ObjectServiceContext_GET: case service.ObjectSessionContext_GET:
return ObjectVerbGet return ObjectVerbGet
case service.ObjectServiceContext_HEAD: case service.ObjectSessionContext_HEAD:
return ObjectVerbHead return ObjectVerbHead
case service.ObjectServiceContext_SEARCH: case service.ObjectSessionContext_SEARCH:
return ObjectVerbSearch return ObjectVerbSearch
case service.ObjectServiceContext_DELETE: case service.ObjectSessionContext_DELETE:
return ObjectVerbDelete return ObjectVerbDelete
case service.ObjectServiceContext_RANGE: case service.ObjectSessionContext_RANGE:
return ObjectVerbRange return ObjectVerbRange
case service.ObjectServiceContext_RANGEHASH: case service.ObjectSessionContext_RANGEHASH:
return ObjectVerbRangeHash return ObjectVerbRangeHash
default: default:
return ObjectVerbUnknown return ObjectVerbUnknown
} }
} }
func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *service.ObjectServiceContext { func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *service.ObjectSessionContext {
if c == nil { if c == nil {
return nil return nil
} }
m := new(service.ObjectServiceContext) m := new(service.ObjectSessionContext)
m.SetVerb( m.SetVerb(
ObjectSessionVerbToGRPCField(c.GetVerb()), ObjectSessionVerbToGRPCField(c.GetVerb()),
@ -606,7 +606,7 @@ func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *service.ObjectS
return m return m
} }
func ObjectSessionContextFromGRPCMessage(m *service.ObjectServiceContext) *ObjectSessionContext { func ObjectSessionContextFromGRPCMessage(m *service.ObjectSessionContext) *ObjectSessionContext {
if m == nil { if m == nil {
return nil return nil
} }
@ -665,9 +665,9 @@ func SessionTokenBodyFromGRPCMessage(m *service.SessionToken_Body) *SessionToken
switch v := m.GetContext().(type) { switch v := m.GetContext().(type) {
case nil: case nil:
case *service.SessionToken_Body_ObjectService: case *service.SessionToken_Body_Object:
t.SetContext( t.SetContext(
ObjectSessionContextFromGRPCMessage(v.ObjectService), ObjectSessionContextFromGRPCMessage(v.Object),
) )
default: default:
panic(fmt.Sprintf("unknown session context %T", v)) panic(fmt.Sprintf("unknown session context %T", v))

View file

@ -83,23 +83,23 @@ func (m *SessionToken_Body) SetSessionKey(v []byte) {
} }
// SetObjectAddressContext sets object context of the session token. // SetObjectAddressContext sets object context of the session token.
func (m *SessionToken_Body) SetObjectServiceContext(v *ObjectServiceContext) { func (m *SessionToken_Body) SetObjectServiceContext(v *ObjectSessionContext) {
if m != nil { if m != nil {
m.Context = &SessionToken_Body_ObjectService{ m.Context = &SessionToken_Body_Object{
ObjectService: v, Object: v,
} }
} }
} }
// SetObjectAddressContext sets object context of the session token. // SetObjectAddressContext sets object context of the session token.
func (m *ObjectServiceContext) SetAddress(v *refs.Address) { func (m *ObjectSessionContext) SetAddress(v *refs.Address) {
if m != nil { if m != nil {
m.Address = v m.Address = v
} }
} }
// SetObjectAddressContext sets object context of the session token. // SetObjectAddressContext sets object context of the session token.
func (m *ObjectServiceContext) SetVerb(v ObjectServiceContext_Verb) { func (m *ObjectSessionContext) SetVerb(v ObjectSessionContext_Verb) {
if m != nil { if m != nil {
m.Verb = v m.Verb = v
} }

Binary file not shown.

View file

@ -77,7 +77,7 @@ func TestTokenLifetime_StableMarshal(t *testing.T) {
func TestObjectSessionContext_StableMarshal(t *testing.T) { func TestObjectSessionContext_StableMarshal(t *testing.T) {
objectCtxFrom := generateObjectCtx("Object ID") objectCtxFrom := generateObjectCtx("Object ID")
transport := new(grpc.ObjectServiceContext) transport := new(grpc.ObjectSessionContext)
t.Run("non empty", func(t *testing.T) { t.Run("non empty", func(t *testing.T) {
wire, err := objectCtxFrom.StableMarshal(nil) wire, err := objectCtxFrom.StableMarshal(nil)

Binary file not shown.