Commit graph

66 commits

Author SHA1 Message Date
Stanislav Bogatyrev
a07a518a1e [#66] object: Add object_id signature to Head response
Object ID signature is needed to check Header authenticity.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-09-03 16:10:05 +03:00
Stanislav Bogatyrev
c8054c5daa [#58] netmap: Simplify Placement Policy
Proposed protobuf format for Placement Policy simplifies direct editing in
visual editors and import/export from other formats like JSON.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-09-01 21:15:09 +03:00
Stanislav Bogatyrev
fc170f56bf [#57] Merge service and session packages
Merging session and service packages to increase clarity and reduce
cross-dependencies.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-20 10:33:49 +03:00
Stanislav Bogatyrev
762c9762ef [#56] Fix typos and regenerate docs
Sorry =)

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 18:41:44 +03:00
Stanislav Bogatyrev
526792324d [#56] Add separate checksum type
NeoFS uses different checksum algorithms. It looks like we need to explicitly
define what algorithm is used in each particular case.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 18:36:31 +03:00
Stanislav Bogatyrev
e5f78eb927 Move SessionToken to session package
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 18:31:36 +03:00
Stanislav Bogatyrev
7d72061fb3 Move BearerToken type to acl package
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 18:31:36 +03:00
Stanislav Bogatyrev
54778a86ed Move Version to refs
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 18:31:36 +03:00
Stanislav Bogatyrev
13a80df882 Use common signature type
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 15:04:15 +03:00
Stanislav Bogatyrev
a78b8a1ea5 Move all service types to types.proto
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-18 15:04:15 +03:00
Stanislav Bogatyrev
4e908a17b1 [#50] Add version fields where it makes sense
Some pieces of data (container, object, etc) may be stored for a long time and
there will be a need in the future to understand which obscure format from the
past was used to create it.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-17 12:12:30 +03:00
Stanislav Bogatyrev
7555e166b2 [#49] Minor reformat
- Trying to move enums to the package level
- Trying to keep all definitions in types.proto

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-17 12:12:16 +03:00
Stanislav Bogatyrev
e63a482529 [#48] Add grpc suffix to go_package option
To simplify adding more transport level protocols to neofs-api-go in future, we
need to separate currently default gRPC.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-17 12:11:38 +03:00
Stanislav Bogatyrev
42e35fefff [#45] Fix linter errors
- Changed package names adding version
- Added documentation descriptions (sometimes useless) for all fields
- Changed enum format
- Made SessionToken and BearerToken field names more clear

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-13 22:57:00 +03:00
Stanislav Bogatyrev
cfd24944a4 [#38] Typo fixes
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-11 21:36:03 +03:00
Stanislav Bogatyrev
818ec7f0dc [#38] Change ObjectID format from UUID to Hash
NeoFS Object are now Content-addressed. It means the Object's address depends on
it's content. ObjectID is now calculated as hash of Header, which contains a
hash of payload. If either if Object's payload of Headers change, the ID will
also change.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-11 16:30:39 +03:00
Alex Vanin
60690a0f0b [#37] Add body message to object requests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-08-11 12:37:06 +03:00
Stanislav Bogatyrev
327c476ecf [#41] Reindent according to Google Style Guide
Just a minor change to follow 2-space indent declared in Google Style Guide

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-11 12:08:37 +03:00
Leonard Lyubich
b088391294 [#40] service: Rename Token to SessionToken
Rename Token message to SessionToken to clarify its purpose.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-11 11:50:36 +03:00
Stanislav Bogatyrev
e75ef53793 [#32] Rename fields according to Protobuf Style Guide
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-08-07 14:36:15 +03:00
Leonard Lyubich
05a885e142 object: Tidy up the format
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 23:45:50 +03:00
Leonard Lyubich
0ca83fcef6 service: Tidy up the format
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 23:45:50 +03:00
Leonard Lyubich
23f571f76f object: Remove response meta header
This commit removes ResponseMetaHeader from the repository since it is not
verifiable and its purpose is questionable. If needed, it can be added to
queries without losing compatibility with the API version.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 23:45:50 +03:00
Leonard Lyubich
3518fc42bd object: Replace Raw flag
In previous version of the format RequestMetaHeader, which is included in
all requests, contained the boolean flag Raw. However, this option was
processed only in object.Head and object.Get rpc. Therefore, this commit
strips the field from the request meta header and adds it to the mentioned
requests.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 23:45:50 +03:00
Leonard Lyubich
53299d7841 [#32] object: Remove gogoproto from typedef
There is a need to remove gogoproto usage from NeoFS API since this plugin
is not cross-language. This commit removes usage from object package.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 23:45:50 +03:00
Leonard Lyubich
c88d1fdae3 query: Move Query to object
Move Query message definition to object package since it is only used there.
Package query is completely removed from the repository.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 23:11:16 +03:00
Leonard Lyubich
40420f3ab0 [#31] refs: Use OwnerID message in all services
Change the type of all fields for identifier of the container owner to
refs.OwnerID. This will allow you to follow a single format and not duplicate
its description.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 22:00:01 +03:00
Leonard Lyubich
fccd753a5d [#31] refs: Use ContainerID message in all services
Change the type of all fields for the container identifier to refs.ContainerID.
This will allow to follow a single format and not duplicate its description.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 22:00:01 +03:00
Leonard Lyubich
67ecea7507 [#28] object: Move storage group information
In previous version of the format storage group information was stored in
completely in the dedicated header field. However, having a header field
instead of storing it in a payload is not justified, since it is used only
to check the presence in the object. Based on this, this commit defines a
message for marking the object as the custodian of information about the
storage group and changes the type of field StorageGroup to it. Information
about the storage group will be stored serialized in the payload of the
objects marked in this way

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 22:00:01 +03:00
Leonard Lyubich
974a2288c4 [#26] object: Add line breaks for readability
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
a5c1b3683b [#26] object: Rename System header to Main
In the previous format, the object header was subdivided into system and
extended parts, which confused the purpose of these parts. In particular,
the extended header contains system fields. To clarify the non-intersection
of the mentioned parts of the object header, it was decided to rename System
to Main.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
eaad094a2c [#26] object: Tidy up comments
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
0525786d09 [#26] object: Use nested types in Header
This commit replaces all message definitions related to object header to
Header message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
81a4adb202 [#26] object: Use nested types in ExtendedHeader
This commit replaces all message definitions related to extended header to
ExtendedHeader message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
72edea28db [#26] object: Change field order in Header
This commit changes field order in ExtendedHeader message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
a3a0de01b3 [#26] object: Replace Token to IntegrityHeader
This commit replaces Token field from ExtendedHeader to IntegrityHeader for
assembling all verification data in one structure.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
8e8d9f0982 [#26] object: Replace Epoch to ExtendedHeader
This commit replaces CreationEpoch field to ExtendedHeader message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
a28decac39 [#26] object: Repeat object attributes in header
This commit replaces single Attribute field with the repeated list of
Attribute in ExtendedHeader message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
fb2064803e [#26] object: Replace PayloadChecksum to Integrity
This commit replaces PayloadChecksum field from ExtendedHeader to
IntegrityHeader for assembling all verification data in one structure.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
b77811716e [#26] object: Replace creator key to Integrity
This commit moves the public key of the creator of the object to
IntegrityHeader to encapsulate the verification data in one message. Thus
field PublicKey of message Header has been moved to message IntegrityHeader
with the name CreatorKey. As a result, PublicKey message is deleted as no
longer used.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
0a5f3d5a01 [#26] object: Remove unused Redirect field
Redirect field was introduced for the future, however, at the moment it is
not used anywhere. This commit removes field Redirect from ExtendedHeader
message. It can be added back later without losing API backward
compatibility.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
4df4badf9c [#26] object: Remove Link message
After updating the structure of SplitHeader and StorageGroup messages, the
Link header field is no longer needed. This commit removes the field and
message Link as no longer used.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
7ce0945e6c [#26] object: Remove unused Version field
Field with object revision number was introduced for the future, however, at
the moment it is not used anywhere. This commit removes field Version from
SystemHeader message. It can be added back later without losing API
backward compatibility.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
9666fd4bc7 [#26] object: Remake ExtendedHeader to field set
In previous version of the format ExtendedHeader consisted of one field
Value, defined by oneof mechanism. Such a definition format give complete
freedom when composing an object header, however, it did not allow strictly
structuring the header format at the level of type syntax. Since the object
has a well-defined structure in the system, this commit replaces the
definition through oneof with a set of fields. As a consequence, storing a
set of extended headers of the new type in the general header became
redundant, so the repeated keyword was removed.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
cbd4cf63f9 [#26] object: Replace Transform header with Split
This commit replaces Transform message with SplitHeader in oneof definition
of Value field of Header message. The latter, unlike the first, carries
complete information about the generation of the object by splitting the
payload. As a result, the message is deleted as no longer used.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
485510ab66 [#26] object: Define object split info message
This commit defines SplitHeader message that encapsulates data about
spawning the object through a payload splitting. Message fields contain
information about the hierarchy in the split-chain as well as information
about the origin object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
b46011db45 [#26] object: Combine ID and CID in Address
This commit merges object system header fields ID and CID into field Address
of type refs.Address. This will allow you to reuse an already existing type
of object reference without duplication and simplify taking the address
from the object body

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
6e5565f238 [#26] object: Replace CreationPoint with Epoch
In previous version of the format Object message included moment of creation
in two epoch times: NeoFS and Unix. Since unix  is not processed in the
system, this commit narrows the time point of object creation to the system
epoch number. The object.CreationPoint message has therefore been deleted
as no longer used

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
5beca3b0d1 [#26] object: Define message for object header
In previous version of the format Object message included two header fields:
SystemHeader and list of ExtendedHeader. Due to the fact that all headers
were not encapsulated in a single message, some messages were forced to use
Object to convey the full header of the object (e.g. object.HeadResponse).
To resolve this semantic inconsistency, this commit defines a Header
message, consisting of a system and an extended portion. As a result, the
Object now consists of two fields - Header and Payload.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00
Leonard Lyubich
2c3717bdee [#26] object: Rename Header to ExtendedHeader
The naming Header obscures its semantic meaning precisely as a subclass of
the general object header. To clarify the layers of typing object headers,
this commit renames the message to ExtendedHeader. As a result, the Headers
field in the Object has been renamed to ExtendedHeaders.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00