From 260d9c49a8e17b5c3b5fbb74644930b582902983 Mon Sep 17 00:00:00 2001 From: Michal Niewrzal Date: Tue, 16 Jul 2019 12:39:23 +0200 Subject: [PATCH] Metainfo RPC objects methods (#2534) --- internal/testrand/rand.go | 6 +- pkg/auth/signing/encode.go | 11 + pkg/auth/signing/sign.go | 18 + pkg/auth/signing/verify.go | 11 + pkg/pb/metainfo.pb.go | 1285 +++++++++++++++++++++++++-- pkg/pb/metainfo.proto | 133 +++ pkg/pb/types.go | 3 + pkg/storj/encryption.go | 78 ++ pkg/storj/object_list_item.go | 20 + pkg/storj/streamid.go | 14 +- pkg/storj/streamid_test.go | 26 +- proto.lock | 583 ++++++++++++ satellite/metainfo/metainfo.go | 257 +++++- satellite/metainfo/metainfo_test.go | 101 +++ satellite/peer.go | 1 + uplink/metainfo/client.go | 100 +++ 16 files changed, 2527 insertions(+), 120 deletions(-) create mode 100644 pkg/storj/object_list_item.go diff --git a/internal/testrand/rand.go b/internal/testrand/rand.go index c6b479f6d..8a03bb314 100644 --- a/internal/testrand/rand.go +++ b/internal/testrand/rand.go @@ -94,10 +94,8 @@ func SerialNumber() storj.SerialNumber { } // StreamID creates a random stream ID -func StreamID() storj.StreamID { - var streamID storj.StreamID - Read(streamID[:]) - return streamID +func StreamID(size int) storj.StreamID { + return storj.StreamID(BytesInt(size)) } // UUID creates a random uuid. diff --git a/pkg/auth/signing/encode.go b/pkg/auth/signing/encode.go index e89f2b771..21b84e1e2 100644 --- a/pkg/auth/signing/encode.go +++ b/pkg/auth/signing/encode.go @@ -88,3 +88,14 @@ func EncodeVoucher(ctx context.Context, voucher *pb.Voucher) (_ []byte, err erro voucher.SatelliteSignature = signature return out, err } + +// EncodeStreamID encodes stream ID into bytes for signing. +func EncodeStreamID(ctx context.Context, streamID *pb.SatStreamID) (_ []byte, err error) { + defer mon.Task()(&ctx)(&err) + signature := streamID.SatelliteSignature + // TODO verify if that can cause race + streamID.SatelliteSignature = nil + out, err := proto.Marshal(streamID) + streamID.SatelliteSignature = signature + return out, err +} diff --git a/pkg/auth/signing/sign.go b/pkg/auth/signing/sign.go index e78b4353a..1fdbb92de 100644 --- a/pkg/auth/signing/sign.go +++ b/pkg/auth/signing/sign.go @@ -109,3 +109,21 @@ func SignVoucher(ctx context.Context, signer Signer, unsigned *pb.Voucher) (_ *p return &signed, nil } + +// SignStreamID signs the stream ID using the specified signer +// Signer is a satellite +func SignStreamID(ctx context.Context, signer Signer, unsigned *pb.SatStreamID) (_ *pb.SatStreamID, err error) { + defer mon.Task()(&ctx)(&err) + bytes, err := EncodeStreamID(ctx, unsigned) + if err != nil { + return nil, Error.Wrap(err) + } + + signed := *unsigned + signed.SatelliteSignature, err = signer.HashAndSign(ctx, bytes) + if err != nil { + return nil, Error.Wrap(err) + } + + return &signed, nil +} diff --git a/pkg/auth/signing/verify.go b/pkg/auth/signing/verify.go index 38e666b5c..fff0498ab 100644 --- a/pkg/auth/signing/verify.go +++ b/pkg/auth/signing/verify.go @@ -82,3 +82,14 @@ func VerifyVoucher(ctx context.Context, satellite Signee, signed *pb.Voucher) (e return satellite.HashAndVerifySignature(ctx, bytes, signed.SatelliteSignature) } + +// VerifyStreamID verifies that the signature inside stream ID belongs to the satellite +func VerifyStreamID(ctx context.Context, satellite Signee, signed *pb.SatStreamID) (err error) { + defer mon.Task()(&ctx)(&err) + bytes, err := EncodeStreamID(ctx, signed) + if err != nil { + return Error.Wrap(err) + } + + return satellite.HashAndVerifySignature(ctx, bytes, signed.SatelliteSignature) +} diff --git a/pkg/pb/metainfo.pb.go b/pkg/pb/metainfo.pb.go index e43919472..e01175d8c 100644 --- a/pkg/pb/metainfo.pb.go +++ b/pkg/pb/metainfo.pb.go @@ -26,6 +26,40 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +type Object_Status int32 + +const ( + Object_INVALID Object_Status = 0 + Object_UPLOADING Object_Status = 1 + Object_COMMITTING Object_Status = 2 + Object_COMMITTED Object_Status = 3 + Object_DELETING Object_Status = 4 +) + +var Object_Status_name = map[int32]string{ + 0: "INVALID", + 1: "UPLOADING", + 2: "COMMITTING", + 3: "COMMITTED", + 4: "DELETING", +} + +var Object_Status_value = map[string]int32{ + "INVALID": 0, + "UPLOADING": 1, + "COMMITTING": 2, + "COMMITTED": 3, + "DELETING": 4, +} + +func (x Object_Status) String() string { + return proto.EnumName(Object_Status_name, int32(x)) +} + +func (Object_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{29, 0} +} + type Bucket struct { Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` PathCipher CipherSuite `protobuf:"varint,2,opt,name=path_cipher,json=pathCipher,proto3,enum=encryption.CipherSuite" json:"path_cipher,omitempty"` @@ -1466,7 +1500,845 @@ func (m *ProjectInfoResponse) GetProjectSalt() []byte { return nil } +type Object struct { + Bucket []byte `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + EncryptedPath []byte `protobuf:"bytes,2,opt,name=encrypted_path,json=encryptedPath,proto3" json:"encrypted_path,omitempty"` + Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Status Object_Status `protobuf:"varint,4,opt,name=status,proto3,enum=metainfo.Object_Status" json:"status,omitempty"` + StreamId StreamID `protobuf:"bytes,5,opt,name=stream_id,json=streamId,proto3,customtype=StreamID" json:"stream_id"` + CreatedAt time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` + StatusAt time.Time `protobuf:"bytes,7,opt,name=status_at,json=statusAt,proto3,stdtime" json:"status_at"` + ExpiresAt time.Time `protobuf:"bytes,8,opt,name=expires_at,json=expiresAt,proto3,stdtime" json:"expires_at"` + EncryptedMetadataNonce Nonce `protobuf:"bytes,9,opt,name=encrypted_metadata_nonce,json=encryptedMetadataNonce,proto3,customtype=Nonce" json:"encrypted_metadata_nonce"` + EncryptedMetadata []byte `protobuf:"bytes,10,opt,name=encrypted_metadata,json=encryptedMetadata,proto3" json:"encrypted_metadata,omitempty"` + FixedSegmentSize int64 `protobuf:"varint,11,opt,name=fixed_segment_size,json=fixedSegmentSize,proto3" json:"fixed_segment_size,omitempty"` + RedundancyScheme *RedundancyScheme `protobuf:"bytes,12,opt,name=redundancy_scheme,json=redundancyScheme,proto3" json:"redundancy_scheme,omitempty"` + EncryptionParameters *EncryptionParameters `protobuf:"bytes,13,opt,name=encryption_parameters,json=encryptionParameters,proto3" json:"encryption_parameters,omitempty"` + TotalSize int64 `protobuf:"varint,14,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` + InlineSize int64 `protobuf:"varint,15,opt,name=inline_size,json=inlineSize,proto3" json:"inline_size,omitempty"` + RemoteSize int64 `protobuf:"varint,16,opt,name=remote_size,json=remoteSize,proto3" json:"remote_size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Object) Reset() { *m = Object{} } +func (m *Object) String() string { return proto.CompactTextString(m) } +func (*Object) ProtoMessage() {} +func (*Object) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{29} +} +func (m *Object) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Object.Unmarshal(m, b) +} +func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Object.Marshal(b, m, deterministic) +} +func (m *Object) XXX_Merge(src proto.Message) { + xxx_messageInfo_Object.Merge(m, src) +} +func (m *Object) XXX_Size() int { + return xxx_messageInfo_Object.Size(m) +} +func (m *Object) XXX_DiscardUnknown() { + xxx_messageInfo_Object.DiscardUnknown(m) +} + +var xxx_messageInfo_Object proto.InternalMessageInfo + +func (m *Object) GetBucket() []byte { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *Object) GetEncryptedPath() []byte { + if m != nil { + return m.EncryptedPath + } + return nil +} + +func (m *Object) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *Object) GetStatus() Object_Status { + if m != nil { + return m.Status + } + return Object_INVALID +} + +func (m *Object) GetCreatedAt() time.Time { + if m != nil { + return m.CreatedAt + } + return time.Time{} +} + +func (m *Object) GetStatusAt() time.Time { + if m != nil { + return m.StatusAt + } + return time.Time{} +} + +func (m *Object) GetExpiresAt() time.Time { + if m != nil { + return m.ExpiresAt + } + return time.Time{} +} + +func (m *Object) GetEncryptedMetadata() []byte { + if m != nil { + return m.EncryptedMetadata + } + return nil +} + +func (m *Object) GetFixedSegmentSize() int64 { + if m != nil { + return m.FixedSegmentSize + } + return 0 +} + +func (m *Object) GetRedundancyScheme() *RedundancyScheme { + if m != nil { + return m.RedundancyScheme + } + return nil +} + +func (m *Object) GetEncryptionParameters() *EncryptionParameters { + if m != nil { + return m.EncryptionParameters + } + return nil +} + +func (m *Object) GetTotalSize() int64 { + if m != nil { + return m.TotalSize + } + return 0 +} + +func (m *Object) GetInlineSize() int64 { + if m != nil { + return m.InlineSize + } + return 0 +} + +func (m *Object) GetRemoteSize() int64 { + if m != nil { + return m.RemoteSize + } + return 0 +} + +type ObjectBeginRequest struct { + Bucket []byte `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + EncryptedPath []byte `protobuf:"bytes,2,opt,name=encrypted_path,json=encryptedPath,proto3" json:"encrypted_path,omitempty"` + Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + ExpiresAt time.Time `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3,stdtime" json:"expires_at"` + EncryptedMetadataNonce Nonce `protobuf:"bytes,5,opt,name=encrypted_metadata_nonce,json=encryptedMetadataNonce,proto3,customtype=Nonce" json:"encrypted_metadata_nonce"` + EncryptedMetadata []byte `protobuf:"bytes,6,opt,name=encrypted_metadata,json=encryptedMetadata,proto3" json:"encrypted_metadata,omitempty"` + RedundancyScheme *RedundancyScheme `protobuf:"bytes,7,opt,name=redundancy_scheme,json=redundancyScheme,proto3" json:"redundancy_scheme,omitempty"` + EncryptionParameters *EncryptionParameters `protobuf:"bytes,8,opt,name=encryption_parameters,json=encryptionParameters,proto3" json:"encryption_parameters,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectBeginRequest) Reset() { *m = ObjectBeginRequest{} } +func (m *ObjectBeginRequest) String() string { return proto.CompactTextString(m) } +func (*ObjectBeginRequest) ProtoMessage() {} +func (*ObjectBeginRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{30} +} +func (m *ObjectBeginRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectBeginRequest.Unmarshal(m, b) +} +func (m *ObjectBeginRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectBeginRequest.Marshal(b, m, deterministic) +} +func (m *ObjectBeginRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectBeginRequest.Merge(m, src) +} +func (m *ObjectBeginRequest) XXX_Size() int { + return xxx_messageInfo_ObjectBeginRequest.Size(m) +} +func (m *ObjectBeginRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectBeginRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectBeginRequest proto.InternalMessageInfo + +func (m *ObjectBeginRequest) GetBucket() []byte { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *ObjectBeginRequest) GetEncryptedPath() []byte { + if m != nil { + return m.EncryptedPath + } + return nil +} + +func (m *ObjectBeginRequest) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ObjectBeginRequest) GetExpiresAt() time.Time { + if m != nil { + return m.ExpiresAt + } + return time.Time{} +} + +func (m *ObjectBeginRequest) GetEncryptedMetadata() []byte { + if m != nil { + return m.EncryptedMetadata + } + return nil +} + +func (m *ObjectBeginRequest) GetRedundancyScheme() *RedundancyScheme { + if m != nil { + return m.RedundancyScheme + } + return nil +} + +func (m *ObjectBeginRequest) GetEncryptionParameters() *EncryptionParameters { + if m != nil { + return m.EncryptionParameters + } + return nil +} + +type ObjectBeginResponse struct { + Bucket []byte `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + EncryptedPath []byte `protobuf:"bytes,2,opt,name=encrypted_path,json=encryptedPath,proto3" json:"encrypted_path,omitempty"` + Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + StreamId StreamID `protobuf:"bytes,4,opt,name=stream_id,json=streamId,proto3,customtype=StreamID" json:"stream_id"` + RedundancyScheme *RedundancyScheme `protobuf:"bytes,5,opt,name=redundancy_scheme,json=redundancyScheme,proto3" json:"redundancy_scheme,omitempty"` + EncryptionParameters *EncryptionParameters `protobuf:"bytes,6,opt,name=encryption_parameters,json=encryptionParameters,proto3" json:"encryption_parameters,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectBeginResponse) Reset() { *m = ObjectBeginResponse{} } +func (m *ObjectBeginResponse) String() string { return proto.CompactTextString(m) } +func (*ObjectBeginResponse) ProtoMessage() {} +func (*ObjectBeginResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{31} +} +func (m *ObjectBeginResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectBeginResponse.Unmarshal(m, b) +} +func (m *ObjectBeginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectBeginResponse.Marshal(b, m, deterministic) +} +func (m *ObjectBeginResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectBeginResponse.Merge(m, src) +} +func (m *ObjectBeginResponse) XXX_Size() int { + return xxx_messageInfo_ObjectBeginResponse.Size(m) +} +func (m *ObjectBeginResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectBeginResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectBeginResponse proto.InternalMessageInfo + +func (m *ObjectBeginResponse) GetBucket() []byte { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *ObjectBeginResponse) GetEncryptedPath() []byte { + if m != nil { + return m.EncryptedPath + } + return nil +} + +func (m *ObjectBeginResponse) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ObjectBeginResponse) GetRedundancyScheme() *RedundancyScheme { + if m != nil { + return m.RedundancyScheme + } + return nil +} + +func (m *ObjectBeginResponse) GetEncryptionParameters() *EncryptionParameters { + if m != nil { + return m.EncryptionParameters + } + return nil +} + +type ObjectCommitRequest struct { + StreamId StreamID `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3,customtype=StreamID" json:"stream_id"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectCommitRequest) Reset() { *m = ObjectCommitRequest{} } +func (m *ObjectCommitRequest) String() string { return proto.CompactTextString(m) } +func (*ObjectCommitRequest) ProtoMessage() {} +func (*ObjectCommitRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{32} +} +func (m *ObjectCommitRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectCommitRequest.Unmarshal(m, b) +} +func (m *ObjectCommitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectCommitRequest.Marshal(b, m, deterministic) +} +func (m *ObjectCommitRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectCommitRequest.Merge(m, src) +} +func (m *ObjectCommitRequest) XXX_Size() int { + return xxx_messageInfo_ObjectCommitRequest.Size(m) +} +func (m *ObjectCommitRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectCommitRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectCommitRequest proto.InternalMessageInfo + +type ObjectCommitResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectCommitResponse) Reset() { *m = ObjectCommitResponse{} } +func (m *ObjectCommitResponse) String() string { return proto.CompactTextString(m) } +func (*ObjectCommitResponse) ProtoMessage() {} +func (*ObjectCommitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{33} +} +func (m *ObjectCommitResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectCommitResponse.Unmarshal(m, b) +} +func (m *ObjectCommitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectCommitResponse.Marshal(b, m, deterministic) +} +func (m *ObjectCommitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectCommitResponse.Merge(m, src) +} +func (m *ObjectCommitResponse) XXX_Size() int { + return xxx_messageInfo_ObjectCommitResponse.Size(m) +} +func (m *ObjectCommitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectCommitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectCommitResponse proto.InternalMessageInfo + +type ObjectListRequest struct { + Bucket []byte `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + EncryptedPrefix []byte `protobuf:"bytes,2,opt,name=encrypted_prefix,json=encryptedPrefix,proto3" json:"encrypted_prefix,omitempty"` + EncryptedCursor []byte `protobuf:"bytes,3,opt,name=encrypted_cursor,json=encryptedCursor,proto3" json:"encrypted_cursor,omitempty"` + Limit int32 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` + ObjectIncludes *ObjectListItemIncludes `protobuf:"bytes,5,opt,name=object_includes,json=objectIncludes,proto3" json:"object_includes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectListRequest) Reset() { *m = ObjectListRequest{} } +func (m *ObjectListRequest) String() string { return proto.CompactTextString(m) } +func (*ObjectListRequest) ProtoMessage() {} +func (*ObjectListRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{34} +} +func (m *ObjectListRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectListRequest.Unmarshal(m, b) +} +func (m *ObjectListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectListRequest.Marshal(b, m, deterministic) +} +func (m *ObjectListRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectListRequest.Merge(m, src) +} +func (m *ObjectListRequest) XXX_Size() int { + return xxx_messageInfo_ObjectListRequest.Size(m) +} +func (m *ObjectListRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectListRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectListRequest proto.InternalMessageInfo + +func (m *ObjectListRequest) GetBucket() []byte { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *ObjectListRequest) GetEncryptedPrefix() []byte { + if m != nil { + return m.EncryptedPrefix + } + return nil +} + +func (m *ObjectListRequest) GetEncryptedCursor() []byte { + if m != nil { + return m.EncryptedCursor + } + return nil +} + +func (m *ObjectListRequest) GetLimit() int32 { + if m != nil { + return m.Limit + } + return 0 +} + +func (m *ObjectListRequest) GetObjectIncludes() *ObjectListItemIncludes { + if m != nil { + return m.ObjectIncludes + } + return nil +} + +type ObjectListResponse struct { + Items []*ObjectListItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + More bool `protobuf:"varint,2,opt,name=more,proto3" json:"more,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectListResponse) Reset() { *m = ObjectListResponse{} } +func (m *ObjectListResponse) String() string { return proto.CompactTextString(m) } +func (*ObjectListResponse) ProtoMessage() {} +func (*ObjectListResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{35} +} +func (m *ObjectListResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectListResponse.Unmarshal(m, b) +} +func (m *ObjectListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectListResponse.Marshal(b, m, deterministic) +} +func (m *ObjectListResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectListResponse.Merge(m, src) +} +func (m *ObjectListResponse) XXX_Size() int { + return xxx_messageInfo_ObjectListResponse.Size(m) +} +func (m *ObjectListResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectListResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectListResponse proto.InternalMessageInfo + +func (m *ObjectListResponse) GetItems() []*ObjectListItem { + if m != nil { + return m.Items + } + return nil +} + +func (m *ObjectListResponse) GetMore() bool { + if m != nil { + return m.More + } + return false +} + +type ObjectListItem struct { + EncryptedPath []byte `protobuf:"bytes,1,opt,name=encrypted_path,json=encryptedPath,proto3" json:"encrypted_path,omitempty"` + Version int32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` + Status Object_Status `protobuf:"varint,3,opt,name=status,proto3,enum=metainfo.Object_Status" json:"status,omitempty"` + CreatedAt time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at"` + StatusAt time.Time `protobuf:"bytes,5,opt,name=status_at,json=statusAt,proto3,stdtime" json:"status_at"` + ExpiresAt time.Time `protobuf:"bytes,6,opt,name=expires_at,json=expiresAt,proto3,stdtime" json:"expires_at"` + EncryptedMetadataNonce Nonce `protobuf:"bytes,7,opt,name=encrypted_metadata_nonce,json=encryptedMetadataNonce,proto3,customtype=Nonce" json:"encrypted_metadata_nonce"` + EncryptedMetadata []byte `protobuf:"bytes,8,opt,name=encrypted_metadata,json=encryptedMetadata,proto3" json:"encrypted_metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectListItem) Reset() { *m = ObjectListItem{} } +func (m *ObjectListItem) String() string { return proto.CompactTextString(m) } +func (*ObjectListItem) ProtoMessage() {} +func (*ObjectListItem) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{36} +} +func (m *ObjectListItem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectListItem.Unmarshal(m, b) +} +func (m *ObjectListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectListItem.Marshal(b, m, deterministic) +} +func (m *ObjectListItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectListItem.Merge(m, src) +} +func (m *ObjectListItem) XXX_Size() int { + return xxx_messageInfo_ObjectListItem.Size(m) +} +func (m *ObjectListItem) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectListItem.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectListItem proto.InternalMessageInfo + +func (m *ObjectListItem) GetEncryptedPath() []byte { + if m != nil { + return m.EncryptedPath + } + return nil +} + +func (m *ObjectListItem) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *ObjectListItem) GetStatus() Object_Status { + if m != nil { + return m.Status + } + return Object_INVALID +} + +func (m *ObjectListItem) GetCreatedAt() time.Time { + if m != nil { + return m.CreatedAt + } + return time.Time{} +} + +func (m *ObjectListItem) GetStatusAt() time.Time { + if m != nil { + return m.StatusAt + } + return time.Time{} +} + +func (m *ObjectListItem) GetExpiresAt() time.Time { + if m != nil { + return m.ExpiresAt + } + return time.Time{} +} + +func (m *ObjectListItem) GetEncryptedMetadata() []byte { + if m != nil { + return m.EncryptedMetadata + } + return nil +} + +type ObjectListItemIncludes struct { + Metadata bool `protobuf:"varint,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectListItemIncludes) Reset() { *m = ObjectListItemIncludes{} } +func (m *ObjectListItemIncludes) String() string { return proto.CompactTextString(m) } +func (*ObjectListItemIncludes) ProtoMessage() {} +func (*ObjectListItemIncludes) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{37} +} +func (m *ObjectListItemIncludes) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectListItemIncludes.Unmarshal(m, b) +} +func (m *ObjectListItemIncludes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectListItemIncludes.Marshal(b, m, deterministic) +} +func (m *ObjectListItemIncludes) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectListItemIncludes.Merge(m, src) +} +func (m *ObjectListItemIncludes) XXX_Size() int { + return xxx_messageInfo_ObjectListItemIncludes.Size(m) +} +func (m *ObjectListItemIncludes) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectListItemIncludes.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectListItemIncludes proto.InternalMessageInfo + +func (m *ObjectListItemIncludes) GetMetadata() bool { + if m != nil { + return m.Metadata + } + return false +} + +type ObjectBeginDeleteRequest struct { + Bucket []byte `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + EncryptedPath []byte `protobuf:"bytes,2,opt,name=encrypted_path,json=encryptedPath,proto3" json:"encrypted_path,omitempty"` + Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectBeginDeleteRequest) Reset() { *m = ObjectBeginDeleteRequest{} } +func (m *ObjectBeginDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*ObjectBeginDeleteRequest) ProtoMessage() {} +func (*ObjectBeginDeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{38} +} +func (m *ObjectBeginDeleteRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectBeginDeleteRequest.Unmarshal(m, b) +} +func (m *ObjectBeginDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectBeginDeleteRequest.Marshal(b, m, deterministic) +} +func (m *ObjectBeginDeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectBeginDeleteRequest.Merge(m, src) +} +func (m *ObjectBeginDeleteRequest) XXX_Size() int { + return xxx_messageInfo_ObjectBeginDeleteRequest.Size(m) +} +func (m *ObjectBeginDeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectBeginDeleteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectBeginDeleteRequest proto.InternalMessageInfo + +func (m *ObjectBeginDeleteRequest) GetBucket() []byte { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *ObjectBeginDeleteRequest) GetEncryptedPath() []byte { + if m != nil { + return m.EncryptedPath + } + return nil +} + +func (m *ObjectBeginDeleteRequest) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +type ObjectBeginDeleteResponse struct { + StreamId StreamID `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3,customtype=StreamID" json:"stream_id"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectBeginDeleteResponse) Reset() { *m = ObjectBeginDeleteResponse{} } +func (m *ObjectBeginDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*ObjectBeginDeleteResponse) ProtoMessage() {} +func (*ObjectBeginDeleteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{39} +} +func (m *ObjectBeginDeleteResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectBeginDeleteResponse.Unmarshal(m, b) +} +func (m *ObjectBeginDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectBeginDeleteResponse.Marshal(b, m, deterministic) +} +func (m *ObjectBeginDeleteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectBeginDeleteResponse.Merge(m, src) +} +func (m *ObjectBeginDeleteResponse) XXX_Size() int { + return xxx_messageInfo_ObjectBeginDeleteResponse.Size(m) +} +func (m *ObjectBeginDeleteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectBeginDeleteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectBeginDeleteResponse proto.InternalMessageInfo + +type ObjectFinishDeleteRequest struct { + StreamId StreamID `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3,customtype=StreamID" json:"stream_id"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectFinishDeleteRequest) Reset() { *m = ObjectFinishDeleteRequest{} } +func (m *ObjectFinishDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*ObjectFinishDeleteRequest) ProtoMessage() {} +func (*ObjectFinishDeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{40} +} +func (m *ObjectFinishDeleteRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectFinishDeleteRequest.Unmarshal(m, b) +} +func (m *ObjectFinishDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectFinishDeleteRequest.Marshal(b, m, deterministic) +} +func (m *ObjectFinishDeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectFinishDeleteRequest.Merge(m, src) +} +func (m *ObjectFinishDeleteRequest) XXX_Size() int { + return xxx_messageInfo_ObjectFinishDeleteRequest.Size(m) +} +func (m *ObjectFinishDeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectFinishDeleteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectFinishDeleteRequest proto.InternalMessageInfo + +type ObjectFinishDeleteResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ObjectFinishDeleteResponse) Reset() { *m = ObjectFinishDeleteResponse{} } +func (m *ObjectFinishDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*ObjectFinishDeleteResponse) ProtoMessage() {} +func (*ObjectFinishDeleteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{41} +} +func (m *ObjectFinishDeleteResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ObjectFinishDeleteResponse.Unmarshal(m, b) +} +func (m *ObjectFinishDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ObjectFinishDeleteResponse.Marshal(b, m, deterministic) +} +func (m *ObjectFinishDeleteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ObjectFinishDeleteResponse.Merge(m, src) +} +func (m *ObjectFinishDeleteResponse) XXX_Size() int { + return xxx_messageInfo_ObjectFinishDeleteResponse.Size(m) +} +func (m *ObjectFinishDeleteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ObjectFinishDeleteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ObjectFinishDeleteResponse proto.InternalMessageInfo + +// only for satellite use +type SatStreamID struct { + Bucket []byte `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + EncryptedPath []byte `protobuf:"bytes,2,opt,name=encrypted_path,json=encryptedPath,proto3" json:"encrypted_path,omitempty"` + Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` + Redundancy *RedundancyScheme `protobuf:"bytes,4,opt,name=redundancy,proto3" json:"redundancy,omitempty"` + CreationDate time.Time `protobuf:"bytes,5,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date"` + ExpirationDate time.Time `protobuf:"bytes,6,opt,name=expiration_date,json=expirationDate,proto3,stdtime" json:"expiration_date"` + SatelliteSignature []byte `protobuf:"bytes,7,opt,name=satellite_signature,json=satelliteSignature,proto3" json:"satellite_signature,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SatStreamID) Reset() { *m = SatStreamID{} } +func (m *SatStreamID) String() string { return proto.CompactTextString(m) } +func (*SatStreamID) ProtoMessage() {} +func (*SatStreamID) Descriptor() ([]byte, []int) { + return fileDescriptor_631e2f30a93cd64e, []int{42} +} +func (m *SatStreamID) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SatStreamID.Unmarshal(m, b) +} +func (m *SatStreamID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SatStreamID.Marshal(b, m, deterministic) +} +func (m *SatStreamID) XXX_Merge(src proto.Message) { + xxx_messageInfo_SatStreamID.Merge(m, src) +} +func (m *SatStreamID) XXX_Size() int { + return xxx_messageInfo_SatStreamID.Size(m) +} +func (m *SatStreamID) XXX_DiscardUnknown() { + xxx_messageInfo_SatStreamID.DiscardUnknown(m) +} + +var xxx_messageInfo_SatStreamID proto.InternalMessageInfo + +func (m *SatStreamID) GetBucket() []byte { + if m != nil { + return m.Bucket + } + return nil +} + +func (m *SatStreamID) GetEncryptedPath() []byte { + if m != nil { + return m.EncryptedPath + } + return nil +} + +func (m *SatStreamID) GetVersion() int32 { + if m != nil { + return m.Version + } + return 0 +} + +func (m *SatStreamID) GetRedundancy() *RedundancyScheme { + if m != nil { + return m.Redundancy + } + return nil +} + +func (m *SatStreamID) GetCreationDate() time.Time { + if m != nil { + return m.CreationDate + } + return time.Time{} +} + +func (m *SatStreamID) GetExpirationDate() time.Time { + if m != nil { + return m.ExpirationDate + } + return time.Time{} +} + +func (m *SatStreamID) GetSatelliteSignature() []byte { + if m != nil { + return m.SatelliteSignature + } + return nil +} + func init() { + proto.RegisterEnum("metainfo.Object_Status", Object_Status_name, Object_Status_value) proto.RegisterType((*Bucket)(nil), "metainfo.Bucket") proto.RegisterType((*BucketListItem)(nil), "metainfo.BucketListItem") proto.RegisterType((*BucketCreateRequest)(nil), "metainfo.BucketCreateRequest") @@ -1497,103 +2369,163 @@ func init() { proto.RegisterType((*SetAttributionResponseOld)(nil), "metainfo.SetAttributionResponseOld") proto.RegisterType((*ProjectInfoRequest)(nil), "metainfo.ProjectInfoRequest") proto.RegisterType((*ProjectInfoResponse)(nil), "metainfo.ProjectInfoResponse") + proto.RegisterType((*Object)(nil), "metainfo.Object") + proto.RegisterType((*ObjectBeginRequest)(nil), "metainfo.ObjectBeginRequest") + proto.RegisterType((*ObjectBeginResponse)(nil), "metainfo.ObjectBeginResponse") + proto.RegisterType((*ObjectCommitRequest)(nil), "metainfo.ObjectCommitRequest") + proto.RegisterType((*ObjectCommitResponse)(nil), "metainfo.ObjectCommitResponse") + proto.RegisterType((*ObjectListRequest)(nil), "metainfo.ObjectListRequest") + proto.RegisterType((*ObjectListResponse)(nil), "metainfo.ObjectListResponse") + proto.RegisterType((*ObjectListItem)(nil), "metainfo.ObjectListItem") + proto.RegisterType((*ObjectListItemIncludes)(nil), "metainfo.ObjectListItemIncludes") + proto.RegisterType((*ObjectBeginDeleteRequest)(nil), "metainfo.ObjectBeginDeleteRequest") + proto.RegisterType((*ObjectBeginDeleteResponse)(nil), "metainfo.ObjectBeginDeleteResponse") + proto.RegisterType((*ObjectFinishDeleteRequest)(nil), "metainfo.ObjectFinishDeleteRequest") + proto.RegisterType((*ObjectFinishDeleteResponse)(nil), "metainfo.ObjectFinishDeleteResponse") + proto.RegisterType((*SatStreamID)(nil), "metainfo.SatStreamID") } func init() { proto.RegisterFile("metainfo.proto", fileDescriptor_631e2f30a93cd64e) } var fileDescriptor_631e2f30a93cd64e = []byte{ - // 1448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 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xed, 0x31, 0x73, 0xce, 0xfa, 0xdd, 0x80, 0xcd, 0x3c, 0x40, 0x92, 0x40, 0x8e, 0xd0, 0x7d, 0x58, - 0x73, 0x35, 0x85, 0x8e, 0x20, 0x45, 0x27, 0x63, 0x3d, 0x4d, 0xc6, 0x02, 0x92, 0xed, 0xd5, 0xd1, - 0x31, 0xb1, 0x4e, 0xc8, 0x4d, 0x38, 0x47, 0xa3, 0x88, 0x39, 0xb1, 0x8f, 0x5d, 0x1c, 0xe5, 0xd4, - 0xde, 0x2a, 0x77, 0xe9, 0xcf, 0x37, 0xdb, 0x8b, 0x47, 0x5c, 0x7e, 0x78, 0x60, 0x57, 0xb8, 0x96, - 0x5c, 0x78, 0xa2, 0x1d, 0x53, 0xff, 0xa5, 0xcb, 0xd0, 0x79, 0x81, 0x27, 0x02, 0xf8, 0xea, 0xde, - 0xa6, 0x3a, 0xb2, 0x2a, 0xb4, 0x8e, 0xe4, 0xfe, 0x17, 0x78, 0x62, 0x43, 0x3c, 0xfa, 0xb6, 0x7e, - 0x4d, 0x83, 0xda, 0x8f, 0x02, 0xee, 0xd1, 0xac, 0x69, 0xff, 0x08, 0x16, 0x15, 0xc7, 0x8a, 0x73, - 0x92, 0xe1, 0xfc, 0x48, 0x7e, 0xd9, 0x5a, 0x85, 0xdc, 0x86, 0xd5, 0x88, 0xfa, 0x7d, 0x3f, 0x74, - 0x07, 0x1a, 0xc7, 0x92, 0xc0, 0xb1, 0x28, 0xfd, 0x57, 0xb4, 0xaa, 0xc4, 0xce, 0xba, 0x0f, 0xb5, - 0xb1, 0x58, 0x52, 0x86, 0x32, 0x6e, 0x18, 0x67, 0xba, 0x61, 0xb9, 0x70, 0x51, 0x59, 0x3a, 0x88, - 0x7e, 0x08, 0x07, 0x91, 0xeb, 0xcd, 0x1a, 0x17, 0xeb, 0x37, 0x03, 0xcc, 0x89, 0x3b, 0x3e, 0x44, - 0x46, 0x65, 0x22, 0x9f, 0x3b, 0x9b, 0x80, 0xf7, 0x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 0x67, 0xa9, 0xa9, 0x6b, 0x9e, 0xc0, 0x9a, 0xc4, 0x55, 0x95, 0x03, 0x4f, 0xb1, - 0x46, 0x7a, 0xb6, 0x78, 0x44, 0x34, 0xaf, 0x4c, 0xd3, 0x48, 0x8b, 0xef, 0x6b, 0x58, 0x93, 0xcf, - 0x72, 0xc6, 0xf0, 0xe4, 0xb1, 0xf1, 0x29, 0xc4, 0xb4, 0xa6, 0xaa, 0xa4, 0xa6, 0xdb, 0xb0, 0x92, - 0x79, 0x1b, 0x44, 0x51, 0x4c, 0x9c, 0xca, 0x3f, 0x4a, 0x66, 0x63, 0x8a, 0x42, 0x6a, 0xd4, 0x01, - 0xa2, 0x1f, 0xe6, 0x8c, 0xc7, 0x57, 0x27, 0xce, 0x4d, 0x4e, 0x08, 0xe6, 0xff, 0x4e, 0x51, 0xca, - 0x01, 0x22, 0x93, 0xe5, 0x54, 0x40, 0xc6, 0x5f, 0xa9, 0x02, 0x40, 0x26, 0x9f, 0x99, 0xaf, 0x60, - 0x35, 0xdb, 0xd1, 0xc6, 0x38, 0x2c, 0x6e, 0xfe, 0x59, 0x0e, 0xa7, 0x35, 0xd0, 0x6f, 0xe0, 0x7c, - 0x3e, 0x6d, 0xb8, 0x30, 0xe7, 0x50, 0x71, 0x93, 0x32, 0xaf, 0x4e, 0xd7, 0x49, 0xad, 0x7f, 0x0e, - 0x95, 0x4c, 0x5b, 0x21, 0x99, 0x72, 0x98, 0xec, 0x41, 0x66, 0x7d, 0xca, 0xae, 0x34, 0xb7, 0xb7, - 0xf0, 0x6c, 0x2e, 0xee, 0x74, 0xca, 0x62, 0xba, 0xbf, 0xf9, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xaf, 0x93, 0xe9, 0x5f, 0x5a, 0x13, 0x00, 0x00, + // 2181 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x59, 0x5b, 0x6f,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xc7, + 0xe4, 0x62, 0xf4, 0x48, 0x43, 0x3f, 0xc0, 0x6c, 0xe1, 0x92, 0xc9, 0xbe, 0x8d, 0x57, 0xb0, 0xc6, + 0x85, 0xbb, 0x98, 0xec, 0x12, 0x12, 0xb8, 0x67, 0x63, 0xba, 0xe2, 0x65, 0x41, 0xf0, 0x00, 0x6a, + 0x76, 0x24, 0x69, 0xb9, 0x0e, 0x53, 0x58, 0x35, 0x17, 0x14, 0x6a, 0xc7, 0x31, 0x3e, 0x80, 0xf5, + 0x74, 0xcd, 0x02, 0xb4, 0xdf, 0x69, 0xb0, 0xb4, 0xeb, 0x38, 0x01, 0x0e, 0x43, 0xec, 0x9c, 0xd0, + 0x5c, 0x7c, 0xc8, 0x90, 0xd8, 0x96, 0xf8, 0x70, 0xc3, 0xa1, 0x96, 0xc8, 0xd3, 0x91, 0x88, 0xc4, + 0x6c, 0x1f, 0x96, 0x43, 0xe2, 0x07, 0x76, 0x1f, 0x5b, 0x34, 0xd1, 0x5b, 0x36, 0xd7, 0x26, 0x12, + 0xc1, 0x62, 0x8b, 0x65, 0xff, 0x63, 0xdf, 0xc1, 0x62, 0x19, 0x13, 0x09, 0x71, 0x85, 0x66, 0x7c, + 0x97, 0x81, 0x15, 0x11, 0x76, 0x2f, 0x03, 0x77, 0x62, 0xff, 0x93, 0x81, 0x43, 0x2d, 0xa8, 0xf8, + 0x50, 0x55, 0x7a, 0x0c, 0x05, 0x85, 0x46, 0xb6, 0x38, 0x36, 0xfb, 0x46, 0x4d, 0x28, 0x8a, 0xb8, + 0x16, 0x21, 0x2d, 0x87, 0xe8, 0x31, 0x40, 0x14, 0xbf, 0xd7, 0x09, 0x5c, 0x45, 0x1c, 0x3d, 0x06, + 0x7d, 0x68, 0x5f, 0xc8, 0x38, 0xc5, 0x4e, 0x3c, 0x79, 0xe4, 0xd9, 0x4a, 0xab, 0x43, 0xfb, 0xe2, + 0x40, 0x0a, 0xa8, 0x19, 0xa4, 0x0d, 0x80, 0x2f,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xce, 0x1f, + 0xaa, 0x50, 0x3a, 0x12, 0x99, 0x03, 0x1d, 0x41, 0x95, 0x37, 0xfa, 0xc5, 0x4f, 0xb4, 0x8d, 0x64, + 0x33, 0x3a, 0xf6, 0x73, 0x45, 0xff, 0x60, 0x16, 0x5b, 0x78, 0x59, 0x1b, 0xca, 0x4f, 0x31, 0x11, + 0xba, 0xf4, 0xa4, 0x70, 0xf4, 0x43, 0x40, 0x5f, 0x4b, 0xe5, 0x09, 0x2d, 0x47, 0x50, 0xe5, 0x4e, + 0x32, 0x6b, 0x53, 0x31, 0x77, 0x9c, 0xde, 0x54, 0xc2, 0xf5, 0x9f, 0x41, 0x85, 0x06, 0x2f, 0xe7, + 0x85, 0x68, 0x2d, 0xad, 0xdf, 0x2e, 0x75, 0xad, 0xa7, 0x33, 0x85, 0x26, 0x0c, 0xcb, 0x5d, 0x79, + 0x3c, 0xe5, 0x05, 0x8a, 0x1e, 0x24, 0x67, 0xa5, 0xbe, 0x7e, 0xf5, 0x87, 0x57, 0x89, 0x89, 0x65, + 0x9e, 0x43, 0x85, 0x85, 0xb0, 0x78, 0x79, 0xae, 0x27, 0x13, 0xbd, 0x5a, 0xff, 0xea, 0x1b, 0x33, + 0xb8, 0x11, 0x96, 0xfc, 0x6a, 0x17, 0xca, 0xa6, 0xc4, 0x63, 0xe5, 0x83, 0x8a, 0x65, 0x5a, 0x5d, + 0x20, 0xb1, 0xe4, 0xbc, 0x18, 0x96, 0x53, 0xd5, 0x82, 0xbe, 0x9e, 0xce, 0x14, 0x9a, 0xbe, 0x86, + 0x45, 0x25, 0x4f, 0x89, 0xdd, 0x19, 0xa9, 0x87, 0x89, 0x9b, 0xfb, 0xfe, 0xa5, 0x32, 0x42, 0xbb, + 0x05, 0x48, 0xcd, 0x36, 0x42, 0xfd, 0xd4, 0xd4, 0x94, 0xec, 0xa6, 0xff, 0xe8, 0x72, 0x21, 0xb1, + 0xc0, 0x4b, 0x68, 0x70, 0xdf, 0x17, 0xef, 0xbe, 0x93, 0x81, 0x83, 0x94, 0x0a, 0x24, 0xfd, 0xd7, + 0x84, 0xfe, 0xe1, 0x2c, 0x89, 0xa8, 0xe9, 0xf3, 0x25, 0x34, 0x38, 0xe6, 0x8a, 0xe2, 0xe9, 0x69, + 0xc9, 0xee, 0xb7, 0x6e, 0xcc, 0x14, 0x89, 0x54, 0x77, 0xa1, 0xa6, 0xf4, 0x24, 0x59, 0x33, 0x66, + 0x6a, 0x56, 0xbc, 0x19, 0xaa, 0x6f, 0xcd, 0x10, 0x88, 0x94, 0x5a, 0x80, 0x64, 0x43, 0x58, 0xd9, + 0xf1, 0xfd, 0xa9, 0x79, 0xd3, 0x9d, 0x69, 0x15, 0xe9, 0x4b, 0x5a, 0xcb, 0x5f, 0x42, 0x83, 0x63, + 0x7f, 0x29, 0x20, 0xc9, 0xee, 0x68, 0x0a, 0x20, 0xd3, 0xed, 0xcd, 0x2f, 0xa0, 0xae, 0x76, 0xd2, + 0x12, 0x36, 0x4c, 0x6f, 0x3a, 0xaa, 0x36, 0x9c, 0xd5, 0xb8, 0xfb, 0x1a, 0x16, 0xe3, 0xa1, 0x4d, + 0x89, 0xb1, 0x0d, 0xa5, 0x37, 0xc7, 0xf4, 0xfb, 0xb3, 0x65, 0x22, 0xed, 0xcf, 0xa1, 0xa2, 0xb4, + 0xb3, 0xd4, 0xf4, 0x30, 0xdd, 0xfb, 0x52, 0xd3, 0x43, 0x4a, 0x0f, 0x6c, 0x2f, 0xf7, 0x55, 0x66, + 0x74, 0x76, 0x56, 0x60, 0x37, 0xce, 0xa7, 0x3f, 0x04, 0x00, 0x00, 0xff, 0xff, 0xc9, 0x19, 0x04, + 0xf0, 0xd2, 0x21, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1608,11 +2540,18 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MetainfoClient interface { + // Bucket CreateBucket(ctx context.Context, in *BucketCreateRequest, opts ...grpc.CallOption) (*BucketCreateResponse, error) GetBucket(ctx context.Context, in *BucketGetRequest, opts ...grpc.CallOption) (*BucketGetResponse, error) DeleteBucket(ctx context.Context, in *BucketDeleteRequest, opts ...grpc.CallOption) (*BucketDeleteResponse, error) ListBuckets(ctx context.Context, in *BucketListRequest, opts ...grpc.CallOption) (*BucketListResponse, error) SetBucketAttribution(ctx context.Context, in *BucketSetAttributionRequest, opts ...grpc.CallOption) (*BucketSetAttributionResponse, error) + // Object + BeginObject(ctx context.Context, in *ObjectBeginRequest, opts ...grpc.CallOption) (*ObjectBeginResponse, error) + CommitObject(ctx context.Context, in *ObjectCommitRequest, opts ...grpc.CallOption) (*ObjectCommitResponse, error) + ListObjects(ctx context.Context, in *ObjectListRequest, opts ...grpc.CallOption) (*ObjectListResponse, error) + BeginDeleteObject(ctx context.Context, in *ObjectBeginDeleteRequest, opts ...grpc.CallOption) (*ObjectBeginDeleteResponse, error) + FinishDeleteObject(ctx context.Context, in *ObjectFinishDeleteRequest, opts ...grpc.CallOption) (*ObjectFinishDeleteResponse, error) CreateSegmentOld(ctx context.Context, in *SegmentWriteRequestOld, opts ...grpc.CallOption) (*SegmentWriteResponseOld, error) CommitSegmentOld(ctx context.Context, in *SegmentCommitRequestOld, opts ...grpc.CallOption) (*SegmentCommitResponseOld, error) SegmentInfoOld(ctx context.Context, in *SegmentInfoRequestOld, opts ...grpc.CallOption) (*SegmentInfoResponseOld, error) @@ -1676,6 +2615,51 @@ func (c *metainfoClient) SetBucketAttribution(ctx context.Context, in *BucketSet return out, nil } +func (c *metainfoClient) BeginObject(ctx context.Context, in *ObjectBeginRequest, opts ...grpc.CallOption) (*ObjectBeginResponse, error) { + out := new(ObjectBeginResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/BeginObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metainfoClient) CommitObject(ctx context.Context, in *ObjectCommitRequest, opts ...grpc.CallOption) (*ObjectCommitResponse, error) { + out := new(ObjectCommitResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CommitObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metainfoClient) ListObjects(ctx context.Context, in *ObjectListRequest, opts ...grpc.CallOption) (*ObjectListResponse, error) { + out := new(ObjectListResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/ListObjects", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metainfoClient) BeginDeleteObject(ctx context.Context, in *ObjectBeginDeleteRequest, opts ...grpc.CallOption) (*ObjectBeginDeleteResponse, error) { + out := new(ObjectBeginDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/BeginDeleteObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *metainfoClient) FinishDeleteObject(ctx context.Context, in *ObjectFinishDeleteRequest, opts ...grpc.CallOption) (*ObjectFinishDeleteResponse, error) { + out := new(ObjectFinishDeleteResponse) + err := c.cc.Invoke(ctx, "/metainfo.Metainfo/FinishDeleteObject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *metainfoClient) CreateSegmentOld(ctx context.Context, in *SegmentWriteRequestOld, opts ...grpc.CallOption) (*SegmentWriteResponseOld, error) { out := new(SegmentWriteResponseOld) err := c.cc.Invoke(ctx, "/metainfo.Metainfo/CreateSegmentOld", in, out, opts...) @@ -1750,11 +2734,18 @@ func (c *metainfoClient) ProjectInfo(ctx context.Context, in *ProjectInfoRequest // MetainfoServer is the server API for Metainfo service. type MetainfoServer interface { + // Bucket CreateBucket(context.Context, *BucketCreateRequest) (*BucketCreateResponse, error) GetBucket(context.Context, *BucketGetRequest) (*BucketGetResponse, error) DeleteBucket(context.Context, *BucketDeleteRequest) (*BucketDeleteResponse, error) ListBuckets(context.Context, *BucketListRequest) (*BucketListResponse, error) SetBucketAttribution(context.Context, *BucketSetAttributionRequest) (*BucketSetAttributionResponse, error) + // Object + BeginObject(context.Context, *ObjectBeginRequest) (*ObjectBeginResponse, error) + CommitObject(context.Context, *ObjectCommitRequest) (*ObjectCommitResponse, error) + ListObjects(context.Context, *ObjectListRequest) (*ObjectListResponse, error) + BeginDeleteObject(context.Context, *ObjectBeginDeleteRequest) (*ObjectBeginDeleteResponse, error) + FinishDeleteObject(context.Context, *ObjectFinishDeleteRequest) (*ObjectFinishDeleteResponse, error) CreateSegmentOld(context.Context, *SegmentWriteRequestOld) (*SegmentWriteResponseOld, error) CommitSegmentOld(context.Context, *SegmentCommitRequestOld) (*SegmentCommitResponseOld, error) SegmentInfoOld(context.Context, *SegmentInfoRequestOld) (*SegmentInfoResponseOld, error) @@ -1859,6 +2850,96 @@ func _Metainfo_SetBucketAttribution_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Metainfo_BeginObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectBeginRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetainfoServer).BeginObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metainfo.Metainfo/BeginObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetainfoServer).BeginObject(ctx, req.(*ObjectBeginRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Metainfo_CommitObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectCommitRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetainfoServer).CommitObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metainfo.Metainfo/CommitObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetainfoServer).CommitObject(ctx, req.(*ObjectCommitRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Metainfo_ListObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectListRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetainfoServer).ListObjects(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metainfo.Metainfo/ListObjects", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetainfoServer).ListObjects(ctx, req.(*ObjectListRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Metainfo_BeginDeleteObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectBeginDeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetainfoServer).BeginDeleteObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metainfo.Metainfo/BeginDeleteObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetainfoServer).BeginDeleteObject(ctx, req.(*ObjectBeginDeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Metainfo_FinishDeleteObject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ObjectFinishDeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MetainfoServer).FinishDeleteObject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/metainfo.Metainfo/FinishDeleteObject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MetainfoServer).FinishDeleteObject(ctx, req.(*ObjectFinishDeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Metainfo_CreateSegmentOld_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SegmentWriteRequestOld) if err := dec(in); err != nil { @@ -2027,6 +3108,26 @@ var _Metainfo_serviceDesc = grpc.ServiceDesc{ MethodName: "SetBucketAttribution", Handler: _Metainfo_SetBucketAttribution_Handler, }, + { + MethodName: "BeginObject", + Handler: _Metainfo_BeginObject_Handler, + }, + { + MethodName: "CommitObject", + Handler: _Metainfo_CommitObject_Handler, + }, + { + MethodName: "ListObjects", + Handler: _Metainfo_ListObjects_Handler, + }, + { + MethodName: "BeginDeleteObject", + Handler: _Metainfo_BeginDeleteObject_Handler, + }, + { + MethodName: "FinishDeleteObject", + Handler: _Metainfo_FinishDeleteObject_Handler, + }, { MethodName: "CreateSegmentOld", Handler: _Metainfo_CreateSegmentOld_Handler, diff --git a/pkg/pb/metainfo.proto b/pkg/pb/metainfo.proto index 027274ec2..1f1fc1d1e 100644 --- a/pkg/pb/metainfo.proto +++ b/pkg/pb/metainfo.proto @@ -15,11 +15,18 @@ import "orders.proto"; // Metainfo it's a satellite RPC service service Metainfo { + // Bucket rpc CreateBucket(BucketCreateRequest) returns (BucketCreateResponse); rpc GetBucket(BucketGetRequest) returns (BucketGetResponse); rpc DeleteBucket(BucketDeleteRequest) returns (BucketDeleteResponse); rpc ListBuckets(BucketListRequest) returns (BucketListResponse); rpc SetBucketAttribution(BucketSetAttributionRequest) returns (BucketSetAttributionResponse); + // Object + rpc BeginObject(ObjectBeginRequest) returns (ObjectBeginResponse); + rpc CommitObject(ObjectCommitRequest) returns (ObjectCommitResponse); + rpc ListObjects(ObjectListRequest) returns (ObjectListResponse); + rpc BeginDeleteObject(ObjectBeginDeleteRequest) returns (ObjectBeginDeleteResponse); + rpc FinishDeleteObject(ObjectFinishDeleteRequest) returns (ObjectFinishDeleteResponse); rpc CreateSegmentOld(SegmentWriteRequestOld) returns (SegmentWriteResponseOld); rpc CommitSegmentOld(SegmentCommitRequestOld) returns (SegmentCommitResponseOld); @@ -196,3 +203,129 @@ message ProjectInfoRequest { message ProjectInfoResponse { bytes project_salt = 1; } + +message Object { + enum Status { + INVALID = 0; + UPLOADING = 1; + COMMITTING = 2; + COMMITTED = 3; + DELETING = 4; + } + + bytes bucket = 1; + bytes encrypted_path = 2; + int32 version = 3; + Status status = 4; + + bytes stream_id = 5 [(gogoproto.customtype) = "StreamID", (gogoproto.nullable) = false]; + + google.protobuf.Timestamp created_at = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp status_at = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp expires_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + bytes encrypted_metadata_nonce = 9 [(gogoproto.customtype) = "Nonce", (gogoproto.nullable) = false]; + bytes encrypted_metadata = 10; + + int64 fixed_segment_size = 11; + pointerdb.RedundancyScheme redundancy_scheme = 12; + encryption.EncryptionParameters encryption_parameters = 13; + + int64 total_size = 14; // total size of object + int64 inline_size = 15; // size of inline part of object + int64 remote_size = 16; // size of remote part of object +} + +message ObjectBeginRequest { + bytes bucket = 1; + bytes encrypted_path = 2; + int32 version = 3; + + google.protobuf.Timestamp expires_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + bytes encrypted_metadata_nonce = 5 [(gogoproto.customtype) = "Nonce", (gogoproto.nullable) = false]; + bytes encrypted_metadata = 6; // TODO: set maximum size limit + + pointerdb.RedundancyScheme redundancy_scheme = 7; // can be zero + encryption.EncryptionParameters encryption_parameters = 8; // can be zero +} + +message ObjectBeginResponse { + bytes bucket = 1; + bytes encrypted_path = 2; + int32 version = 3; + + bytes stream_id = 4 [(gogoproto.customtype) = "StreamID", (gogoproto.nullable) = false]; + + pointerdb.RedundancyScheme redundancy_scheme = 5; + encryption.EncryptionParameters encryption_parameters = 6; +} + +message ObjectCommitRequest { + bytes stream_id = 1 [(gogoproto.customtype) = "StreamID", (gogoproto.nullable) = false]; +} + +message ObjectCommitResponse { +} + +message ObjectListRequest { + bytes bucket = 1; + bytes encrypted_prefix = 2; + bytes encrypted_cursor = 3; + int32 limit = 4; + + ObjectListItemIncludes object_includes = 5; +} + +message ObjectListResponse { + repeated ObjectListItem items = 1; + bool more = 2; +} + +message ObjectListItem { + bytes encrypted_path = 1; + int32 version = 2; + Object.Status status = 3; + + google.protobuf.Timestamp created_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp status_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp expires_at = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + bytes encrypted_metadata_nonce = 7 [(gogoproto.customtype) = "Nonce", (gogoproto.nullable) = false]; + bytes encrypted_metadata = 8; +} + +message ObjectListItemIncludes { + bool metadata = 1; +} + +message ObjectBeginDeleteRequest { + bytes bucket = 1; + bytes encrypted_path = 2; + int32 version = 3; +} + +message ObjectBeginDeleteResponse { + bytes stream_id = 1 [(gogoproto.customtype) = "StreamID", (gogoproto.nullable) = false]; +} + +message ObjectFinishDeleteRequest { + bytes stream_id = 1 [(gogoproto.customtype) = "StreamID", (gogoproto.nullable) = false]; +} + +message ObjectFinishDeleteResponse { +} + +// only for satellite use +message SatStreamID { + bytes bucket = 1; + bytes encrypted_path = 2; + int32 version = 3; + + pointerdb.RedundancyScheme redundancy = 4; + + google.protobuf.Timestamp creation_date = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp expiration_date = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + + bytes satellite_signature = 7; +} \ No newline at end of file diff --git a/pkg/pb/types.go b/pkg/pb/types.go index 26b418b7c..2d2b2fc82 100644 --- a/pkg/pb/types.go +++ b/pkg/pb/types.go @@ -28,3 +28,6 @@ type SerialNumber = storj.SerialNumber // StreamID is an alias to storj.StreamID for use in generated protobuf code type StreamID = storj.StreamID + +// Nonce is an alias to storj.Nonce for use in generated protobuf code +type Nonce = storj.Nonce diff --git a/pkg/storj/encryption.go b/pkg/storj/encryption.go index e47eebd88..e5d9bd373 100644 --- a/pkg/storj/encryption.go +++ b/pkg/storj/encryption.go @@ -3,6 +3,12 @@ package storj +import ( + "encoding/base32" + + "github.com/zeebo/errs" +) + // EncryptionParameters is the cipher suite and parameters used for encryption type EncryptionParameters struct { // CipherSuite specifies the cipher suite to be used for encryption. @@ -70,13 +76,85 @@ func (key *Key) IsZero() bool { return key == nil || *key == (Key{}) } +// ErrNonce is used when something goes wrong with a stream ID +var ErrNonce = errs.Class("nonce error") + +// nonceEncoding is base32 without padding +var nonceEncoding = base32.StdEncoding.WithPadding(base32.NoPadding) + // Nonce represents the largest nonce used by any encryption protocol type Nonce [NonceSize]byte +// NonceFromString decodes an base32 encoded +func NonceFromString(s string) (Nonce, error) { + nonceBytes, err := nonceEncoding.DecodeString(s) + if err != nil { + return Nonce{}, ErrNonce.Wrap(err) + } + return NonceFromBytes(nonceBytes) +} + +// NonceFromBytes converts a byte slice into a nonce +func NonceFromBytes(b []byte) (Nonce, error) { + if len(b) != len(Nonce{}) { + return Nonce{}, ErrNonce.New("not enough bytes to make a nonce; have %d, need %d", len(b), len(NodeID{})) + } + + var nonce Nonce + copy(nonce[:], b) + return nonce, nil +} + +// IsZero returns whether nonce is unassigned +func (nonce Nonce) IsZero() bool { + return nonce == Nonce{} +} + +// String representation of the nonce +func (nonce Nonce) String() string { return nonceEncoding.EncodeToString(nonce.Bytes()) } + +// Bytes returns bytes of the nonce +func (nonce Nonce) Bytes() []byte { return nonce[:] } + // Raw returns the nonce as a raw byte array pointer func (nonce *Nonce) Raw() *[NonceSize]byte { return (*[NonceSize]byte)(nonce) } +// Marshal serializes a nonce +func (nonce Nonce) Marshal() ([]byte, error) { + return nonce.Bytes(), nil +} + +// MarshalTo serializes a nonce into the passed byte slice +func (nonce *Nonce) MarshalTo(data []byte) (n int, err error) { + n = copy(data, nonce.Bytes()) + return n, nil +} + +// Unmarshal deserializes a nonce +func (nonce *Nonce) Unmarshal(data []byte) error { + var err error + *nonce, err = NonceFromBytes(data) + return err +} + +// Size returns the length of a nonce (implements gogo's custom type interface) +func (nonce Nonce) Size() int { + return len(nonce) +} + +// MarshalJSON serializes a nonce to a json string as bytes +func (nonce Nonce) MarshalJSON() ([]byte, error) { + return []byte(`"` + nonce.String() + `"`), nil +} + +// UnmarshalJSON deserializes a json string (as bytes) to a nonce +func (nonce *Nonce) UnmarshalJSON(data []byte) error { + var err error + *nonce, err = NonceFromString(string(data)) + return err +} + // EncryptedPrivateKey is a private key that has been encrypted type EncryptedPrivateKey []byte diff --git a/pkg/storj/object_list_item.go b/pkg/storj/object_list_item.go new file mode 100644 index 000000000..761bfc050 --- /dev/null +++ b/pkg/storj/object_list_item.go @@ -0,0 +1,20 @@ +// Copyright (C) 2019 Storj Labs, Inc. +// See LICENSE for copying information. + +package storj + +import ( + "time" +) + +// ObjectListItem represents listed object +type ObjectListItem struct { + EncryptedPath []byte + Version int32 + Status int32 + CreatedAt time.Time + StatusAt time.Time + ExpiresAt time.Time + EncryptedMetadataNonce Nonce + EncryptedMetadata []byte +} diff --git a/pkg/storj/streamid.go b/pkg/storj/streamid.go index 0e666636c..91c3a6bc9 100644 --- a/pkg/storj/streamid.go +++ b/pkg/storj/streamid.go @@ -17,7 +17,7 @@ var ErrStreamID = errs.Class("stream ID error") var streamIDEncoding = base32.StdEncoding.WithPadding(base32.NoPadding) // StreamID is the unique identifier for stream related to object -type StreamID [16]byte +type StreamID []byte // StreamIDFromString decodes an base32 encoded func StreamIDFromString(s string) (StreamID, error) { @@ -30,18 +30,14 @@ func StreamIDFromString(s string) (StreamID, error) { // StreamIDFromBytes converts a byte slice into a stream ID func StreamIDFromBytes(b []byte) (StreamID, error) { - if len(b) != len(StreamID{}) { - return StreamID{}, ErrStreamID.New("not enough bytes to make a stream ID; have %d, need %d", len(b), len(NodeID{})) - } - - var id StreamID - copy(id[:], b) + id := make([]byte, len(b)) + copy(id, b) return id, nil } // IsZero returns whether stream ID is unassigned func (id StreamID) IsZero() bool { - return id == StreamID{} + return len(id) == 0 } // String representation of the stream ID @@ -69,7 +65,7 @@ func (id *StreamID) Unmarshal(data []byte) error { } // Size returns the length of a stream ID (implements gogo's custom type interface) -func (id *StreamID) Size() int { +func (id StreamID) Size() int { return len(id) } diff --git a/pkg/storj/streamid_test.go b/pkg/storj/streamid_test.go index 1a73ca63e..c85a108f4 100644 --- a/pkg/storj/streamid_test.go +++ b/pkg/storj/streamid_test.go @@ -6,28 +6,28 @@ package storj_test import ( "testing" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "storj.io/storj/internal/testrand" "storj.io/storj/pkg/storj" ) func TestStreamID_Encode(t *testing.T) { - _, err := storj.StreamIDFromString("likn43kilfzd") - assert.Error(t, err) - - _, err = storj.StreamIDFromBytes([]byte{1, 2, 3, 4, 5}) - assert.Error(t, err) - for i := 0; i < 10; i++ { - streamID := testrand.StreamID() + expectedSize := testrand.Intn(255) + streamID := testrand.StreamID(expectedSize) fromString, err := storj.StreamIDFromString(streamID.String()) - assert.NoError(t, err) - fromBytes, err := storj.StreamIDFromBytes(streamID.Bytes()) - assert.NoError(t, err) + require.NoError(t, err) + require.Equal(t, streamID.String(), fromString.String()) - assert.Equal(t, streamID, fromString) - assert.Equal(t, streamID, fromBytes) + fromBytes, err := storj.StreamIDFromBytes(streamID.Bytes()) + require.NoError(t, err) + require.Equal(t, streamID.Bytes(), fromBytes.Bytes()) + + require.Equal(t, streamID, fromString) + require.Equal(t, expectedSize, fromString.Size()) + require.Equal(t, streamID, fromBytes) + require.Equal(t, expectedSize, fromBytes.Size()) } } diff --git a/proto.lock b/proto.lock index 848dbf94a..f24198a61 100644 --- a/proto.lock +++ b/proto.lock @@ -1569,6 +1569,32 @@ { "protopath": "pkg:/:pb:/:metainfo.proto", "def": { + "enums": [ + { + "name": "Object.Status", + "enum_fields": [ + { + "name": "INVALID" + }, + { + "name": "UPLOADING", + "integer": 1 + }, + { + "name": "COMMITTING", + "integer": 2 + }, + { + "name": "COMMITTED", + "integer": 3 + }, + { + "name": "DELETING", + "integer": 4 + } + ] + } + ], "messages": [ { "name": "Bucket", @@ -2144,6 +2170,538 @@ "type": "bytes" } ] + }, + { + "name": "Object", + "fields": [ + { + "id": 1, + "name": "bucket", + "type": "bytes" + }, + { + "id": 2, + "name": "encrypted_path", + "type": "bytes" + }, + { + "id": 3, + "name": "version", + "type": "int32" + }, + { + "id": 4, + "name": "status", + "type": "Status" + }, + { + "id": 5, + "name": "stream_id", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "StreamID" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 6, + "name": "created_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 7, + "name": "status_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 8, + "name": "expires_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 9, + "name": "encrypted_metadata_nonce", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "Nonce" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 10, + "name": "encrypted_metadata", + "type": "bytes" + }, + { + "id": 11, + "name": "fixed_segment_size", + "type": "int64" + }, + { + "id": 12, + "name": "redundancy_scheme", + "type": "pointerdb.RedundancyScheme" + }, + { + "id": 13, + "name": "encryption_parameters", + "type": "encryption.EncryptionParameters" + }, + { + "id": 14, + "name": "total_size", + "type": "int64" + }, + { + "id": 15, + "name": "inline_size", + "type": "int64" + }, + { + "id": 16, + "name": "remote_size", + "type": "int64" + } + ] + }, + { + "name": "ObjectBeginRequest", + "fields": [ + { + "id": 1, + "name": "bucket", + "type": "bytes" + }, + { + "id": 2, + "name": "encrypted_path", + "type": "bytes" + }, + { + "id": 3, + "name": "version", + "type": "int32" + }, + { + "id": 4, + "name": "expires_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 5, + "name": "encrypted_metadata_nonce", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "Nonce" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 6, + "name": "encrypted_metadata", + "type": "bytes" + }, + { + "id": 7, + "name": "redundancy_scheme", + "type": "pointerdb.RedundancyScheme" + }, + { + "id": 8, + "name": "encryption_parameters", + "type": "encryption.EncryptionParameters" + } + ] + }, + { + "name": "ObjectBeginResponse", + "fields": [ + { + "id": 1, + "name": "bucket", + "type": "bytes" + }, + { + "id": 2, + "name": "encrypted_path", + "type": "bytes" + }, + { + "id": 3, + "name": "version", + "type": "int32" + }, + { + "id": 4, + "name": "stream_id", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "StreamID" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 5, + "name": "redundancy_scheme", + "type": "pointerdb.RedundancyScheme" + }, + { + "id": 6, + "name": "encryption_parameters", + "type": "encryption.EncryptionParameters" + } + ] + }, + { + "name": "ObjectCommitRequest", + "fields": [ + { + "id": 1, + "name": "stream_id", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "StreamID" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + } + ] + }, + { + "name": "ObjectCommitResponse" + }, + { + "name": "ObjectListRequest", + "fields": [ + { + "id": 1, + "name": "bucket", + "type": "bytes" + }, + { + "id": 2, + "name": "encrypted_prefix", + "type": "bytes" + }, + { + "id": 3, + "name": "encrypted_cursor", + "type": "bytes" + }, + { + "id": 4, + "name": "limit", + "type": "int32" + }, + { + "id": 5, + "name": "object_includes", + "type": "ObjectListItemIncludes" + } + ] + }, + { + "name": "ObjectListResponse", + "fields": [ + { + "id": 1, + "name": "items", + "type": "ObjectListItem", + "is_repeated": true + }, + { + "id": 2, + "name": "more", + "type": "bool" + } + ] + }, + { + "name": "ObjectListItem", + "fields": [ + { + "id": 1, + "name": "encrypted_path", + "type": "bytes" + }, + { + "id": 2, + "name": "version", + "type": "int32" + }, + { + "id": 3, + "name": "status", + "type": "Object.Status" + }, + { + "id": 4, + "name": "created_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 5, + "name": "status_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 6, + "name": "expires_at", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 7, + "name": "encrypted_metadata_nonce", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "Nonce" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 8, + "name": "encrypted_metadata", + "type": "bytes" + } + ] + }, + { + "name": "ObjectListItemIncludes", + "fields": [ + { + "id": 1, + "name": "metadata", + "type": "bool" + } + ] + }, + { + "name": "ObjectBeginDeleteRequest", + "fields": [ + { + "id": 1, + "name": "bucket", + "type": "bytes" + }, + { + "id": 2, + "name": "encrypted_path", + "type": "bytes" + }, + { + "id": 3, + "name": "version", + "type": "int32" + } + ] + }, + { + "name": "ObjectBeginDeleteResponse", + "fields": [ + { + "id": 1, + "name": "stream_id", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "StreamID" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + } + ] + }, + { + "name": "ObjectFinishDeleteRequest", + "fields": [ + { + "id": 1, + "name": "stream_id", + "type": "bytes", + "options": [ + { + "name": "(gogoproto.customtype)", + "value": "StreamID" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + } + ] + }, + { + "name": "ObjectFinishDeleteResponse" + }, + { + "name": "SatStreamID", + "fields": [ + { + "id": 1, + "name": "bucket", + "type": "bytes" + }, + { + "id": 2, + "name": "encrypted_path", + "type": "bytes" + }, + { + "id": 3, + "name": "version", + "type": "int32" + }, + { + "id": 4, + "name": "redundancy", + "type": "pointerdb.RedundancyScheme" + }, + { + "id": 5, + "name": "creation_date", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 6, + "name": "expiration_date", + "type": "google.protobuf.Timestamp", + "options": [ + { + "name": "(gogoproto.stdtime)", + "value": "true" + }, + { + "name": "(gogoproto.nullable)", + "value": "false" + } + ] + }, + { + "id": 7, + "name": "satellite_signature", + "type": "bytes" + } + ] } ], "services": [ @@ -2175,6 +2733,31 @@ "in_type": "BucketSetAttributionRequest", "out_type": "BucketSetAttributionResponse" }, + { + "name": "BeginObject", + "in_type": "ObjectBeginRequest", + "out_type": "ObjectBeginResponse" + }, + { + "name": "CommitObject", + "in_type": "ObjectCommitRequest", + "out_type": "ObjectCommitResponse" + }, + { + "name": "ListObjects", + "in_type": "ObjectListRequest", + "out_type": "ObjectListResponse" + }, + { + "name": "BeginDeleteObject", + "in_type": "ObjectBeginDeleteRequest", + "out_type": "ObjectBeginDeleteResponse" + }, + { + "name": "FinishDeleteObject", + "in_type": "ObjectFinishDeleteRequest", + "out_type": "ObjectFinishDeleteResponse" + }, { "name": "CreateSegmentOld", "in_type": "SegmentWriteRequestOld", diff --git a/satellite/metainfo/metainfo.go b/satellite/metainfo/metainfo.go index f8a009d71..58586648f 100644 --- a/satellite/metainfo/metainfo.go +++ b/satellite/metainfo/metainfo.go @@ -10,6 +10,7 @@ import ( "strconv" "time" + "github.com/gogo/protobuf/proto" "github.com/skyrings/skyring-common/tools/uuid" "github.com/zeebo/errs" "go.uber.org/zap" @@ -19,10 +20,12 @@ import ( "storj.io/storj/pkg/accounting" "storj.io/storj/pkg/auth" + "storj.io/storj/pkg/auth/signing" "storj.io/storj/pkg/eestream" "storj.io/storj/pkg/macaroon" "storj.io/storj/pkg/overlay" "storj.io/storj/pkg/pb" + "storj.io/storj/pkg/storage/meta" "storj.io/storj/pkg/storj" "storj.io/storj/satellite/attribution" "storj.io/storj/satellite/console" @@ -30,7 +33,10 @@ import ( "storj.io/storj/storage" ) -const pieceHashExpiration = 2 * time.Hour +const ( + pieceHashExpiration = 2 * time.Hour + satIDExpiration = 24 * time.Hour +) var ( mon = monkit.Package() @@ -65,11 +71,12 @@ type Endpoint struct { apiKeys APIKeys createRequests *createRequests rsConfig RSConfig + satellite signing.Signer } // NewEndpoint creates new metainfo endpoint instance func NewEndpoint(log *zap.Logger, metainfo *Service, orders *orders.Service, cache *overlay.Cache, partnerinfo attribution.DB, - containment Containment, apiKeys APIKeys, projectUsage *accounting.ProjectUsage, rsConfig RSConfig) *Endpoint { + containment Containment, apiKeys APIKeys, projectUsage *accounting.ProjectUsage, rsConfig RSConfig, satellite signing.Signer) *Endpoint { // TODO do something with too many params return &Endpoint{ log: log, @@ -82,6 +89,7 @@ func NewEndpoint(log *zap.Logger, metainfo *Service, orders *orders.Service, cac projectUsage: projectUsage, createRequests: newCreateRequests(), rsConfig: rsConfig, + satellite: satellite, } } @@ -847,3 +855,248 @@ func convertBucketToProto(ctx context.Context, bucket storj.Bucket) (pbBucket *p }, } } + +// BeginObject begins object +func (endpoint *Endpoint) BeginObject(ctx context.Context, req *pb.ObjectBeginRequest) (resp *pb.ObjectBeginResponse, err error) { + defer mon.Task()(&ctx)(&err) + + keyInfo, err := endpoint.validateAuth(ctx, macaroon.Action{ + Op: macaroon.ActionWrite, + Bucket: req.Bucket, + EncryptedPath: req.EncryptedPath, + Time: time.Now(), + }) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + err = endpoint.validateBucket(ctx, req.Bucket) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, err.Error()) + } + + bucket, err := endpoint.metainfo.GetBucket(ctx, req.Bucket, keyInfo.ProjectID) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, err.Error()) + } + + // take bucket RS values if not set in request + pbRS := req.RedundancyScheme + if pbRS.ErasureShareSize == 0 { + pbRS.ErasureShareSize = bucket.DefaultRedundancyScheme.ShareSize + } + if pbRS.MinReq == 0 { + pbRS.MinReq = int32(bucket.DefaultRedundancyScheme.RequiredShares) + } + if pbRS.RepairThreshold == 0 { + pbRS.RepairThreshold = int32(bucket.DefaultRedundancyScheme.RepairShares) + } + if pbRS.SuccessThreshold == 0 { + pbRS.SuccessThreshold = int32(bucket.DefaultRedundancyScheme.OptimalShares) + } + if pbRS.Total == 0 { + pbRS.Total = int32(bucket.DefaultRedundancyScheme.TotalShares) + } + + pbEP := req.EncryptionParameters + if pbEP.CipherSuite == 0 { + pbEP.CipherSuite = pb.CipherSuite(bucket.DefaultEncryptionParameters.CipherSuite) + } + if pbEP.BlockSize == 0 { + pbEP.BlockSize = int64(bucket.DefaultEncryptionParameters.BlockSize) + } + + satStreamID := &pb.SatStreamID{ + Bucket: req.Bucket, + EncryptedPath: req.EncryptedPath, + Version: req.Version, + Redundancy: pbRS, + CreationDate: time.Now(), + ExpirationDate: req.ExpiresAt, + } + + satStreamID, err = signing.SignStreamID(ctx, endpoint.satellite, satStreamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + encodedStreamID, err := proto.Marshal(satStreamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + streamID, err := storj.StreamIDFromBytes(encodedStreamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + return &pb.ObjectBeginResponse{ + Bucket: req.Bucket, + EncryptedPath: req.EncryptedPath, + Version: req.Version, + StreamId: streamID, + RedundancyScheme: pbRS, + EncryptionParameters: pbEP, + }, nil +} + +// CommitObject commits object when all segments are also committed +func (endpoint *Endpoint) CommitObject(ctx context.Context, req *pb.ObjectCommitRequest) (resp *pb.ObjectCommitResponse, err error) { + defer mon.Task()(&ctx)(&err) + + streamID := &pb.SatStreamID{} + err = proto.Unmarshal(req.StreamId, streamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + err = signing.VerifyStreamID(ctx, endpoint.satellite, streamID) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + if streamID.CreationDate.Before(time.Now().Add(-satIDExpiration)) { + return nil, status.Errorf(codes.InvalidArgument, "stream ID expired") + } + + _, err = endpoint.validateAuth(ctx, macaroon.Action{ + Op: macaroon.ActionWrite, + Bucket: streamID.Bucket, + EncryptedPath: streamID.EncryptedPath, + Time: time.Now(), + }) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + // we don't need to do anything for shim implementation + + return &pb.ObjectCommitResponse{}, nil +} + +// ListObjects list objects according to specific parameters +func (endpoint *Endpoint) ListObjects(ctx context.Context, req *pb.ObjectListRequest) (resp *pb.ObjectListResponse, err error) { + defer mon.Task()(&ctx)(&err) + + keyInfo, err := endpoint.validateAuth(ctx, macaroon.Action{ + Op: macaroon.ActionList, + Bucket: req.Bucket, + EncryptedPath: []byte{}, + Time: time.Now(), + }) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + err = endpoint.validateBucket(ctx, req.Bucket) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, err.Error()) + } + + prefix, err := CreatePath(ctx, keyInfo.ProjectID, -1, req.Bucket, req.EncryptedPrefix) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, err.Error()) + } + + metaflags := meta.All + // TODO use flags + // TODO find out how EncryptedCursor -> startAfter/endAfter + segments, more, err := endpoint.metainfo.List(ctx, prefix, "", "", false, req.Limit, metaflags) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + items := make([]*pb.ObjectListItem, len(segments)) + for i, segment := range segments { + items[i] = &pb.ObjectListItem{ + EncryptedPath: []byte(segment.Path), + CreatedAt: segment.Pointer.CreationDate, + ExpiresAt: segment.Pointer.ExpirationDate, + } + } + + return &pb.ObjectListResponse{ + Items: items, + More: more, + }, nil +} + +// BeginDeleteObject begins object deletion process +func (endpoint *Endpoint) BeginDeleteObject(ctx context.Context, req *pb.ObjectBeginDeleteRequest) (resp *pb.ObjectBeginDeleteResponse, err error) { + defer mon.Task()(&ctx)(&err) + + _, err = endpoint.validateAuth(ctx, macaroon.Action{ + Op: macaroon.ActionDelete, + Bucket: req.Bucket, + EncryptedPath: req.EncryptedPath, + Time: time.Now(), + }) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + err = endpoint.validateBucket(ctx, req.Bucket) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, err.Error()) + } + + satStreamID := &pb.SatStreamID{ + Bucket: req.Bucket, + EncryptedPath: req.EncryptedPath, + Version: req.Version, + CreationDate: time.Now(), + } + + satStreamID, err = signing.SignStreamID(ctx, endpoint.satellite, satStreamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + encodedStreamID, err := proto.Marshal(satStreamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + streamID, err := storj.StreamIDFromBytes(encodedStreamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + return &pb.ObjectBeginDeleteResponse{ + StreamId: streamID, + }, nil +} + +// FinishDeleteObject finishes object deletion +func (endpoint *Endpoint) FinishDeleteObject(ctx context.Context, req *pb.ObjectFinishDeleteRequest) (resp *pb.ObjectFinishDeleteResponse, err error) { + defer mon.Task()(&ctx)(&err) + + streamID := &pb.SatStreamID{} + err = proto.Unmarshal(req.StreamId, streamID) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + err = signing.VerifyStreamID(ctx, endpoint.satellite, streamID) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + if streamID.CreationDate.Before(time.Now().Add(-satIDExpiration)) { + return nil, status.Errorf(codes.InvalidArgument, "stream ID expired") + } + + _, err = endpoint.validateAuth(ctx, macaroon.Action{ + Op: macaroon.ActionDelete, + Bucket: streamID.Bucket, + EncryptedPath: streamID.EncryptedPath, + Time: time.Now(), + }) + if err != nil { + return nil, status.Errorf(codes.Unauthenticated, err.Error()) + } + + // we don't need to do anything for shim implementation + + return &pb.ObjectFinishDeleteResponse{}, nil +} diff --git a/satellite/metainfo/metainfo_test.go b/satellite/metainfo/metainfo_test.go index 21d72641a..a08822a91 100644 --- a/satellite/metainfo/metainfo_test.go +++ b/satellite/metainfo/metainfo_test.go @@ -6,6 +6,7 @@ package metainfo_test import ( "context" "sort" + "strconv" "testing" "time" @@ -813,3 +814,103 @@ func TestBucketNameValidation(t *testing.T) { } }) } + +func TestBeginCommitObject(t *testing.T) { + testplanet.Run(t, testplanet.Config{ + SatelliteCount: 1, StorageNodeCount: 0, UplinkCount: 1, + }, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) { + apiKey := planet.Uplinks[0].APIKey[planet.Satellites[0].ID()] + uplink := planet.Uplinks[0] + + config := uplink.GetConfig(planet.Satellites[0]) + metainfoService := planet.Satellites[0].Metainfo.Service + + projects, err := planet.Satellites[0].DB.Console().Projects().GetAll(ctx) + require.NoError(t, err) + projectID := projects[0].ID + + bucket := storj.Bucket{ + Name: "initial-bucket", + ProjectID: projectID, + PathCipher: config.GetEncryptionParameters().CipherSuite, + } + _, err = metainfoService.CreateBucket(ctx, bucket) + require.NoError(t, err) + + metainfo, err := planet.Uplinks[0].DialMetainfo(ctx, planet.Satellites[0], apiKey) + require.NoError(t, err) + defer ctx.Check(metainfo.Close) + + streamID, err := metainfo.BeginObject( + ctx, + []byte(bucket.Name), + []byte("encrypted-path"), + 1, + storj.RedundancyScheme{}, + storj.EncryptionParameters{}, + time.Time{}, + testrand.Nonce(), + testrand.Bytes(memory.KiB), + ) + require.NoError(t, err) + + err = metainfo.CommitObject(ctx, streamID) + require.NoError(t, err) + }) +} + +func TestBeginFinishDeleteObject(t *testing.T) { + testplanet.Run(t, testplanet.Config{ + SatelliteCount: 1, StorageNodeCount: 0, UplinkCount: 1, + }, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) { + apiKey := planet.Uplinks[0].APIKey[planet.Satellites[0].ID()] + + metainfo, err := planet.Uplinks[0].DialMetainfo(ctx, planet.Satellites[0], apiKey) + require.NoError(t, err) + defer ctx.Check(metainfo.Close) + + streamID, err := metainfo.BeginDeleteObject( + ctx, + []byte("initial-bucket"), + []byte("encrypted-path"), + 1, + ) + require.NoError(t, err) + + err = metainfo.FinishDeleteObject(ctx, streamID) + require.NoError(t, err) + }) +} + +func TestListObjects(t *testing.T) { + testplanet.Run(t, testplanet.Config{ + SatelliteCount: 1, StorageNodeCount: 0, UplinkCount: 1, + }, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) { + apiKey := planet.Uplinks[0].APIKey[planet.Satellites[0].ID()] + uplink := planet.Uplinks[0] + + files := make([]string, 10) + data := testrand.Bytes(1 * memory.KiB) + for i := 0; i < len(files); i++ { + files[i] = "path" + strconv.Itoa(i) + err := uplink.Upload(ctx, planet.Satellites[0], "testbucket", files[i], data) + require.NoError(t, err) + } + + metainfo, err := planet.Uplinks[0].DialMetainfo(ctx, planet.Satellites[0], apiKey) + require.NoError(t, err) + defer ctx.Check(metainfo.Close) + + items, _, err := metainfo.ListObjects(ctx, []byte("testbucket"), []byte(""), []byte(""), 0) + require.NoError(t, err) + require.Equal(t, len(files), len(items)) + for _, item := range items { + require.NotEmpty(t, item.EncryptedPath) + require.True(t, item.CreatedAt.Before(time.Now())) + } + + items, _, err = metainfo.ListObjects(ctx, []byte("testbucket"), []byte(""), []byte(""), 3) + require.NoError(t, err) + require.Equal(t, 3, len(items)) + }) +} diff --git a/satellite/peer.go b/satellite/peer.go index 30ac5de1f..d5d6d7bc7 100644 --- a/satellite/peer.go +++ b/satellite/peer.go @@ -418,6 +418,7 @@ func New(log *zap.Logger, full *identity.FullIdentity, db DB, config *Config, ve peer.DB.Console().APIKeys(), peer.Accounting.ProjectUsage, config.Metainfo.RS, + signing.SignerFromFullIdentity(peer.Identity), ) pb.RegisterMetainfoServer(peer.Server.GRPC(), peer.Metainfo.Endpoint2) diff --git a/uplink/metainfo/client.go b/uplink/metainfo/client.go index 50cc781bf..019560a27 100644 --- a/uplink/metainfo/client.go +++ b/uplink/metainfo/client.go @@ -341,3 +341,103 @@ func convertProtoToBucket(pbBucket *pb.Bucket) storj.Bucket { }, } } + +// BeginObject begins object creation +func (client *Client) BeginObject(ctx context.Context, bucket []byte, encryptedPath []byte, version int32, + rs storj.RedundancyScheme, ep storj.EncryptionParameters, expiresAt time.Time, nonce storj.Nonce, encryptedMetadata []byte) (_ storj.StreamID, err error) { + defer mon.Task()(&ctx)(&err) + + // TODO do proper algorithm conversion + response, err := client.client.BeginObject(ctx, &pb.ObjectBeginRequest{ + Bucket: bucket, + EncryptedPath: encryptedPath, + Version: version, + ExpiresAt: expiresAt, + EncryptedMetadataNonce: nonce, + EncryptedMetadata: encryptedMetadata, + RedundancyScheme: &pb.RedundancyScheme{ + Type: pb.RedundancyScheme_RS, + ErasureShareSize: rs.ShareSize, + MinReq: int32(rs.RequiredShares), + RepairThreshold: int32(rs.RepairShares), + SuccessThreshold: int32(rs.OptimalShares), + Total: int32(rs.TotalShares), + }, + EncryptionParameters: &pb.EncryptionParameters{ + CipherSuite: pb.CipherSuite(ep.CipherSuite), + BlockSize: int64(ep.BlockSize), + }, + }) + if err != nil { + return nil, Error.Wrap(err) + } + + return response.StreamId, nil +} + +// CommitObject commits created object +func (client *Client) CommitObject(ctx context.Context, streamID storj.StreamID) (err error) { + defer mon.Task()(&ctx)(&err) + + _, err = client.client.CommitObject(ctx, &pb.ObjectCommitRequest{ + StreamId: streamID, + }) + return Error.Wrap(err) +} + +// BeginDeleteObject begins object deletion process +func (client *Client) BeginDeleteObject(ctx context.Context, bucket []byte, encryptedPath []byte, version int32) (_ storj.StreamID, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.BeginDeleteObject(ctx, &pb.ObjectBeginDeleteRequest{ + Bucket: bucket, + EncryptedPath: encryptedPath, + Version: version, + }) + if err != nil { + return storj.StreamID{}, Error.Wrap(err) + } + + return response.StreamId, nil +} + +// FinishDeleteObject finishes object deletion process +func (client *Client) FinishDeleteObject(ctx context.Context, streamID storj.StreamID) (err error) { + defer mon.Task()(&ctx)(&err) + + _, err = client.client.FinishDeleteObject(ctx, &pb.ObjectFinishDeleteRequest{ + StreamId: streamID, + }) + return Error.Wrap(err) +} + +// ListObjects lists objects according to specific parameters +func (client *Client) ListObjects(ctx context.Context, bucket []byte, encryptedPrefix []byte, encryptedCursor []byte, limit int32) (_ []storj.ObjectListItem, more bool, err error) { + defer mon.Task()(&ctx)(&err) + + response, err := client.client.ListObjects(ctx, &pb.ObjectListRequest{ + Bucket: bucket, + EncryptedPrefix: encryptedPrefix, + EncryptedCursor: encryptedCursor, + Limit: limit, + }) + if err != nil { + return []storj.ObjectListItem{}, false, Error.Wrap(err) + } + + objects := make([]storj.ObjectListItem, len(response.Items)) + for i, object := range response.Items { + objects[i] = storj.ObjectListItem{ + EncryptedPath: object.EncryptedPath, + Version: object.Version, + Status: int32(object.Status), + StatusAt: object.StatusAt, + CreatedAt: object.CreatedAt, + ExpiresAt: object.ExpiresAt, + EncryptedMetadataNonce: object.EncryptedMetadataNonce, + EncryptedMetadata: object.EncryptedMetadata, + } + } + + return objects, response.More, Error.Wrap(err) +}