diff --git a/v2/accounting/grpc/service.pb.go b/v2/accounting/grpc/service.pb.go index aa9fdbea..af398bb5 100644 Binary files a/v2/accounting/grpc/service.pb.go and b/v2/accounting/grpc/service.pb.go differ diff --git a/v2/accounting/grpc/types.pb.go b/v2/accounting/grpc/types.pb.go new file mode 100644 index 00000000..cc84e871 Binary files /dev/null and b/v2/accounting/grpc/types.pb.go differ diff --git a/v2/container/convert.go b/v2/container/convert.go index 58d99da2..b5d829a8 100644 --- a/v2/container/convert.go +++ b/v2/container/convert.go @@ -116,8 +116,9 @@ func PutRequestBodyToGRPCMessage(r *PutRequestBody) *container.PutRequest_Body { ContainerToGRPCMessage(r.GetContainer()), ) - m.SetPublicKey(r.GetPublicKey()) - m.SetSignature(r.GetSignature()) + m.SetSignature( + service.SignatureToGRPCMessage(r.GetSignature()), + ) return m } @@ -133,8 +134,9 @@ func PutRequestBodyFromGRPCMessage(m *container.PutRequest_Body) *PutRequestBody ContainerFromGRPCMessage(m.GetContainer()), ) - r.SetPublicKey(m.GetPublicKey()) - r.SetSignature(m.GetSignature()) + r.SetSignature( + service.SignatureFromGRPCMessage(m.GetSignature()), + ) return r } @@ -362,7 +364,9 @@ func DeleteRequestBodyToGRPCMessage(r *DeleteRequestBody) *container.DeleteReque refs.ContainerIDToGRPCMessage(r.GetContainerID()), ) - m.SetSignature(r.GetSignature()) + m.SetSignature( + service.SignatureToGRPCMessage(r.GetSignature()), + ) return m } @@ -378,7 +382,9 @@ func DeleteRequestBodyFromGRPCMessage(m *container.DeleteRequest_Body) *DeleteRe refs.ContainerIDFromGRPCMessage(m.GetContainerId()), ) - r.SetSignature(m.GetSignature()) + r.SetSignature( + service.SignatureFromGRPCMessage(m.GetSignature()), + ) return r } @@ -608,7 +614,8 @@ func SetExtendedACLRequestBodyToGRPCMessage(r *SetExtendedACLRequestBody) *conta acl.TableToGRPCMessage(r.GetEACL()), ) - m.SetSignature(r.GetSignature()) + m.SetSignature( + service.SignatureToGRPCMessage(r.GetSignature())) return m } @@ -624,6 +631,10 @@ func SetExtendedACLRequestBodyFromGRPCMessage(m *container.SetExtendedACLRequest acl.TableFromGRPCMessage(m.GetEacl()), ) + r.SetSignature( + service.SignatureFromGRPCMessage(m.GetSignature()), + ) + return r } @@ -782,7 +793,9 @@ func GetExtendedACLResponseBodyToGRPCMessage(r *GetExtendedACLResponseBody) *con acl.TableToGRPCMessage(r.GetEACL()), ) - m.SetSignature(r.GetSignature()) + m.SetSignature( + service.SignatureToGRPCMessage(r.GetSignature()), + ) return m } @@ -798,7 +811,9 @@ func GetExtendedACLResponseBodyFromGRPCMessage(m *container.GetExtendedACLRespon acl.TableFromGRPCMessage(m.GetEacl()), ) - r.SetSignature(m.GetSignature()) + r.SetSignature( + service.SignatureFromGRPCMessage(m.GetSignature()), + ) return r } diff --git a/v2/container/grpc/service.go b/v2/container/grpc/service.go index 3cbbe588..f92501fb 100644 --- a/v2/container/grpc/service.go +++ b/v2/container/grpc/service.go @@ -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. -func (m *PutRequest_Body) SetSignature(v []byte) { +func (m *PutRequest_Body) SetSignature(v *service.Signature) { if m != nil { m.Signature = v } @@ -84,7 +77,7 @@ func (m *DeleteRequest_Body) SetContainerId(v *refs.ContainerID) { } // 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 { m.Signature = v } @@ -250,7 +243,7 @@ func (m *SetExtendedACLRequest_Body) SetEacl(v *acl.EACLTable) { } // 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 { m.Signature = v } @@ -334,7 +327,7 @@ func (m *GetExtendedACLResponse_Body) SetEacl(v *acl.EACLTable) { } // 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 { m.Signature = v } diff --git a/v2/container/grpc/service.pb.go b/v2/container/grpc/service.pb.go index c5ae4734..04a48a89 100644 Binary files a/v2/container/grpc/service.pb.go and b/v2/container/grpc/service.pb.go differ diff --git a/v2/container/grpc/types.pb.go b/v2/container/grpc/types.pb.go index f2b17332..97979f19 100644 Binary files a/v2/container/grpc/types.pb.go and b/v2/container/grpc/types.pb.go differ diff --git a/v2/container/types.go b/v2/container/types.go index 80dbcbf6..033273ff 100644 --- a/v2/container/types.go +++ b/v2/container/types.go @@ -28,9 +28,7 @@ type Container struct { type PutRequestBody struct { cnr *Container - pubKey []byte - - sig []byte + sig *service.Signature } type PutRequest struct { @@ -80,7 +78,7 @@ type GetResponse struct { type DeleteRequestBody struct { cid *refs.ContainerID - sig []byte + sig *service.Signature } type DeleteRequest struct { @@ -128,7 +126,7 @@ type ListResponse struct { type SetExtendedACLRequestBody struct { eacl *acl.Table - sig []byte + sig *service.Signature } type SetExtendedACLRequest struct { @@ -164,7 +162,7 @@ type GetExtendedACLRequest struct { type GetExtendedACLResponseBody struct { eacl *acl.Table - sig []byte + sig *service.Signature } type GetExtendedACLResponse struct { @@ -301,21 +299,7 @@ func (r *PutRequestBody) SetContainer(v *Container) { } } -func (r *PutRequestBody) GetPublicKey() []byte { - 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 { +func (r *PutRequestBody) GetSignature() *service.Signature { if r != nil { return r.sig } @@ -323,7 +307,7 @@ func (r *PutRequestBody) GetSignature() []byte { return nil } -func (r *PutRequestBody) SetSignature(v []byte) { +func (r *PutRequestBody) SetSignature(v *service.Signature) { if r != nil { 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 { return r.sig } @@ -561,7 +545,7 @@ func (r *DeleteRequestBody) GetSignature() []byte { return nil } -func (r *DeleteRequestBody) SetSignature(v []byte) { +func (r *DeleteRequestBody) SetSignature(v *service.Signature) { if r != nil { 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 { return r.sig } @@ -785,7 +769,7 @@ func (r *SetExtendedACLRequestBody) GetSignature() []byte { return nil } -func (r *SetExtendedACLRequestBody) SetSignature(v []byte) { +func (r *SetExtendedACLRequestBody) SetSignature(v *service.Signature) { if r != nil { 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 { return r.sig } @@ -953,7 +937,7 @@ func (r *GetExtendedACLResponseBody) GetSignature() []byte { return nil } -func (r *GetExtendedACLResponseBody) SetSignature(v []byte) { +func (r *GetExtendedACLResponseBody) SetSignature(v *service.Signature) { if r != nil { r.sig = v } diff --git a/v2/object/convert.go b/v2/object/convert.go index 0517efa5..69df7989 100644 --- a/v2/object/convert.go +++ b/v2/object/convert.go @@ -758,10 +758,6 @@ func DeleteRequestBodyToGRPCMessage(r *DeleteRequestBody) *object.DeleteRequest_ refs.AddressToGRPCMessage(r.GetAddress()), ) - m.SetOwnerId( - refs.OwnerIDToGRPCMessage(r.GetOwnerID()), - ) - return m } @@ -776,10 +772,6 @@ func DeleteRequestBodyFromGRPCMessage(m *object.DeleteRequest_Body) *DeleteReque refs.AddressFromGRPCMessage(m.GetAddress()), ) - r.SetOwnerID( - refs.OwnerIDFromGRPCMessage(m.GetOwnerId()), - ) - return r } diff --git a/v2/object/grpc/service.go b/v2/object/grpc/service.go index 09e058ad..3ec97fc1 100644 --- a/v2/object/grpc/service.go +++ b/v2/object/grpc/service.go @@ -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. func (m *DeleteRequest) SetBody(v *DeleteRequest_Body) { if m != nil { diff --git a/v2/object/grpc/service.pb.go b/v2/object/grpc/service.pb.go index 5a398c60..4b3964de 100644 Binary files a/v2/object/grpc/service.pb.go and b/v2/object/grpc/service.pb.go differ diff --git a/v2/object/grpc/types.pb.go b/v2/object/grpc/types.pb.go index 2ba1d5ac..e6163583 100644 Binary files a/v2/object/grpc/types.pb.go and b/v2/object/grpc/types.pb.go differ diff --git a/v2/service/convert.go b/v2/service/convert.go index 93313ff9..6bffe276 100644 --- a/v2/service/convert.go +++ b/v2/service/convert.go @@ -546,54 +546,54 @@ func ResponseHeadersFromGRPC( ) } -func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) service.ObjectServiceContext_Verb { +func ObjectSessionVerbToGRPCField(v ObjectSessionVerb) service.ObjectSessionContext_Verb { switch v { case ObjectVerbPut: - return service.ObjectServiceContext_PUT + return service.ObjectSessionContext_PUT case ObjectVerbGet: - return service.ObjectServiceContext_GET + return service.ObjectSessionContext_GET case ObjectVerbHead: - return service.ObjectServiceContext_HEAD + return service.ObjectSessionContext_HEAD case ObjectVerbSearch: - return service.ObjectServiceContext_SEARCH + return service.ObjectSessionContext_SEARCH case ObjectVerbDelete: - return service.ObjectServiceContext_DELETE + return service.ObjectSessionContext_DELETE case ObjectVerbRange: - return service.ObjectServiceContext_RANGE + return service.ObjectSessionContext_RANGE case ObjectVerbRangeHash: - return service.ObjectServiceContext_RANGEHASH + return service.ObjectSessionContext_RANGEHASH 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 { - case service.ObjectServiceContext_PUT: + case service.ObjectSessionContext_PUT: return ObjectVerbPut - case service.ObjectServiceContext_GET: + case service.ObjectSessionContext_GET: return ObjectVerbGet - case service.ObjectServiceContext_HEAD: + case service.ObjectSessionContext_HEAD: return ObjectVerbHead - case service.ObjectServiceContext_SEARCH: + case service.ObjectSessionContext_SEARCH: return ObjectVerbSearch - case service.ObjectServiceContext_DELETE: + case service.ObjectSessionContext_DELETE: return ObjectVerbDelete - case service.ObjectServiceContext_RANGE: + case service.ObjectSessionContext_RANGE: return ObjectVerbRange - case service.ObjectServiceContext_RANGEHASH: + case service.ObjectSessionContext_RANGEHASH: return ObjectVerbRangeHash default: return ObjectVerbUnknown } } -func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *service.ObjectServiceContext { +func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *service.ObjectSessionContext { if c == nil { return nil } - m := new(service.ObjectServiceContext) + m := new(service.ObjectSessionContext) m.SetVerb( ObjectSessionVerbToGRPCField(c.GetVerb()), @@ -606,7 +606,7 @@ func ObjectSessionContextToGRPCMessage(c *ObjectSessionContext) *service.ObjectS return m } -func ObjectSessionContextFromGRPCMessage(m *service.ObjectServiceContext) *ObjectSessionContext { +func ObjectSessionContextFromGRPCMessage(m *service.ObjectSessionContext) *ObjectSessionContext { if m == nil { return nil } @@ -665,9 +665,9 @@ func SessionTokenBodyFromGRPCMessage(m *service.SessionToken_Body) *SessionToken switch v := m.GetContext().(type) { case nil: - case *service.SessionToken_Body_ObjectService: + case *service.SessionToken_Body_Object: t.SetContext( - ObjectSessionContextFromGRPCMessage(v.ObjectService), + ObjectSessionContextFromGRPCMessage(v.Object), ) default: panic(fmt.Sprintf("unknown session context %T", v)) diff --git a/v2/service/grpc/meta.go b/v2/service/grpc/meta.go index 730b4371..9f5c1922 100644 --- a/v2/service/grpc/meta.go +++ b/v2/service/grpc/meta.go @@ -83,23 +83,23 @@ func (m *SessionToken_Body) SetSessionKey(v []byte) { } // 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 { - m.Context = &SessionToken_Body_ObjectService{ - ObjectService: v, + m.Context = &SessionToken_Body_Object{ + Object: v, } } } // 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 { m.Address = v } } // 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 { m.Verb = v } diff --git a/v2/service/grpc/meta.pb.go b/v2/service/grpc/types.pb.go similarity index 60% rename from v2/service/grpc/meta.pb.go rename to v2/service/grpc/types.pb.go index 5c8c90f3..4190b29b 100644 Binary files a/v2/service/grpc/meta.pb.go and b/v2/service/grpc/types.pb.go differ diff --git a/v2/service/grpc/verify.pb.go b/v2/service/grpc/verify.pb.go deleted file mode 100644 index 4c205158..00000000 Binary files a/v2/service/grpc/verify.pb.go and /dev/null differ diff --git a/v2/service/marshal_test.go b/v2/service/marshal_test.go index 35ad8fbd..63030ae4 100644 --- a/v2/service/marshal_test.go +++ b/v2/service/marshal_test.go @@ -77,7 +77,7 @@ func TestTokenLifetime_StableMarshal(t *testing.T) { func TestObjectSessionContext_StableMarshal(t *testing.T) { objectCtxFrom := generateObjectCtx("Object ID") - transport := new(grpc.ObjectServiceContext) + transport := new(grpc.ObjectSessionContext) t.Run("non empty", func(t *testing.T) { wire, err := objectCtxFrom.StableMarshal(nil) diff --git a/v2/session/grpc/service.pb.go b/v2/session/grpc/service.pb.go index 7dd61a38..da92abec 100644 Binary files a/v2/session/grpc/service.pb.go and b/v2/session/grpc/service.pb.go differ